Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Move the NOARP check up a bit so that it works w...



details:   https://anonhg.NetBSD.org/src/rev/a95be66cc71f
branches:  trunk
changeset: 811129:a95be66cc71f
user:      roy <roy%NetBSD.org@localhost>
date:      Tue Oct 13 11:13:37 2015 +0000

description:
Move the NOARP check up a bit so that it works when an la is created
but hasn't been resolved yet.
Fixes PR kern/17611.

diffstat:

 sys/netinet/if_arp.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (43 lines):

diff -r 6f8fe7ebb904 -r a95be66cc71f sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c      Tue Oct 13 10:39:25 2015 +0000
+++ b/sys/netinet/if_arp.c      Tue Oct 13 11:13:37 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_arp.c,v 1.185 2015/10/13 09:33:35 roy Exp $ */
+/*     $NetBSD: if_arp.c,v 1.186 2015/10/13 11:13:37 roy 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.185 2015/10/13 09:33:35 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.186 2015/10/13 11:13:37 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -829,17 +829,19 @@
 #endif
 
 notfound:
-       if (la == NULL) {
 #ifdef IFF_STATICARP /* FreeBSD */
 #define _IFF_NOARP (IFF_NOARP | IFF_STATICARP)
 #else
 #define _IFF_NOARP IFF_NOARP
 #endif
-               if (ifp->if_flags & _IFF_NOARP) {
-                       m_freem(m);
-                       return 0;
-               }
+       if (ifp->if_flags & _IFF_NOARP) {
+               if (la != NULL)
+                       LLE_RUNLOCK(la);
+               m_freem(m);
+               return 0;
+       }
 #undef _IFF_NOARP
+       if (la == NULL) {
                create_lookup = "create";
                IF_AFDATA_WLOCK(ifp);
                la = lla_create(LLTABLE(ifp), LLE_EXCLUSIVE, dst);



Home | Main Index | Thread Index | Old Index