All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] ipv4: fix endianness issue in inet_rtm_getroute_build_skb()
@ 2021-08-31  2:02 Eric Dumazet
  2021-08-31  2:34 ` David Ahern
  2021-08-31 11:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2021-08-31  2:02 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski
  Cc: netdev, Eric Dumazet, Eric Dumazet, Roopa Prabhu, David Ahern

From: Eric Dumazet <edumazet@google.com>

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: 404eb77ea766 ("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>
---
 net/ipv4/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 225714b5efc0b9c6bcd2d58a62d4656cdc5a1cde..94e33d3eaf621d99baeab338e4e847471d835215 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -3184,7 +3184,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;
 	}
-- 
2.33.0.259.gc128427fd7-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ipv4: fix endianness issue in inet_rtm_getroute_build_skb()
  2021-08-31  2:02 [PATCH net] ipv4: fix endianness issue in inet_rtm_getroute_build_skb() Eric Dumazet
@ 2021-08-31  2:34 ` David Ahern
  2021-08-31 11:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2021-08-31  2:34 UTC (permalink / raw)
  To: Eric Dumazet, David S . Miller, Jakub Kicinski
  Cc: netdev, Eric Dumazet, Roopa Prabhu, David Ahern

On 8/30/21 7:02 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> 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: 404eb77ea766 ("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>
> ---
>  net/ipv4/route.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ipv4: fix endianness issue in inet_rtm_getroute_build_skb()
  2021-08-31  2:02 [PATCH net] ipv4: fix endianness issue in inet_rtm_getroute_build_skb() Eric Dumazet
  2021-08-31  2:34 ` David Ahern
@ 2021-08-31 11:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-31 11:10 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: davem, kuba, netdev, edumazet, roopa, dsahern

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Mon, 30 Aug 2021 19:02:10 -0700 you wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> 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
> 
> [...]

Here is the summary with links:
  - [net] ipv4: fix endianness issue in inet_rtm_getroute_build_skb()
    https://git.kernel.org/netdev/net-next/c/92548b0ee220

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-31 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31  2:02 [PATCH net] ipv4: fix endianness issue in inet_rtm_getroute_build_skb() Eric Dumazet
2021-08-31  2:34 ` David Ahern
2021-08-31 11:10 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.