Skip to content

Commit

Permalink
net: ip_sockglue.c add static, annotate ports' endianness
Browse files Browse the repository at this point in the history
Fixes sparse warnings:
net/ipv4/ip_sockglue.c:146:15: warning: incorrect type in assignment (different base types)
net/ipv4/ip_sockglue.c:146:15:    expected restricted __be16 [assigned] [usertype] sin_port
net/ipv4/ip_sockglue.c:146:15:    got unsigned short [unsigned] [short] [usertype] <noident>
net/ipv4/ip_sockglue.c:130:6: warning: symbol 'ip_cmsg_recv_dstaddr' was not declared. Should it be static?

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Harvey Harrison authored and David S. Miller committed Nov 20, 2008
1 parent 00b5e50 commit 21d1a16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/ip_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ static void ip_cmsg_recv_security(struct msghdr *msg, struct sk_buff *skb)
security_release_secctx(secdata, seclen);
}

void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb)
static void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb)
{
struct sockaddr_in sin;
struct iphdr *iph = ip_hdr(skb);
u16 *ports = (u16 *) skb_transport_header(skb);
__be16 *ports = (__be16 *)skb_transport_header(skb);

if (skb_transport_offset(skb) + 4 > skb->len)
return;
Expand Down

0 comments on commit 21d1a16

Please sign in to comment.