Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Call ifp->if_output in revarprequest with KERNEL...



details:   https://anonhg.NetBSD.org/src/rev/e136deaf7066
branches:  trunk
changeset: 796427:e136deaf7066
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue Jun 03 01:24:32 2014 +0000

description:
Call ifp->if_output in revarprequest with KERNEL_LOCK held

Otherwise, it hits KASSERT(KERNEL_LOCKED_P()) in ether_output
when nfs_boot fails and tries RARP.

diffstat:

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

diffs (30 lines):

diff -r 0ee46b5e2047 -r e136deaf7066 sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c      Mon Jun 02 22:57:50 2014 +0000
+++ b/sys/netinet/if_arp.c      Tue Jun 03 01:24:32 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_arp.c,v 1.157 2014/05/18 14:46:16 rmind Exp $       */
+/*     $NetBSD: if_arp.c,v 1.158 2014/06/03 01:24:32 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.157 2014/05/18 14:46:16 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.158 2014/06/03 01:24:32 ozaki-r Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -1481,8 +1481,10 @@
        sa.sa_family = AF_ARP;
        sa.sa_len = 2;
        m->m_flags |= M_BCAST;
+
+       KERNEL_LOCK(1, NULL);
        (*ifp->if_output)(ifp, m, &sa, NULL);
-
+       KERNEL_UNLOCK_ONE(NULL);
 }
 
 /*



Home | Main Index | Thread Index | Old Index