summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2010-01-13 01:26:29 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2010-01-13 01:26:29 +0000
commit64631418c76f9f64f0669c6a1eb8af1e13dcd1fb (patch)
treeaab7ff568292324ad3b59e2332ba05c045e090a0 /sys/netinet/ip_input.c
parentda63e03a18b2653082b4875ea1dd428bb5535bfd (diff)
let's admit it's not 1992 any more. CIDR is around for a long time, even
that router vendor doesn't default to classful routing any more, and there really is no point in having a classful netmask and a subnetmask to split it. we still do classful guesses on the netmask if it isn't supplied by userland, but that's about it. i decided to keep ia_netmask and kill ia_subnetmask which makes this diff bigish, the classful ia_netmask wasn't really used all that much. the real changes are in in.c, the rest is mostly s/ia_subnetmask/ia_netmask. ok claudio dlg ryan
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index aff88edb71e..85f0053d54d 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.174 2009/12/07 08:19:37 gollo Exp $ */
+/* $OpenBSD: ip_input.c,v 1.175 2010/01/13 01:26:28 henning Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -689,7 +689,7 @@ in_iawithaddr(struct in_addr ina, struct mbuf *m, u_int rdomain)
if ((ina.s_addr == ia->ia_addr.sin_addr.s_addr) ||
((ia->ia_ifp->if_flags & (IFF_LOOPBACK|IFF_LINK1)) ==
(IFF_LOOPBACK|IFF_LINK1) &&
- ia->ia_subnet == (ina.s_addr & ia->ia_subnetmask)))
+ ia->ia_net == (ina.s_addr & ia->ia_netmask)))
return ia;
if (((ip_directedbcast == 0) || (m && ip_directedbcast &&
ia->ia_ifp == m->m_pkthdr.rcvif)) &&
@@ -700,7 +700,6 @@ in_iawithaddr(struct in_addr ina, struct mbuf *m, u_int rdomain)
* Look for all-0's host part (old broadcast addr),
* either for subnet or net.
*/
- ina.s_addr == ia->ia_subnet ||
ina.s_addr == ia->ia_net) {
/* Make sure M_BCAST is set */
if (m)
@@ -1496,8 +1495,8 @@ ip_forward(m, srcrt)
!ip_weadvertise(satosin(rt_key(rt))->sin_addr.s_addr,
m->m_pkthdr.rdomain)) {
if (rt->rt_ifa &&
- (ip->ip_src.s_addr & ifatoia(rt->rt_ifa)->ia_subnetmask) ==
- ifatoia(rt->rt_ifa)->ia_subnet) {
+ (ip->ip_src.s_addr & ifatoia(rt->rt_ifa)->ia_netmask) ==
+ ifatoia(rt->rt_ifa)->ia_net) {
if (rt->rt_flags & RTF_GATEWAY)
dest = satosin(rt->rt_gateway)->sin_addr.s_addr;
else