Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 Use LIST_* macros
details: https://anonhg.NetBSD.org/src/rev/d76d184d677f
branches: trunk
changeset: 351861:d76d184d677f
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Thu Mar 02 01:05:02 2017 +0000
description:
Use LIST_* macros
No functional change.
diffstat:
sys/netinet6/in6_pcb.c | 9 ++++-----
sys/netinet6/ip6_output.c | 17 ++++++++---------
2 files changed, 12 insertions(+), 14 deletions(-)
diffs (97 lines):
diff -r 1682cafff4bc -r d76d184d677f sys/netinet6/in6_pcb.c
--- a/sys/netinet6/in6_pcb.c Thu Mar 02 00:43:40 2017 +0000
+++ b/sys/netinet6/in6_pcb.c Thu Mar 02 01:05:02 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_pcb.c,v 1.157 2017/02/13 04:05:58 ozaki-r Exp $ */
+/* $NetBSD: in6_pcb.c,v 1.158 2017/03/02 01:05:02 ozaki-r Exp $ */
/* $KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.157 2017/02/13 04:05:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.158 2017/03/02 01:05:02 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -862,9 +862,8 @@
* XXX controversial - is it really legal for kernel
* to force this?
*/
- for (imm = im6o->im6o_memberships.lh_first;
- imm != NULL; imm = nimm) {
- nimm = imm->i6mm_chain.le_next;
+ LIST_FOREACH_SAFE(imm, &im6o->im6o_memberships,
+ i6mm_chain, nimm) {
if (imm->i6mm_maddr->in6m_ifp == ifp) {
LIST_REMOVE(imm, i6mm_chain);
in6_leavegroup(imm);
diff -r 1682cafff4bc -r d76d184d677f sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c Thu Mar 02 00:43:40 2017 +0000
+++ b/sys/netinet6/ip6_output.c Thu Mar 02 01:05:02 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_output.c,v 1.187 2017/03/01 08:54:12 ozaki-r Exp $ */
+/* $NetBSD: ip6_output.c,v 1.188 2017/03/02 01:05:02 ozaki-r Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.187 2017/03/01 08:54:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.188 2017/03/02 01:05:02 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -2574,12 +2574,12 @@
/*
* See if the membership already exists.
*/
- for (imm = im6o->im6o_memberships.lh_first;
- imm != NULL; imm = imm->i6mm_chain.le_next)
+ LIST_FOREACH(imm, &im6o->im6o_memberships, i6mm_chain) {
if (imm->i6mm_maddr->in6m_ifp == ifp &&
IN6_ARE_ADDR_EQUAL(&imm->i6mm_maddr->in6m_addr,
&ia))
break;
+ }
if (imm != NULL) {
error = EADDRINUSE;
break;
@@ -2660,8 +2660,7 @@
/*
* Find the membership in the membership list.
*/
- for (imm = im6o->im6o_memberships.lh_first;
- imm != NULL; imm = imm->i6mm_chain.le_next) {
+ LIST_FOREACH(imm, &im6o->im6o_memberships, i6mm_chain) {
if ((ifp == NULL || imm->i6mm_maddr->in6m_ifp == ifp) &&
IN6_ARE_ADDR_EQUAL(&imm->i6mm_maddr->in6m_addr,
&mreq.ipv6mr_multiaddr))
@@ -2691,7 +2690,7 @@
if (im6o->im6o_multicast_if_index == 0 &&
im6o->im6o_multicast_hlim == ip6_defmcasthlim &&
im6o->im6o_multicast_loop == IPV6_DEFAULT_MULTICAST_LOOP &&
- im6o->im6o_memberships.lh_first == NULL) {
+ LIST_EMPTY(&im6o->im6o_memberships)) {
free(in6p->in6p_moptions, M_IPMOPTS);
in6p->in6p_moptions = NULL;
}
@@ -2750,12 +2749,12 @@
void
ip6_freemoptions(struct ip6_moptions *im6o)
{
- struct in6_multi_mship *imm;
+ struct in6_multi_mship *imm, *nimm;
if (im6o == NULL)
return;
- while ((imm = im6o->im6o_memberships.lh_first) != NULL) {
+ LIST_FOREACH_SAFE(imm, &im6o->im6o_memberships, i6mm_chain, nimm) {
LIST_REMOVE(imm, i6mm_chain);
in6_leavegroup(imm);
}
Home |
Main Index |
Thread Index |
Old Index