From: mpi Date: Mon, 19 Oct 2015 12:02:11 +0000 (+0000) Subject: Sync rtisvalid(9) check for local route entries with r1.257 of X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3690a7eb899eea6b0cc0b07625a262a8946a4872;p=openbsd Sync rtisvalid(9) check for local route entries with r1.257 of net/ip_input.c --- 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); } /*