diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-10-19 11:59:27 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-10-19 11:59:27 +0000 |
commit | f57f188869dbf5962676af66ec01b85b7b191e6a (patch) | |
tree | 4a673709f90e9e612e7e6e1c80820bb7928f8dd7 | |
parent | b36a1ade28c969cf9519ddd90f447dfac70fec88 (diff) |
Remove superfluous NULL checks.
ifa are refcounted to ensure that rt_ifa is always valid.
-rw-r--r-- | sys/netinet/ip_input.c | 5 | ||||
-rw-r--r-- | sys/netinet6/frag6.c | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 2d8cc521d8d..ec34355e90a 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.257 2015/10/13 10:29:16 mpi Exp $ */ +/* $OpenBSD: ip_input.c,v 1.258 2015/10/19 11:59:26 mpi Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -1457,8 +1457,7 @@ ip_forward(struct mbuf *m, struct ifnet *ifp, int srcrt) satosin(rt_key(rt))->sin_addr.s_addr != 0 && ipsendredirects && !srcrt && !arpproxy(satosin(rt_key(rt))->sin_addr, m->m_pkthdr.ph_rtableid)) { - if (rt->rt_ifa && - (ip->ip_src.s_addr & ifatoia(rt->rt_ifa)->ia_netmask) == + if ((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; diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index 890f7e4dcdc..3e27729e1d6 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frag6.c,v 1.63 2015/09/10 16:39:39 mpi Exp $ */ +/* $OpenBSD: frag6.c,v 1.64 2015/10/19 11:59:26 mpi Exp $ */ /* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */ /* @@ -183,10 +183,8 @@ frag6_input(struct mbuf **mp, int *offp, int proto) rt = rtalloc_mpath(sin6tosa(&dst), &ip6->ip6_src.s6_addr32[0], m->m_pkthdr.ph_rtableid); - if (rt != NULL) { - if (rt->rt_ifa != NULL) - dstifp = ifatoia6(rt->rt_ifa)->ia_ifp; + dstifp = ifatoia6(rt->rt_ifa)->ia_ifp; rtfree(rt); rt = NULL; } |