diff options
author | Ben Pfaff <blp@nicira.com> | 2013-02-15 11:24:27 -0800 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2013-02-26 11:35:03 -0800 |
commit | bcd0c49f5e218e063234c83f47895ab6972d6057 (patch) | |
tree | c15392eb02f1d2cd870fbd38fb291e240658b530 /lib | |
parent | 6c5f65f263f5d6888c64f59217144b69a1197dc6 (diff) |
dpif-linux: Fix byte-swapping direction in nl_msg_put_u16() call.
OVS_TUNNEL_ATTR_DST_PORT expects a u16, tnl_cfg->dst_port is a be16, so
we want ntohs() instead of htons().
In practice htons() and ntohs() perform the same operation, so this does
not fix a real bug.
Found by sparse.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpif-linux.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index 3cf1225f..aa1739d0 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -521,7 +521,7 @@ dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev, if (tnl_cfg && tnl_cfg->dst_port != 0) { ofpbuf_use_stack(&options, options_stub, sizeof options_stub); nl_msg_put_u16(&options, OVS_TUNNEL_ATTR_DST_PORT, - htons(tnl_cfg->dst_port)); + ntohs(tnl_cfg->dst_port)); request.options = options.data; request.options_len = options.size; } |