Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Fix panic on receiving an ARP request



details:   https://anonhg.NetBSD.org/src/rev/9c34026e9140
branches:  trunk
changeset: 814907:9c34026e9140
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Apr 18 02:24:42 2016 +0000

description:
Fix panic on receiving an ARP request

The panic happened if an ARP request has a spa (i.e., IP address) whose
ARP entry already exists in the table as a static ARP entry.

diffstat:

 sys/netinet/if_arp.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r dc25bb2cdb13 -r 9c34026e9140 sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c      Mon Apr 18 01:28:06 2016 +0000
+++ b/sys/netinet/if_arp.c      Mon Apr 18 02:24:42 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_arp.c,v 1.206 2016/04/13 00:47:01 ozaki-r Exp $     */
+/*     $NetBSD: if_arp.c,v 1.207 2016/04/18 02:24:42 ozaki-r Exp $     */
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.206 2016/04/13 00:47:01 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.207 2016/04/18 02:24:42 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1223,10 +1223,11 @@
        KASSERT(sizeof(la->ll_addr) >= ifp->if_addrlen);
        (void)memcpy(&la->ll_addr, ar_sha(ah), ifp->if_addrlen);
        la->la_flags |= LLE_VALID;
-       la->la_expire = time_uptime + arpt_keep;
+       if ((la->la_flags & LLE_STATIC) == 0) {
+               la->la_expire = time_uptime + arpt_keep;
+               arp_settimer(la, arpt_keep);
+       }
        la->la_asked = 0;
-       KASSERT((la->la_flags & LLE_STATIC) == 0);
-       arp_settimer(la, arpt_keep);
        /* rt->rt_flags &= ~RTF_REJECT; */
 
        if (la->la_hold != NULL) {



Home | Main Index | Thread Index | Old Index