diff options
author | peter <peter@FreeBSD.org> | 1995-07-18 09:56:44 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-07-18 09:56:44 +0000 |
commit | 8424d675bc800cef5b661fa40603ec3836315fc7 (patch) | |
tree | 138ac41c38124e476ab8920832c30c03e5fe0d60 /sys/netinet/ip_input.c | |
parent | 5105427ac0aae405dfc58fee4fbcb81902fb92d2 (diff) | |
download | FreeBSD-src-8424d675bc800cef5b661fa40603ec3836315fc7.zip FreeBSD-src-8424d675bc800cef5b661fa40603ec3836315fc7.tar.gz |
Change the compile-time option of DIRECTED_BROADCAST into a sysctl
variable underneath ip, "directed-broadcast".
Reviewed by: David Greenman
Obtained from: NetBSD, by Darren Reed.
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index d91a0f9..b514ca7 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_input.c,v 1.24 1995/06/27 17:26:27 guido Exp $ + * $Id: ip_input.c,v 1.25 1995/07/09 14:29:46 davidg Exp $ */ #include <sys/param.h> @@ -79,8 +79,12 @@ struct socket *ip_rsvpd; #ifndef IPSENDREDIRECTS #define IPSENDREDIRECTS 1 #endif +#ifndef DIRECTED_BROADCAST +#define DIRECTED_BROADCAST 0 +#endif int ipforwarding = IPFORWARDING; int ipsendredirects = IPSENDREDIRECTS; +int ipdirbroadcast = DIRECTED_BROADCAST; int ip_defttl = IPDEFTTL; int ip_dosourceroute = 0; #ifdef DIAGNOSTIC @@ -273,10 +277,7 @@ next: if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr) goto ours; - if ( -#ifdef DIRECTED_BROADCAST - ia->ia_ifp == m->m_pkthdr.rcvif && -#endif + if ((!ipdirbroadcast || ia->ia_ifp == m->m_pkthdr.rcvif) && (ia->ia_ifp->if_flags & IFF_BROADCAST)) { u_long t; @@ -1206,6 +1207,9 @@ ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen) case IPCTL_SENDREDIRECTS: return (sysctl_int(oldp, oldlenp, newp, newlen, &ipsendredirects)); + case IPCTL_DIRECTEDBROADCAST: + return (sysctl_int(oldp, oldlenp, newp, newlen, + &ipdirbroadcast)); case IPCTL_DEFTTL: return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_defttl)); case IPCTL_SOURCEROUTE: |