From: Alexander Lobakin <hidden> Date: 2021-03-12 20:10:04
flow_dissector_key_icmp::id is of type u16 (CPU byteorder),
ICMP header has its ID field in network byteorder obviously.
Sparse says:
net/core/flow_dissector.c:178:43: warning: restricted __be16 degrades to integer
Convert ID value to CPU byteorder when storing it into
flow_dissector_key_icmp.
Fixes: 5dec597e5cd0 ("flow_dissector: extract more ICMP information")
Signed-off-by: Alexander Lobakin <redacted>
---
net/core/flow_dissector.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Jakub Sitnicki <jakub@cloudflare.com> Date: 2021-03-14 20:22:39
On Fri, Mar 12, 2021 at 09:08 PM CET, Alexander Lobakin wrote:
quoted hunk
flow_dissector_key_icmp::id is of type u16 (CPU byteorder),
ICMP header has its ID field in network byteorder obviously.
Sparse says:
net/core/flow_dissector.c:178:43: warning: restricted __be16 degrades to integer
Convert ID value to CPU byteorder when storing it into
flow_dissector_key_icmp.
Fixes: 5dec597e5cd0 ("flow_dissector: extract more ICMP information")
Signed-off-by: Alexander Lobakin <redacted>
---
net/core/flow_dissector.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Smells like a breaking change for existing consumers of this value.
How about we change the type of flow_dissector_key_icmp{}.id to __be16
instead to make sparse happy?
From: Vladimir Oltean <vladimir.oltean@nxp.com> Date: 2021-03-14 20:45:26
On Sun, Mar 14, 2021 at 09:21:40PM +0100, Jakub Sitnicki wrote:
On Fri, Mar 12, 2021 at 09:08 PM CET, Alexander Lobakin wrote:
quoted
flow_dissector_key_icmp::id is of type u16 (CPU byteorder),
ICMP header has its ID field in network byteorder obviously.
Sparse says:
net/core/flow_dissector.c:178:43: warning: restricted __be16 degrades to integer
Convert ID value to CPU byteorder when storing it into
flow_dissector_key_icmp.
Fixes: 5dec597e5cd0 ("flow_dissector: extract more ICMP information")
Signed-off-by: Alexander Lobakin <redacted>
---
net/core/flow_dissector.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Smells like a breaking change for existing consumers of this value.
How about we change the type of flow_dissector_key_icmp{}.id to __be16
instead to make sparse happy?
The struct flow_dissector_key_icmp::id only appears to be used in
bond_xmit_hash, and there, the exact value doesn't seem to matter.
This appears to be a real bug and not just to appease sparse:
ih->un.echo.id has one endianness and "1" has another. Both cannot
be correct.
From: David Miller <davem@davemloft.net> Date: 2021-03-14 21:31:50
From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: Sun, 14 Mar 2021 20:44:49 +0000
On Sun, Mar 14, 2021 at 09:21:40PM +0100, Jakub Sitnicki wrote:
quoted
On Fri, Mar 12, 2021 at 09:08 PM CET, Alexander Lobakin wrote:
Smells like a breaking change for existing consumers of this value.
How about we change the type of flow_dissector_key_icmp{}.id to __be16
instead to make sparse happy?
The struct flow_dissector_key_icmp::id only appears to be used in
bond_xmit_hash, and there, the exact value doesn't seem to matter.
This appears to be a real bug and not just to appease sparse:
ih->un.echo.id has one endianness and "1" has another. Both cannot
be correct.
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Fri, 12 Mar 2021 20:08:57 +0000 you wrote:
flow_dissector_key_icmp::id is of type u16 (CPU byteorder),
ICMP header has its ID field in network byteorder obviously.
Sparse says:
net/core/flow_dissector.c:178:43: warning: restricted __be16 degrades to integer
Convert ID value to CPU byteorder when storing it into
flow_dissector_key_icmp.
[...]