version 1.169, 2008/07/25 22:45:58 |
version 1.170, 2008/08/04 03:55:47 |
|
|
#include <sys/cdefs.h> |
#include <sys/cdefs.h> |
__KERNEL_RCSID(0, "$NetBSD$"); |
__KERNEL_RCSID(0, "$NetBSD$"); |
|
|
|
#include "opt_inet.h" |
#include "opt_sock_counters.h" |
#include "opt_sock_counters.h" |
#include "opt_sosend_loan.h" |
#include "opt_sosend_loan.h" |
#include "opt_mbuftrace.h" |
#include "opt_mbuftrace.h" |
Line 624 sofree(struct socket *so) |
|
Line 625 sofree(struct socket *so) |
|
KASSERT(!cv_has_waiters(&so->so_snd.sb_cv)); |
KASSERT(!cv_has_waiters(&so->so_snd.sb_cv)); |
sorflush(so); |
sorflush(so); |
refs = so->so_aborting; /* XXX */ |
refs = so->so_aborting; /* XXX */ |
|
#ifdef INET |
|
/* remove acccept filter if one is present. */ |
|
if (so->so_accf != NULL) |
|
do_setopt_accept_filter(so, NULL); |
|
#endif |
sounlock(so); |
sounlock(so); |
if (refs == 0) /* XXX */ |
if (refs == 0) /* XXX */ |
soput(so); |
soput(so); |
Line 1572 sorflush(struct socket *so) |
|
Line 1578 sorflush(struct socket *so) |
|
static int |
static int |
sosetopt1(struct socket *so, int level, int optname, struct mbuf *m) |
sosetopt1(struct socket *so, int level, int optname, struct mbuf *m) |
{ |
{ |
|
#ifdef INET |
|
int error, optval, val; |
|
#else |
int optval, val; |
int optval, val; |
|
#endif |
struct linger *l; |
struct linger *l; |
struct sockbuf *sb; |
struct sockbuf *sb; |
struct timeval *tv; |
struct timeval *tv; |
|
|
switch (optname) { |
switch (optname) { |
|
|
|
#ifdef INET |
|
case SO_ACCEPTFILTER: |
|
error = do_setopt_accept_filter(so, m); |
|
if (error) |
|
return error; |
|
break; |
|
#endif |
|
|
case SO_LINGER: |
case SO_LINGER: |
if (m == NULL || m->m_len != sizeof(struct linger)) |
if (m == NULL || m->m_len != sizeof(struct linger)) |
return EINVAL; |
return EINVAL; |
Line 1726 sogetopt(struct socket *so, int level, i |
|
Line 1744 sogetopt(struct socket *so, int level, i |
|
|
|
switch (optname) { |
switch (optname) { |
|
|
|
#ifdef INET |
|
case SO_ACCEPTFILTER: |
|
error = do_getopt_accept_filter(so, m); |
|
break; |
|
#endif |
|
|
case SO_LINGER: |
case SO_LINGER: |
m->m_len = sizeof(struct linger); |
m->m_len = sizeof(struct linger); |
mtod(m, struct linger *)->l_onoff = |
mtod(m, struct linger *)->l_onoff = |