aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-05-09 19:42:20 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-05-11 02:47:22 -0400
commitfc038410b4b1643766f8033f4940bcdb1dace633 (patch)
tree3ee59190ecaa77061a9b64cdc09fcce6b6efc389 /include
parenta2af421f1819946556c6f467b1efdd0dc84af4d5 (diff)
[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')
-rw-r--r--include/net/udp.h9
-rw-r--r--include/net/udplite.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index 98755ebaf163..496f89d45c8b 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)
119} 119}
120 120
121 121
122struct udp_get_port_ops {
123 int (*saddr_cmp)(const struct sock *sk1, const struct sock *sk2);
124 int (*saddr_any)(const struct sock *sk);
125 unsigned int (*hash_port_and_rcv_saddr)(__u16 port,
126 const struct sock *sk);
127};
128
122/* net/ipv4/udp.c */ 129/* net/ipv4/udp.c */
123extern int udp_get_port(struct sock *sk, unsigned short snum, 130extern int udp_get_port(struct sock *sk, unsigned short snum,
124 int (*saddr_cmp)(const struct sock *, const struct sock *)); 131 const struct udp_get_port_ops *ops);
125extern void udp_err(struct sk_buff *, u32); 132extern void udp_err(struct sk_buff *, u32);
126 133
127extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, 134extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
diff --git a/include/net/udplite.h b/include/net/udplite.h
index 635b0eafca95..50b4b424d1ca 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -120,5 +120,5 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
120 120
121extern void udplite4_register(void); 121extern void udplite4_register(void);
122extern int udplite_get_port(struct sock *sk, unsigned short snum, 122extern int udplite_get_port(struct sock *sk, unsigned short snum,
123 int (*scmp)(const struct sock *, const struct sock *)); 123 const struct udp_get_port_ops *ops);
124#endif /* _UDPLITE_H */ 124#endif /* _UDPLITE_H */