Skip to content

Commit a25f822

Browse files
solbjorndavem330
authored andcommitted
flow_dissector: fix byteorder of dissected ICMP ID
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: 5dec597 ("flow_dissector: extract more ICMP information") Signed-off-by: Alexander Lobakin <alobakin@pm.me> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5053524 commit a25f822

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/core/flow_dissector.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void skb_flow_get_icmp_tci(const struct sk_buff *skb,
176176
* avoid confusion with packets without such field
177177
*/
178178
if (icmp_has_id(ih->type))
179-
key_icmp->id = ih->un.echo.id ? : 1;
179+
key_icmp->id = ih->un.echo.id ? ntohs(ih->un.echo.id) : 1;
180180
else
181181
key_icmp->id = 0;
182182
}

0 commit comments

Comments
 (0)