Module Name:    src
Committed By:   ozaki-r
Date:           Mon Feb 13 04:06:39 UTC 2017

Modified Files:
        src/sys/netinet: ip_output.c

Log Message:
Use IFQ_LOCK instead of splnet for if_snd


To generate a diff of this commit:
cvs rdiff -u -r1.269 -r1.270 src/sys/netinet/ip_output.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/ip_output.c
diff -u src/sys/netinet/ip_output.c:1.269 src/sys/netinet/ip_output.c:1.270
--- src/sys/netinet/ip_output.c:1.269	Mon Jan 16 15:14:16 2017
+++ src/sys/netinet/ip_output.c	Mon Feb 13 04:06:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_output.c,v 1.269 2017/01/16 15:14:16 christos Exp $	*/
+/*	$NetBSD: ip_output.c,v 1.270 2017/02/13 04:06:39 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.269 2017/01/16 15:14:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.270 2017/02/13 04:06:39 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -794,7 +794,6 @@ ip_fragment(struct mbuf *m, struct ifnet
 	struct mbuf **mnext;
 	int sw_csum = m->m_pkthdr.csum_flags;
 	int fragments = 0;
-	int s;
 	int error = 0;
 
 	ip = mtod(m, struct ip *);
@@ -901,14 +900,14 @@ sendorfree:
 	 * any of them.
 	 */
 	if (ifp != NULL) {
-		s = splnet();
+		IFQ_LOCK(&ifp->if_snd);
 		if (ifp->if_snd.ifq_maxlen - ifp->if_snd.ifq_len < fragments &&
 		    error == 0) {
 			error = ENOBUFS;
 			IP_STATINC(IP_STAT_ODROPPED);
 			IFQ_INC_DROPS(&ifp->if_snd);
 		}
-		splx(s);
+		IFQ_UNLOCK(&ifp->if_snd);
 	}
 	if (error) {
 		for (m = m0; m; m = m0) {

Reply via email to