aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-08-26 23:10:15 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 18:18:23 -0400
commite3b4eadbea77ecb3c3a74d1bc81b392f454c7f2e (patch)
treea94577b99959414edd2b76d5005b5d361badc5a6
parentbed53ea7fef37820b7c92ad74feff1b817c6aae3 (diff)
[UDP]: saddr_cmp function should take const socket pointers
This also kills a warning while building ipv6: net/ipv6/udp.c: In function ‘udp_v6_get_port’: net/ipv6/udp.c:66: warning: passing argument 3 of ‘udp_get_port’ from incompatible pointer type Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/udp.h2
-rw-r--r--net/ipv4/udp.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index c490a0f662ac..db0c05f67546 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -48,7 +48,7 @@ extern struct proto udp_prot;
48struct sk_buff; 48struct sk_buff;
49 49
50extern int udp_get_port(struct sock *sk, unsigned short snum, 50extern int udp_get_port(struct sock *sk, unsigned short snum,
51 int (*saddr_cmp)(struct sock *, struct sock *)); 51 int (*saddr_cmp)(const struct sock *, const struct sock *));
52extern void udp_err(struct sk_buff *, u32); 52extern void udp_err(struct sk_buff *, u32);
53 53
54extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, 54extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index aa1823050b00..77e265d7bb8f 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -139,7 +139,7 @@ static inline int udp_lport_inuse(u16 num)
139 * @saddr_comp: AF-dependent comparison of bound local IP addresses 139 * @saddr_comp: AF-dependent comparison of bound local IP addresses
140 */ 140 */
141int udp_get_port(struct sock *sk, unsigned short snum, 141int udp_get_port(struct sock *sk, unsigned short snum,
142 int (*saddr_cmp)(struct sock *sk1, struct sock *sk2)) 142 int (*saddr_cmp)(const struct sock *sk1, const struct sock *sk2))
143{ 143{
144 struct hlist_node *node; 144 struct hlist_node *node;
145 struct hlist_head *head; 145 struct hlist_head *head;
@@ -210,7 +210,7 @@ fail:
210 return error; 210 return error;
211} 211}
212 212
213static inline int ipv4_rcv_saddr_equal(struct sock *sk1, struct sock *sk2) 213static inline int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2)
214{ 214{
215 struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2); 215 struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2);
216 216