summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2019-11-07 11:23:25 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2019-11-07 11:23:25 +0000
commit634744860174d0336dc8207648750d3c6d600d7a (patch)
tree7c667bb05741f2b5294c338c7becf7b66e17c4e8
parent950f170b75541a4f79eb8b010c30001f6046757e (diff)
Avoid NULL dereference in arpinvalidate() and nd6_invalidate() by
making RTM_INVALIDATE code path perform same check as RTM_DELETE does. ok mpi@
-rw-r--r--sys/netinet/if_ether.c4
-rw-r--r--sys/netinet6/nd6.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index e23c94ab4c1..f950dbebc33 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.c,v 1.241 2019/10/16 10:22:01 mpi Exp $ */
+/* $OpenBSD: if_ether.c,v 1.242 2019/11/07 11:23:23 krw Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
@@ -207,6 +207,8 @@ arp_rtrequest(struct ifnet *ifp, int req, struct rtentry *rt)
break;
case RTM_INVALIDATE:
+ if (la == NULL)
+ break;
if (!ISSET(rt->rt_flags, RTF_LOCAL))
arpinvalidate(rt);
break;
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 5ca7c428daf..db2fda85e74 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.227 2019/06/13 08:15:26 claudio Exp $ */
+/* $OpenBSD: nd6.c,v 1.228 2019/11/07 11:23:24 krw Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -1004,6 +1004,8 @@ nd6_rtrequest(struct ifnet *ifp, int req, struct rtentry *rt)
break;
case RTM_INVALIDATE:
+ if (ln == NULL)
+ break;
if (!ISSET(rt->rt_flags, RTF_LOCAL))
nd6_invalidate(rt);
break;