X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fnetdev-vport.c;h=f6dbd03edd05443f08ce7e4c9b959621082c78a1;hb=dfbf7f354416264a0b84b09bf882ac0932e78c8b;hp=70cdf2907557c8e94f8a4015b78adefa5782f9ba;hpb=69ebca1e35a39d75032f3d8092da563f60673110;p=openvswitch diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 70cdf290..f6dbd03e 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,6 @@ #include "netlink-notifier.h" #include "netlink-socket.h" #include "ofpbuf.h" -#include "openvswitch/datapath-protocol.h" #include "openvswitch/tunnel.h" #include "packets.h" #include "route-table.h" @@ -578,6 +578,7 @@ parse_tunnel_config(const char *name, const char *type, struct shash_node *node; bool ipsec_mech_set = false; ovs_be32 daddr = htonl(0); + ovs_be32 saddr = htonl(0); uint32_t flags; flags = TNL_F_DF_DEFAULT | TNL_F_PMTUD | TNL_F_HDR_CACHE; @@ -603,8 +604,7 @@ parse_tunnel_config(const char *name, const char *type, if (lookup_ip(node->data, &in_addr)) { VLOG_WARN("%s: bad %s 'local_ip'", name, type); } else { - nl_msg_put_be32(options, OVS_TUNNEL_ATTR_SRC_IPV4, - in_addr.s_addr); + saddr = in_addr.s_addr; } } else if (!strcmp(node->name, "tos")) { if (!strcmp(node->data, "inherit")) { @@ -707,6 +707,14 @@ parse_tunnel_config(const char *name, const char *type, } nl_msg_put_be32(options, OVS_TUNNEL_ATTR_DST_IPV4, daddr); + if (saddr) { + if (ip_is_multicast(daddr)) { + VLOG_WARN("%s: remote_ip is multicast, ignoring local_ip", name); + } else { + nl_msg_put_be32(options, OVS_TUNNEL_ATTR_SRC_IPV4, saddr); + } + } + nl_msg_put_u32(options, OVS_TUNNEL_ATTR_FLAGS, flags); return 0; @@ -906,6 +914,7 @@ unparse_patch_config(const char *name OVS_UNUSED, const char *type OVS_UNUSED, NULL, /* set_mtu */ \ NULL, /* get_ifindex */ \ NULL, /* get_carrier */ \ + NULL, /* get_carrier_resets */ \ NULL, /* get_miimon */ \ netdev_vport_get_stats, \ netdev_vport_set_stats, \