diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2015-04-10 22:00:28 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-13 04:25:13 +0300 |
commit | 4cbcdf2b6c8065cb9f2e0eda8c12d33b1b617043 (patch) | |
tree | d84df8610a41e0b023dbc8163d44a17738d8c70a /net/ipv4 | |
parent | 67270636a8285166c4ee035e1b53e99a7c55d232 (diff) | |
download | linux-4cbcdf2b6c8065cb9f2e0eda8c12d33b1b617043.tar.xz |
fou: always use be16 for port
udp_config.local_udp_port is be16. And iproute2 passes
network order for FOU_ATTR_PORT.
This doesn't fix any bug, just for consistency.
Cc: Tom Herbert <tom@herbertland.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/fou.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c index ad0ee827a0c0..d61f6f995733 100644 --- a/net/ipv4/fou.c +++ b/net/ipv4/fou.c @@ -23,7 +23,7 @@ struct fou { struct socket *sock; u8 protocol; u8 flags; - u16 port; + __be16 port; struct udp_offload udp_offloads; struct list_head list; }; @@ -523,7 +523,7 @@ error: static int fou_destroy(struct net *net, struct fou_cfg *cfg) { struct fou *fou; - u16 port = cfg->udp_config.local_udp_port; + __be16 port = cfg->udp_config.local_udp_port; int err = -EINVAL; spin_lock(&fou_lock); @@ -573,7 +573,7 @@ static int parse_nl_config(struct genl_info *info, } if (info->attrs[FOU_ATTR_PORT]) { - u16 port = nla_get_u16(info->attrs[FOU_ATTR_PORT]); + __be16 port = nla_get_be16(info->attrs[FOU_ATTR_PORT]); cfg->udp_config.local_udp_port = port; } |