diff options
author | Kyle Mestery <kmestery@cisco.com> | 2013-02-14 09:37:26 -0500 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2013-02-26 11:28:29 -0800 |
commit | 6c5f65f263f5d6888c64f59217144b69a1197dc6 (patch) | |
tree | 14daac45e0de2f7589b5ada115e9e9d4974fc30d /lib | |
parent | d1ce0e9b90a604bcd05974bf05d458f114ff4cdf (diff) |
Modify dpif_linux_port_add() to set the destination port for VXLAN ports.
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpif-linux.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index b6eba397..3cf1225f 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -482,12 +482,15 @@ dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev, uint32_t *port_nop) { struct dpif_linux *dpif = dpif_linux_cast(dpif_); + const struct netdev_tunnel_config *tnl_cfg; const char *name = netdev_vport_get_dpif_port(netdev); const char *type = netdev_get_type(netdev); struct dpif_linux_vport request, reply; struct nl_sock *sock = NULL; uint32_t upcall_pid; struct ofpbuf *buf; + uint64_t options_stub[64 / 8]; + struct ofpbuf options; int error; if (dpif->epoll_fd >= 0) { @@ -514,6 +517,15 @@ dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev, netdev_linux_ethtool_set_flag(netdev, ETH_FLAG_LRO, "LRO", false); } + tnl_cfg = netdev_get_tunnel_config(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)); + request.options = options.data; + request.options_len = options.size; + } + request.port_no = *port_nop; upcall_pid = sock ? nl_sock_pid(sock) : 0; request.upcall_pid = &upcall_pid; |