diff options
author | 2015-10-19 12:02:11 +0000 | |
---|---|---|
committer | 2015-10-19 12:02:11 +0000 | |
commit | 3690a7eb899eea6b0cc0b07625a262a8946a4872 (patch) | |
tree | 08582595598fbc2bb82ee5a363134313bb31760b | |
parent | Remove superfluous NULL checks. (diff) | |
download | wireguard-openbsd-3690a7eb899eea6b0cc0b07625a262a8946a4872.tar.xz wireguard-openbsd-3690a7eb899eea6b0cc0b07625a262a8946a4872.zip |
Sync rtisvalid(9) check for local route entries with r1.257 of
net/ip_input.c
-rw-r--r-- | sys/netinet/ip_icmp.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index c44eb97d048..8392adff7e9 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.141 2015/09/23 08:49:46 mpi Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.142 2015/10/19 12:02:11 mpi Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -731,11 +731,10 @@ icmp_reflect(struct mbuf *m, struct mbuf **op, struct in_ifaddr *ia) sin.sin_addr = ip->ip_dst; rt = rtalloc(sintosa(&sin), 0, rtableid); - if (rt != NULL) { - if (rt->rt_flags & (RTF_LOCAL|RTF_BROADCAST)) - ia = ifatoia(rt->rt_ifa); - rtfree(rt); - } + if (rtisvalid(rt) && + ISSET(rt->rt_flags, RTF_LOCAL|RTF_BROADCAST)) + ia = ifatoia(rt->rt_ifa); + rtfree(rt); } /* |