summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/in_pcb.c11
-rw-r--r--sys/netinet/in_pcb.h4
-rw-r--r--sys/netinet6/in6_pcb.c8
3 files changed, 13 insertions, 10 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 525172c5b34..042697622f1 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.72 2003/12/21 14:57:19 markus Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.73 2003/12/21 15:12:27 markus Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -562,7 +562,7 @@ in_setpeeraddr(inp, nam)
*
* Must be called at splsoftnet.
*/
-void
+int
in_pcbnotify(table, dst, fport_arg, laddr, lport_arg, errno, notify)
struct inpcbtable *table;
struct sockaddr *dst;
@@ -574,6 +574,7 @@ in_pcbnotify(table, dst, fport_arg, laddr, lport_arg, errno, notify)
struct inpcb *inp, *oinp;
struct in_addr faddr;
u_int16_t fport = fport_arg, lport = lport_arg;
+ int nmatch = 0;
splassert(IPL_SOFTNET);
@@ -586,10 +587,10 @@ in_pcbnotify(table, dst, fport_arg, laddr, lport_arg, errno, notify)
#endif /* INET6 */
if (dst->sa_family != AF_INET)
- return;
+ return (0);
faddr = satosin(dst)->sin_addr;
if (faddr.s_addr == INADDR_ANY)
- return;
+ return (0);
for (inp = CIRCLEQ_FIRST(&table->inpt_queue);
inp != CIRCLEQ_END(&table->inpt_queue);) {
@@ -609,9 +610,11 @@ in_pcbnotify(table, dst, fport_arg, laddr, lport_arg, errno, notify)
}
oinp = inp;
inp = CIRCLEQ_NEXT(inp, inp_queue);
+ nmatch++;
if (notify)
(*notify)(oinp, errno);
}
+ return (nmatch);
}
void
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 27d411b4a5c..705d15c4fe3 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.h,v 1.48 2003/12/08 07:07:36 mcbride Exp $ */
+/* $OpenBSD: in_pcb.h,v 1.49 2003/12/21 15:12:27 markus Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
@@ -256,7 +256,7 @@ void in_pcbinit(struct inpcbtable *, int);
struct inpcb *
in_pcblookup(struct inpcbtable *, void *, u_int, void *,
u_int, int);
-void in_pcbnotify(struct inpcbtable *, struct sockaddr *,
+int in_pcbnotify(struct inpcbtable *, struct sockaddr *,
u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int));
void in_pcbnotifyall(struct inpcbtable *, struct sockaddr *,
int, void (*)(struct inpcb *, int));
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index 34f78a97e96..f3129cd0fb8 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_pcb.c,v 1.39 2003/12/21 14:57:19 markus Exp $ */
+/* $OpenBSD: in6_pcb.c,v 1.40 2003/12/21 15:12:27 markus Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -560,11 +560,11 @@ in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify)
u_int32_t flowinfo;
if ((unsigned)cmd >= PRC_NCMDS || dst->sa_family != AF_INET6)
- return 1;
+ return (0);
sa6_dst = (struct sockaddr_in6 *)dst;
if (IN6_IS_ADDR_UNSPECIFIED(&sa6_dst->sin6_addr))
- return 1;
+ return (0);
if (IN6_IS_ADDR_V4MAPPED(&sa6_dst->sin6_addr))
printf("Huh? Thought in6_pcbnotify() never got "
"called with mapped!\n");
@@ -671,7 +671,7 @@ in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify)
if (notify)
(*notify)(inp, errno);
}
- return 0;
+ return (nmatch);
}
/*