diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-09-28 22:25:29 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-09-28 22:25:29 +0000 |
commit | 0ae8dceaebe3659ee0c3352c08125f403e77ebca (patch) | |
tree | 5085c389f09da78182b899d19fe1068b619a69dd /include/net/udp.h | |
parent | 273767781288c35c9d679e908672b9996cda4c34 (diff) |
Merge with 2.3.10.
Diffstat (limited to 'include/net/udp.h')
-rw-r--r-- | include/net/udp.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index 30a59b3f0..dcc2fd093 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -23,6 +23,7 @@ #define _UDP_H #include <linux/udp.h> +#include <net/sock.h> #define UDP_HTABLE_SIZE 128 @@ -32,7 +33,18 @@ */ extern struct sock *udp_hash[UDP_HTABLE_SIZE]; -extern unsigned short udp_good_socknum(void); +extern int udp_port_rover; + +static inline int udp_lport_inuse(u16 num) +{ + struct sock *sk = udp_hash[num & (UDP_HTABLE_SIZE - 1)]; + + for(; sk != NULL; sk = sk->next) { + if(sk->num == num) + return 1; + } + return 0; +} /* Note: this must match 'valbool' in sock_setsockopt */ #define UDP_CSUM_NOXMIT 1 |