Skip to content

Commit

Permalink
[UDP]: saddr_cmp function should take const socket pointers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Sep 22, 2006
1 parent bed53ea commit e3b4ead
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/net/udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern struct proto udp_prot;
struct sk_buff;

extern int udp_get_port(struct sock *sk, unsigned short snum,
int (*saddr_cmp)(struct sock *, struct sock *));
int (*saddr_cmp)(const struct sock *, const struct sock *));
extern void udp_err(struct sk_buff *, u32);

extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
Expand Down
4 changes: 2 additions & 2 deletions net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static inline int udp_lport_inuse(u16 num)
* @saddr_comp: AF-dependent comparison of bound local IP addresses
*/
int udp_get_port(struct sock *sk, unsigned short snum,
int (*saddr_cmp)(struct sock *sk1, struct sock *sk2))
int (*saddr_cmp)(const struct sock *sk1, const struct sock *sk2))
{
struct hlist_node *node;
struct hlist_head *head;
Expand Down Expand Up @@ -210,7 +210,7 @@ int udp_get_port(struct sock *sk, unsigned short snum,
return error;
}

static inline int ipv4_rcv_saddr_equal(struct sock *sk1, struct sock *sk2)
static inline int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2)
{
struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2);

Expand Down

0 comments on commit e3b4ead

Please sign in to comment.