From: bluhm Date: Wed, 2 Mar 2022 12:53:15 +0000 (+0000) Subject: The return value of in6_pcbnotify() is never used. Make it a void X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1941b8b5165b11f0e40d95d0fcad2cfad0df336a;p=openbsd The return value of in6_pcbnotify() is never used. Make it a void function. OK gnezdo@ mvs@ florian@ sashan@ --- diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 28dddfa8e20..d6357f1f069 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.h,v 1.122 2022/01/20 11:06:57 bluhm Exp $ */ +/* $OpenBSD: in_pcb.h,v 1.123 2022/03/02 12:53:15 bluhm Exp $ */ /* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */ /* @@ -310,7 +310,7 @@ struct rtentry * in_pcbrtentry(struct inpcb *); /* INET6 stuff */ -int in6_pcbnotify(struct inpcbtable *, struct sockaddr_in6 *, +void in6_pcbnotify(struct inpcbtable *, struct sockaddr_in6 *, u_int, const struct sockaddr_in6 *, u_int, u_int, int, void *, void (*)(struct inpcb *, int)); int in6_selecthlim(struct inpcb *); diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 2eb5ea5cf2c..bd0671b319a 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.183 2022/01/02 22:36:04 jsg Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.184 2022/03/02 12:53:15 bluhm Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -687,7 +687,7 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *d) syn_cache_unreach((struct sockaddr *)sa6_src, sa, &th, rdomain); } else { - (void) in6_pcbnotify(&tcbtable, sa6, 0, + in6_pcbnotify(&tcbtable, sa6, 0, sa6_src, 0, rdomain, cmd, NULL, notify); } } @@ -822,7 +822,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *v) void tcp6_mtudisc_callback(struct sockaddr_in6 *sin6, u_int rdomain) { - (void) in6_pcbnotify(&tcbtable, sin6, 0, + in6_pcbnotify(&tcbtable, sin6, 0, &sa6_any, 0, rdomain, PRC_MSGSIZE, NULL, tcp_mtudisc); } #endif /* INET6 */ diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index e5069f1d395..e32d9c21454 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.271 2022/02/25 23:51:03 guenther Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.272 2022/03/02 12:53:15 bluhm Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -791,10 +791,10 @@ udp6_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *d) */ } - (void) in6_pcbnotify(&udbtable, &sa6, uh.uh_dport, + in6_pcbnotify(&udbtable, &sa6, uh.uh_dport, &sa6_src, uh.uh_sport, rdomain, cmd, cmdarg, notify); } else { - (void) in6_pcbnotify(&udbtable, &sa6, 0, + in6_pcbnotify(&udbtable, &sa6, 0, &sa6_any, 0, rdomain, cmd, cmdarg, notify); } } diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 08159ffb68d..526ae8a2cf5 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_pcb.c,v 1.112 2021/02/11 10:41:19 patrick Exp $ */ +/* $OpenBSD: in6_pcb.c,v 1.113 2022/03/02 12:53:15 bluhm Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -364,7 +364,7 @@ in6_setpeeraddr(struct inpcb *inp, struct mbuf *nam) * Also perform input-side security policy check * once PCB to be notified has been located. */ -int +void in6_pcbnotify(struct inpcbtable *table, struct sockaddr_in6 *dst, uint fport_arg, const struct sockaddr_in6 *src, uint lport_arg, u_int rtable, int cmd, void *cmdarg, void (*notify)(struct inpcb *, int)) @@ -372,23 +372,23 @@ in6_pcbnotify(struct inpcbtable *table, struct sockaddr_in6 *dst, struct inpcb *inp, *ninp; u_short fport = fport_arg, lport = lport_arg; struct sockaddr_in6 sa6_src; - int errno, nmatch = 0; + int errno; u_int32_t flowinfo; u_int rdomain; NET_ASSERT_LOCKED(); if ((unsigned)cmd >= PRC_NCMDS) - return (0); + return; if (IN6_IS_ADDR_UNSPECIFIED(&dst->sin6_addr)) - return (0); + return; if (IN6_IS_ADDR_V4MAPPED(&dst->sin6_addr)) { #ifdef DIAGNOSTIC printf("%s: Huh? Thought we never got " "called with mapped!\n", __func__); #endif - return (0); + return; } /* @@ -488,11 +488,9 @@ in6_pcbnotify(struct inpcbtable *table, struct sockaddr_in6 *dst, continue; } do_notify: - nmatch++; if (notify) (*notify)(inp, errno); } - return (nmatch); } struct inpcb * diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 80ea8ef7b6f..7ff6d64caac 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip6.c,v 1.141 2022/02/25 23:51:04 guenther Exp $ */ +/* $OpenBSD: raw_ip6.c,v 1.142 2022/03/02 12:53:15 bluhm Exp $ */ /* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */ /* @@ -336,7 +336,7 @@ rip6_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *d) */ } - (void) in6_pcbnotify(&rawin6pcbtable, sa6, 0, + in6_pcbnotify(&rawin6pcbtable, sa6, 0, sa6_src, 0, rdomain, cmd, cmdarg, notify); }