Commit 4cbcdf2b authored by WANG Cong's avatar WANG Cong Committed by David S. Miller

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: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 67270636
...@@ -23,7 +23,7 @@ struct fou { ...@@ -23,7 +23,7 @@ struct fou {
struct socket *sock; struct socket *sock;
u8 protocol; u8 protocol;
u8 flags; u8 flags;
u16 port; __be16 port;
struct udp_offload udp_offloads; struct udp_offload udp_offloads;
struct list_head list; struct list_head list;
}; };
...@@ -523,7 +523,7 @@ static int fou_create(struct net *net, struct fou_cfg *cfg, ...@@ -523,7 +523,7 @@ static int fou_create(struct net *net, struct fou_cfg *cfg,
static int fou_destroy(struct net *net, struct fou_cfg *cfg) static int fou_destroy(struct net *net, struct fou_cfg *cfg)
{ {
struct fou *fou; struct fou *fou;
u16 port = cfg->udp_config.local_udp_port; __be16 port = cfg->udp_config.local_udp_port;
int err = -EINVAL; int err = -EINVAL;
spin_lock(&fou_lock); spin_lock(&fou_lock);
...@@ -573,7 +573,7 @@ static int parse_nl_config(struct genl_info *info, ...@@ -573,7 +573,7 @@ static int parse_nl_config(struct genl_info *info,
} }
if (info->attrs[FOU_ATTR_PORT]) { 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; cfg->udp_config.local_udp_port = port;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment