Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Refactor like in_pcb.c:r1.187 and in6_pcb.c:r1.168.



details:   https://anonhg.NetBSD.org/src/rev/c733a5281420
branches:  trunk
changeset: 366767:c733a5281420
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Mon Jun 13 09:23:23 2022 +0000

description:
Refactor like in_pcb.c:r1.187 and in6_pcb.c:r1.168.

Use TAILQ_FOREACH instead of TAILQ_FOREACH_SAFE about inpt_queue.
rip_pcbnotify() doesn't use "ninph" pointer and doesn't remove elements.

diffstat:

 sys/netinet/raw_ip.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r 3ec1f2fd053b -r c733a5281420 sys/netinet/raw_ip.c
--- a/sys/netinet/raw_ip.c      Mon Jun 13 07:59:15 2022 +0000
+++ b/sys/netinet/raw_ip.c      Mon Jun 13 09:23:23 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: raw_ip.c,v 1.180 2020/09/08 14:12:57 christos Exp $    */
+/*     $NetBSD: raw_ip.c,v 1.181 2022/06/13 09:23:23 knakahara 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.180 2020/09/08 14:12:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.181 2022/06/13 09:23:23 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -241,11 +241,11 @@
     struct in_addr faddr, struct in_addr laddr, int proto, int errno,
     void (*notify)(struct inpcb *, int))
 {
-       struct inpcb_hdr *inph, *ninph;
+       struct inpcb_hdr *inph;
        int nmatch;
 
        nmatch = 0;
-       TAILQ_FOREACH_SAFE(inph, &table->inpt_queue, inph_queue, ninph) {
+       TAILQ_FOREACH(inph, &table->inpt_queue, inph_queue) {
                struct inpcb *inp = (struct inpcb *)inph;
                if (inp->inp_af != AF_INET)
                        continue;



Home | Main Index | Thread Index | Old Index