Skip to content

Commit

Permalink
flow_keys: n_proto type should be __be16
Browse files Browse the repository at this point in the history
(struct flow_keys)->n_proto is in network order, use
proper type for this.

Fixes following sparse errors :

net/core/flow_dissector.c:139:39: warning: incorrect type in assignment (different base types)
net/core/flow_dissector.c:139:39:    expected unsigned short [unsigned] [usertype] n_proto
net/core/flow_dissector.c:139:39:    got restricted __be16 [assigned] [usertype] proto
net/core/flow_dissector.c:237:23: warning: incorrect type in assignment (different base types)
net/core/flow_dissector.c:237:23:    expected unsigned short [unsigned] [usertype] n_proto
net/core/flow_dissector.c:237:23:    got restricted __be16 [assigned] [usertype] proto

Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: e0f31d8 ("flow_keys: Record IP layer protocol in skb_flow_dissect()")
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 5, 2015
1 parent d1e158e commit f4575d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/net/flow_keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ struct flow_keys {
__be32 ports;
__be16 port16[2];
};
u16 thoff;
u16 n_proto;
u8 ip_proto;
u16 thoff;
__be16 n_proto;
u8 ip_proto;
};

bool __skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow,
Expand Down

0 comments on commit f4575d3

Please sign in to comment.