Skip to content

Commit

Permalink
fou: always use be16 for port
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
congwang authored and davem330 committed Apr 13, 2015
1 parent 6727063 commit 4cbcdf2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/ipv4/fou.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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)
{
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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 4cbcdf2

Please sign in to comment.