diff mbox series

ipv6: Correct/silence an endian warning in ip6_multipath_l3_keys

Message ID 20231117154831.2518110-1-chentao@kylinos.cn (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series ipv6: Correct/silence an endian warning in ip6_multipath_l3_keys | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1128 this patch: 1127
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 1154 this patch: 1154
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1155 this patch: 1154
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Kunwu Chan Nov. 17, 2023, 3:48 p.m. UTC
net/ipv6/route.c:2332:39: warning: incorrect type in assignment (different base types)
net/ipv6/route.c:2332:39:    expected unsigned int [usertype] flow_label
net/ipv6/route.c:2332:39:    got restricted __be32

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Dumazet Nov. 17, 2023, 5:29 p.m. UTC | #1
On Fri, Nov 17, 2023 at 6:06 PM Kunwu Chan <chentao@kylinos.cn> wrote:
>
> net/ipv6/route.c:2332:39: warning: incorrect type in assignment (different base types)
> net/ipv6/route.c:2332:39:    expected unsigned int [usertype] flow_label
> net/ipv6/route.c:2332:39:    got restricted __be32
>
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>

Same remark, we need a Fixes: tag

> ---
>  net/ipv6/route.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index b132feae3393..692c811eb786 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -2329,7 +2329,7 @@ static void ip6_multipath_l3_keys(const struct sk_buff *skb,
>         } else {
>                 keys->addrs.v6addrs.src = key_iph->saddr;
>                 keys->addrs.v6addrs.dst = key_iph->daddr;
> -               keys->tags.flow_label = ip6_flowlabel(key_iph);
> +               keys->tags.flow_label = be32_to_cpu(ip6_flowlabel(key_iph));
>                 keys->basic.ip_proto = key_iph->nexthdr;
>         }

This is not consistent with line 2541 doing:

hash_keys.tags.flow_label = (__force u32)flowi6_get_flowlabel(fl6);
Kunwu Chan Nov. 19, 2023, 2:35 p.m. UTC | #2
Hi Eric,
Thank you very much for the suggestion, I have modified and resent the 
patch as suggested.

On 2023/11/18 01:29, Eric Dumazet wrote:
> On Fri, Nov 17, 2023 at 6:06 PM Kunwu Chan <chentao@kylinos.cn> wrote:
>>
>> net/ipv6/route.c:2332:39: warning: incorrect type in assignment (different base types)
>> net/ipv6/route.c:2332:39:    expected unsigned int [usertype] flow_label
>> net/ipv6/route.c:2332:39:    got restricted __be32
>>
>> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
> 
> Same remark, we need a Fixes: tag
> 
>> ---
>>   net/ipv6/route.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
>> index b132feae3393..692c811eb786 100644
>> --- a/net/ipv6/route.c
>> +++ b/net/ipv6/route.c
>> @@ -2329,7 +2329,7 @@ static void ip6_multipath_l3_keys(const struct sk_buff *skb,
>>          } else {
>>                  keys->addrs.v6addrs.src = key_iph->saddr;
>>                  keys->addrs.v6addrs.dst = key_iph->daddr;
>> -               keys->tags.flow_label = ip6_flowlabel(key_iph);
>> +               keys->tags.flow_label = be32_to_cpu(ip6_flowlabel(key_iph));
>>                  keys->basic.ip_proto = key_iph->nexthdr;
>>          }
> 
> This is not consistent with line 2541 doing:
> 
> hash_keys.tags.flow_label = (__force u32)flowi6_get_flowlabel(fl6);
diff mbox series

Patch

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b132feae3393..692c811eb786 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2329,7 +2329,7 @@  static void ip6_multipath_l3_keys(const struct sk_buff *skb,
 	} else {
 		keys->addrs.v6addrs.src = key_iph->saddr;
 		keys->addrs.v6addrs.dst = key_iph->daddr;
-		keys->tags.flow_label = ip6_flowlabel(key_iph);
+		keys->tags.flow_label = be32_to_cpu(ip6_flowlabel(key_iph));
 		keys->basic.ip_proto = key_iph->nexthdr;
 	}
 }