Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Use IFNET_FIRST() rather than open coding ifnet access.
details: https://anonhg.NetBSD.org/src/rev/fe7c1f3e0d2a
branches: trunk
changeset: 329286:fe7c1f3e0d2a
user: rmind <rmind%NetBSD.org@localhost>
date: Sun May 18 00:10:11 2014 +0000
description:
Use IFNET_FIRST() rather than open coding ifnet access.
diffstat:
sys/netinet/raw_ip.c | 8 ++++----
sys/netinet6/icmp6.c | 6 +++---
sys/netinet6/raw_ip6.c | 8 ++++----
3 files changed, 11 insertions(+), 11 deletions(-)
diffs (99 lines):
diff -r a8782585a240 -r fe7c1f3e0d2a sys/netinet/raw_ip.c
--- a/sys/netinet/raw_ip.c Sat May 17 23:55:24 2014 +0000
+++ b/sys/netinet/raw_ip.c Sun May 18 00:10:11 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: raw_ip.c,v 1.118 2014/02/25 18:30:12 pooka Exp $ */
+/* $NetBSD: raw_ip.c,v 1.119 2014/05/18 00:10:11 rmind Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.118 2014/02/25 18:30:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.119 2014/05/18 00:10:11 rmind Exp $");
#include "opt_inet.h"
#include "opt_compat_netbsd.h"
@@ -474,7 +474,7 @@
if (nam->m_len != sizeof(*addr))
return (EINVAL);
- if (TAILQ_FIRST(&ifnet) == 0)
+ if (!IFNET_FIRST())
return (EADDRNOTAVAIL);
if (addr->sin_family != AF_INET)
return (EAFNOSUPPORT);
@@ -492,7 +492,7 @@
if (nam->m_len != sizeof(*addr))
return (EINVAL);
- if (TAILQ_FIRST(&ifnet) == 0)
+ if (!IFNET_FIRST())
return (EADDRNOTAVAIL);
if (addr->sin_family != AF_INET)
return (EAFNOSUPPORT);
diff -r a8782585a240 -r fe7c1f3e0d2a sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c Sat May 17 23:55:24 2014 +0000
+++ b/sys/netinet6/icmp6.c Sun May 18 00:10:11 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: icmp6.c,v 1.165 2014/02/25 18:30:12 pooka Exp $ */
+/* $NetBSD: icmp6.c,v 1.166 2014/05/18 00:10:11 rmind Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.165 2014/02/25 18:30:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.166 2014/05/18 00:10:11 rmind Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -1717,7 +1717,7 @@
struct icmp6_nodeinfo *nni6, struct ifnet *ifp0,
int resid)
{
- struct ifnet *ifp = ifp0 ? ifp0 : TAILQ_FIRST(&ifnet);
+ struct ifnet *ifp = ifp0 ? ifp0 : IFNET_FIRST();
struct in6_ifaddr *ifa6;
struct ifaddr *ifa;
struct ifnet *ifp_dep = NULL;
diff -r a8782585a240 -r fe7c1f3e0d2a sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c Sat May 17 23:55:24 2014 +0000
+++ b/sys/netinet6/raw_ip6.c Sun May 18 00:10:11 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: raw_ip6.c,v 1.113 2014/02/25 18:30:12 pooka Exp $ */
+/* $NetBSD: raw_ip6.c,v 1.114 2014/05/18 00:10:11 rmind Exp $ */
/* $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.113 2014/02/25 18:30:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.114 2014/05/18 00:10:11 rmind Exp $");
#include "opt_ipsec.h"
@@ -677,7 +677,7 @@
error = EINVAL;
break;
}
- if (TAILQ_EMPTY(&ifnet) || addr->sin6_family != AF_INET6) {
+ if (!IFNET_FIRST() || addr->sin6_family != AF_INET6) {
error = EADDRNOTAVAIL;
break;
}
@@ -718,7 +718,7 @@
error = EINVAL;
break;
}
- if (TAILQ_EMPTY(&ifnet)) {
+ if (!IFNET_FIRST()) {
error = EADDRNOTAVAIL;
break;
}
Home |
Main Index |
Thread Index |
Old Index