Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Define IFNET_EMPTY() and replace !IFNET_FIRST() with it
details: https://anonhg.NetBSD.org/src/rev/12bab0bfc793
branches: trunk
changeset: 797849:12bab0bfc793
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Thu Jul 31 02:21:51 2014 +0000
description:
Define IFNET_EMPTY() and replace !IFNET_FIRST() with it
No functional change.
diffstat:
sys/net/if.h | 3 ++-
sys/netinet/raw_ip.c | 8 ++++----
sys/netinet6/raw_ip6.c | 8 ++++----
3 files changed, 10 insertions(+), 9 deletions(-)
diffs (89 lines):
diff -r 61bdd3e65449 -r 12bab0bfc793 sys/net/if.h
--- a/sys/net/if.h Thu Jul 31 01:04:00 2014 +0000
+++ b/sys/net/if.h Thu Jul 31 02:21:51 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.h,v 1.172 2014/07/16 03:17:26 ozaki-r Exp $ */
+/* $NetBSD: if.h,v 1.173 2014/07/31 02:21:51 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -981,6 +981,7 @@
#ifdef _KERNEL
#define IFNET_FIRST() TAILQ_FIRST(&ifnet_list)
+#define IFNET_EMPTY() TAILQ_EMPTY(&ifnet_list)
#define IFNET_NEXT(__ifp) TAILQ_NEXT((__ifp), if_list)
#define IFNET_FOREACH(__ifp) TAILQ_FOREACH(__ifp, &ifnet_list, if_list)
#define IFADDR_FIRST(__ifp) TAILQ_FIRST(&(__ifp)->if_addrlist)
diff -r 61bdd3e65449 -r 12bab0bfc793 sys/netinet/raw_ip.c
--- a/sys/netinet/raw_ip.c Thu Jul 31 01:04:00 2014 +0000
+++ b/sys/netinet/raw_ip.c Thu Jul 31 02:21:51 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: raw_ip.c,v 1.137 2014/07/30 10:04:26 rtr Exp $ */
+/* $NetBSD: raw_ip.c,v 1.138 2014/07/31 02:21:51 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.137 2014/07/30 10:04:26 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.138 2014/07/31 02:21:51 ozaki-r Exp $");
#include "opt_inet.h"
#include "opt_compat_netbsd.h"
@@ -487,7 +487,7 @@
if (nam->m_len != sizeof(*addr))
return (EINVAL);
- if (!IFNET_FIRST())
+ if (IFNET_EMPTY())
return (EADDRNOTAVAIL);
if (addr->sin_family != AF_INET)
return (EAFNOSUPPORT);
@@ -575,7 +575,7 @@
error = EINVAL;
goto release;
}
- if (!IFNET_FIRST()) {
+ if (IFNET_EMPTY()) {
error = EADDRNOTAVAIL;
goto release;
}
diff -r 61bdd3e65449 -r 12bab0bfc793 sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c Thu Jul 31 01:04:00 2014 +0000
+++ b/sys/netinet6/raw_ip6.c Thu Jul 31 02:21:51 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: raw_ip6.c,v 1.130 2014/07/30 10:04:26 rtr Exp $ */
+/* $NetBSD: raw_ip6.c,v 1.131 2014/07/31 02:21:51 ozaki-r 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.130 2014/07/30 10:04:26 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.131 2014/07/31 02:21:51 ozaki-r Exp $");
#include "opt_ipsec.h"
@@ -667,7 +667,7 @@
addr = mtod(nam, struct sockaddr_in6 *);
if (nam->m_len != sizeof(*addr))
return EINVAL;
- if (!IFNET_FIRST() || addr->sin6_family != AF_INET6)
+ if (IFNET_EMPTY() || addr->sin6_family != AF_INET6)
return EADDRNOTAVAIL;
if ((error = sa6_embedscope(addr, ip6_use_defzone)) != 0)
@@ -716,7 +716,7 @@
if (nam->m_len != sizeof(*addr))
return EINVAL;
- if (!IFNET_FIRST())
+ if (IFNET_EMPTY())
return EADDRNOTAVAIL;
if (addr->sin6_family != AF_INET6)
return EAFNOSUPPORT;
Home |
Main Index |
Thread Index |
Old Index