Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Apply m_get_rcvif_psref (kill m_get_rcvif_NOMPSAFE)
details: https://anonhg.NetBSD.org/src/rev/25e663f905d0
branches: trunk
changeset: 346293:25e663f905d0
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Wed Jul 06 00:30:55 2016 +0000
description:
Apply m_get_rcvif_psref (kill m_get_rcvif_NOMPSAFE)
diffstat:
sys/netinet/in_gif.c | 16 +++++++++++-----
sys/netinet6/in6_gif.c | 16 +++++++++++-----
2 files changed, 22 insertions(+), 10 deletions(-)
diffs (86 lines):
diff -r 0f3106b86664 -r 25e663f905d0 sys/netinet/in_gif.c
--- a/sys/netinet/in_gif.c Tue Jul 05 21:13:12 2016 +0000
+++ b/sys/netinet/in_gif.c Wed Jul 06 00:30:55 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_gif.c,v 1.78 2016/07/04 04:22:47 knakahara Exp $ */
+/* $NetBSD: in_gif.c,v 1.79 2016/07/06 00:30:55 ozaki-r Exp $ */
/* $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.78 2016/07/04 04:22:47 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.79 2016/07/06 00:30:55 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -349,15 +349,21 @@
{
struct ip ip;
struct gif_softc *sc;
- struct ifnet *ifp;
+ struct ifnet *ifp = NULL;
+ int r;
+ struct psref psref;
/* sanity check done in caller */
sc = arg;
m_copydata(m, 0, sizeof(ip), &ip);
- ifp = ((m->m_flags & M_PKTHDR) != 0) ? m_get_rcvif_NOMPSAFE(m) : NULL;
+ if ((m->m_flags & M_PKTHDR) != 0)
+ ifp = m_get_rcvif_psref(m, &psref);
- return gif_validate4(&ip, sc, ifp);
+ r = gif_validate4(&ip, sc, ifp);
+
+ m_put_rcvif_psref(ifp, &psref);
+ return r;
}
#endif
diff -r 0f3106b86664 -r 25e663f905d0 sys/netinet6/in6_gif.c
--- a/sys/netinet6/in6_gif.c Tue Jul 05 21:13:12 2016 +0000
+++ b/sys/netinet6/in6_gif.c Wed Jul 06 00:30:55 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_gif.c,v 1.77 2016/07/04 04:22:47 knakahara Exp $ */
+/* $NetBSD: in6_gif.c,v 1.78 2016/07/06 00:30:55 ozaki-r Exp $ */
/* $KAME: in6_gif.c,v 1.62 2001/07/29 04:27:25 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.77 2016/07/04 04:22:47 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.78 2016/07/06 00:30:55 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -349,15 +349,21 @@
{
struct ip6_hdr ip6;
struct gif_softc *sc;
- struct ifnet *ifp;
+ struct ifnet *ifp = NULL;
+ int r;
+ struct psref psref;
/* sanity check done in caller */
sc = arg;
m_copydata(m, 0, sizeof(ip6), (void *)&ip6);
- ifp = ((m->m_flags & M_PKTHDR) != 0) ? m_get_rcvif_NOMPSAFE(m) : NULL;
+ if ((m->m_flags & M_PKTHDR) != 0)
+ ifp = m_get_rcvif_psref(m, &psref);
- return gif_validate6(&ip6, sc, ifp);
+ r = gif_validate6(&ip6, sc, ifp);
+
+ m_put_rcvif_psref(ifp, &psref);
+ return r;
}
#endif
Home |
Main Index |
Thread Index |
Old Index