diff --git a/sys/conf/files b/sys/conf/files index 2b4ebfbc7901..34d98218050b 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3017,7 +3017,7 @@ kern/tty_outq.c standard kern/tty_pts.c standard kern/tty_tty.c standard kern/tty_ttydisc.c standard -kern/uipc_accf.c optional inet +kern/uipc_accf.c standard kern/uipc_debug.c optional ddb kern/uipc_domain.c standard kern/uipc_mbuf.c standard diff --git a/sys/kern/uipc_accf.c b/sys/kern/uipc_accf.c index 236b60d01cfd..78ddd8641145 100644 --- a/sys/kern/uipc_accf.c +++ b/sys/kern/uipc_accf.c @@ -60,9 +60,8 @@ MALLOC_DEFINE(M_ACCF, "accf", "accept filter data"); static int unloadable = 0; -SYSCTL_DECL(_net_inet); /* XXX: some header should do this for me */ -SYSCTL_NODE(_net_inet, OID_AUTO, accf, CTLFLAG_RW, 0, "Accept filters"); -SYSCTL_INT(_net_inet_accf, OID_AUTO, unloadable, CTLFLAG_RW, &unloadable, 0, +SYSCTL_NODE(_net, OID_AUTO, accf, CTLFLAG_RW, 0, "Accept filters"); +SYSCTL_INT(_net_accf, OID_AUTO, unloadable, CTLFLAG_RW, &unloadable, 0, "Allow unload of accept filters (not recommended)"); /* diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 52c244e97aa2..6abc37a14c68 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -378,11 +378,9 @@ sodealloc(struct socket *so) if (so->so_snd.sb_hiwat) (void)chgsbsize(so->so_cred->cr_uidinfo, &so->so_snd.sb_hiwat, 0, RLIM_INFINITY); -#ifdef INET /* remove acccept filter if one is present. */ if (so->so_accf != NULL) do_setopt_accept_filter(so, NULL); -#endif #ifdef MAC mac_socket_destroy(so); #endif @@ -2402,13 +2400,12 @@ sosetopt(struct socket *so, struct sockopt *sopt) error = ENOPROTOOPT; } else { switch (sopt->sopt_name) { -#ifdef INET case SO_ACCEPTFILTER: error = do_setopt_accept_filter(so, sopt); if (error) goto bad; break; -#endif + case SO_LINGER: error = sooptcopyin(sopt, &l, sizeof l, sizeof l); if (error) @@ -2635,11 +2632,10 @@ sogetopt(struct socket *so, struct sockopt *sopt) return (error); } else { switch (sopt->sopt_name) { -#ifdef INET case SO_ACCEPTFILTER: error = do_getopt_accept_filter(so, sopt); break; -#endif + case SO_LINGER: SOCK_LOCK(so); l.l_onoff = so->so_options & SO_LINGER; diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index e5ebdaa0bab3..94d29e5be679 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -394,3 +394,5 @@ SYSCTL_NODE(_net_inet, IPPROTO_IPCOMP, ipcomp, CTLFLAG_RW, 0, "IPCOMP"); SYSCTL_NODE(_net_inet, IPPROTO_IPIP, ipip, CTLFLAG_RW, 0, "IPIP"); #endif /* IPSEC */ SYSCTL_NODE(_net_inet, IPPROTO_RAW, raw, CTLFLAG_RW, 0, "RAW"); +SYSCTL_NODE(_net_inet, OID_AUTO, accf, CTLFLAG_RW, 0, + "Accept filters");