mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
ipv4: fix endianness issue in inet_rtm_getroute_build_skb()
The UDP length field should be in network order.
This removes the following sparse error:
net/ipv4/route.c:3173:27: warning: incorrect type in assignment (different base types)
net/ipv4/route.c:3173:27: expected restricted __be16 [usertype] len
net/ipv4/route.c:3173:27: got unsigned long
Fixes: 404eb77ea7
("ipv4: support sport, dport and ip_proto in RTM_GETROUTE")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Roopa Prabhu <roopa@nvidia.com>
Cc: David Ahern <dsahern@kernel.org>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
616920a6a5
commit
92548b0ee2
@ -3165,7 +3165,7 @@ static struct sk_buff *inet_rtm_getroute_build_skb(__be32 src, __be32 dst,
|
||||
udph = skb_put_zero(skb, sizeof(struct udphdr));
|
||||
udph->source = sport;
|
||||
udph->dest = dport;
|
||||
udph->len = sizeof(struct udphdr);
|
||||
udph->len = htons(sizeof(struct udphdr));
|
||||
udph->check = 0;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user