Hi,
The return value of in6_pcbnotify() is never used. Make it a void
function.
ok?
bluhm
Index: netinet/in_pcb.h
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/in_pcb.h,v
retrieving revision 1.122
diff -u -p -r1.122 in_pcb.h
--- netinet/in_pcb.h 20 Jan 2022 11:06:57 -0000 1.122
+++ netinet/in_pcb.h 1 Mar 2022 23:39:35 -0000
@@ -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 *);
Index: netinet/tcp_subr.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/tcp_subr.c,v
retrieving revision 1.183
diff -u -p -r1.183 tcp_subr.c
--- netinet/tcp_subr.c 2 Jan 2022 22:36:04 -0000 1.183
+++ netinet/tcp_subr.c 1 Mar 2022 23:44:42 -0000
@@ -687,7 +687,7 @@ tcp6_ctlinput(int cmd, struct sockaddr *
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 *s
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 */
Index: netinet/udp_usrreq.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/udp_usrreq.c,v
retrieving revision 1.271
diff -u -p -r1.271 udp_usrreq.c
--- netinet/udp_usrreq.c 25 Feb 2022 23:51:03 -0000 1.271
+++ netinet/udp_usrreq.c 1 Mar 2022 23:40:14 -0000
@@ -791,10 +791,10 @@ udp6_ctlinput(int cmd, struct sockaddr *
*/
}
- (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);
}
}
Index: netinet6/in6_pcb.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/netinet6/in6_pcb.c,v
retrieving revision 1.112
diff -u -p -r1.112 in6_pcb.c
--- netinet6/in6_pcb.c 11 Feb 2021 10:41:19 -0000 1.112
+++ netinet6/in6_pcb.c 1 Mar 2022 23:40:43 -0000
@@ -364,7 +364,7 @@ in6_setpeeraddr(struct inpcb *inp, struc
* 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 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,
continue;
}
do_notify:
- nmatch++;
if (notify)
(*notify)(inp, errno);
}
- return (nmatch);
}
struct inpcb *
Index: netinet6/raw_ip6.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/netinet6/raw_ip6.c,v
retrieving revision 1.141
diff -u -p -r1.141 raw_ip6.c
--- netinet6/raw_ip6.c 25 Feb 2022 23:51:04 -0000 1.141
+++ netinet6/raw_ip6.c 1 Mar 2022 23:41:04 -0000
@@ -336,7 +336,7 @@ rip6_ctlinput(int cmd, struct sockaddr *
*/
}
- (void) in6_pcbnotify(&rawin6pcbtable, sa6, 0,
+ in6_pcbnotify(&rawin6pcbtable, sa6, 0,
sa6_src, 0, rdomain, cmd, cmdarg, notify);
}