summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/in_pcb.c24
-rw-r--r--sys/netinet/in_pcb.h3
-rw-r--r--sys/netinet6/in6_pcb.c4
3 files changed, 13 insertions, 18 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index c1e1c4ea0b5..9656d5448a1 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.24 1998/05/18 21:10:27 provos Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.25 1999/01/07 05:44:31 deraadt Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -84,8 +84,6 @@ int ipport_hilastauto = IPPORT_HILASTAUTO; /* 44999 */
#define INPCBHASH(table, faddr, fport, laddr, lport) \
&(table)->inpt_hashtbl[(ntohl((faddr)->s_addr) + ntohs((fport)) + ntohs((lport))) & (table->inpt_hash)]
-static int baddynamic __P((u_int16_t, u_int16_t));
-
void
in_pcbinit(table, hashsize)
struct inpcbtable *table;
@@ -102,8 +100,8 @@ struct baddynamicports baddynamicports;
/*
* Check if the specified port is invalid for dynamic allocation.
*/
-static int
-baddynamic(port, proto)
+int
+in_baddynamic(port, proto)
u_int16_t port;
u_int16_t proto;
{
@@ -112,12 +110,12 @@ baddynamic(port, proto)
return(0);
switch (proto) {
- case IPPROTO_TCP:
- return (DP_ISSET(baddynamicports.tcp, port));
- case IPPROTO_UDP:
- return (DP_ISSET(baddynamicports.udp, port));
- default:
- return (0);
+ case IPPROTO_TCP:
+ return (DP_ISSET(baddynamicports.tcp, port));
+ case IPPROTO_UDP:
+ return (DP_ISSET(baddynamicports.udp, port));
+ default:
+ return (0);
}
}
@@ -270,7 +268,7 @@ portloop:
if (*lastport > first || *lastport < last)
*lastport = first;
lport = htons(*lastport);
- } while (baddynamic(*lastport, so->so_proto->pr_protocol) ||
+ } while (in_baddynamic(*lastport, so->so_proto->pr_protocol) ||
in_pcblookup(table, zeroin_addr, 0,
inp->inp_laddr, lport, wild));
} else {
@@ -297,7 +295,7 @@ portloop:
if (*lastport < first || *lastport > last)
*lastport = first;
lport = htons(*lastport);
- } while (baddynamic(*lastport, so->so_proto->pr_protocol) ||
+ } while (in_baddynamic(*lastport, so->so_proto->pr_protocol) ||
in_pcblookup(table, zeroin_addr, 0,
inp->inp_laddr, lport, wild));
}
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index c0645b46070..9cb91e53369 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.h,v 1.10 1998/05/18 21:10:28 provos Exp $ */
+/* $OpenBSD: in_pcb.h,v 1.11 1999/01/07 05:44:32 deraadt Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
@@ -130,4 +130,5 @@ void in_pcbrehash __P((struct inpcb *));
void in_rtchange __P((struct inpcb *, int));
void in_setpeeraddr __P((struct inpcb *, struct mbuf *));
void in_setsockaddr __P((struct inpcb *, struct mbuf *));
+int in_baddynamic __P((u_int16_t, u_int16_t));
#endif
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index ec2a27b665e..a343f6a9eca 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -131,10 +131,6 @@ extern int ipport_hifirstauto;
extern int ipport_hilastauto;
#endif /* __OpenBSD__ */
-#if __OpenBSD__
-int in_baddynamic __P((u_int16_t, u_int16_t));
-#endif /* __OpenBSD__ */
-
/*
* Keep separate inet6ctlerrmap, because I may remap some of these.
* I also put it here, because, quite frankly, it belongs here, not in