diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-05-09 23:42:20 (GMT) |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-11 06:47:22 (GMT) |
commit | fc038410b4b1643766f8033f4940bcdb1dace633 (patch) | |
tree | 3ee59190ecaa77061a9b64cdc09fcce6b6efc389 /include/net/udp.h | |
parent | a2af421f1819946556c6f467b1efdd0dc84af4d5 (diff) | |
download | linux-fsl-qoriq-fc038410b4b1643766f8033f4940bcdb1dace633.tar.xz |
[UDP]: Fix AF-specific references in AF-agnostic code.
__udp_lib_port_inuse() cannot make direct references to
inet_sk(sk)->rcv_saddr as that is ipv4 specific state and
this code is used by ipv6 too.
Use an operations vector to solve this, and this also paves
the way for ipv6 support for non-wild saddr hashing in UDP.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/udp.h')
-rw-r--r-- | include/net/udp.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index 98755eb..496f89d 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -119,9 +119,16 @@ static inline void udp_lib_close(struct sock *sk, long timeout) } +struct udp_get_port_ops { + int (*saddr_cmp)(const struct sock *sk1, const struct sock *sk2); + int (*saddr_any)(const struct sock *sk); + unsigned int (*hash_port_and_rcv_saddr)(__u16 port, + const struct sock *sk); +}; + /* net/ipv4/udp.c */ extern int udp_get_port(struct sock *sk, unsigned short snum, - int (*saddr_cmp)(const struct sock *, const struct sock *)); + const struct udp_get_port_ops *ops); extern void udp_err(struct sk_buff *, u32); extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, |