X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev-vport.c;h=92096e3f730552ef7bdb0f22626598a6d078100e;hb=9c8e276ec3f4a3368ec1cb7f713543d46d8ad23a;hp=301bb43dac5b1fc93c8979a17476b51d3183c9f7;hpb=077257b83c68a36ea86f2d21c8395f60df710c21;p=sliver-openvswitch.git diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 301bb43da..92096e3f7 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -131,7 +131,8 @@ netdev_vport_get_vport_type(const struct netdev *netdev) return (is_vport_class(class) ? vport_class_cast(class)->type : class == &netdev_internal_class ? OVS_VPORT_TYPE_INTERNAL - : class == &netdev_linux_class ? OVS_VPORT_TYPE_NETDEV + : (class == &netdev_linux_class || + class == &netdev_tap_class) ? OVS_VPORT_TYPE_NETDEV : OVS_VPORT_TYPE_UNSPEC); } @@ -578,6 +579,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 +605,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 +708,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,13 +915,13 @@ 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, \ \ NULL, /* get_features */ \ NULL, /* set_advertisements */ \ - NULL, /* get_vlan_vid */ \ \ NULL, /* set_policing */ \ NULL, /* get_qos_types */ \