projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: Fix intermittent failure in ovs-monitor-ipsec test.
[openvswitch]
/
lib
/
netdev-vport.c
diff --git
a/lib/netdev-vport.c
b/lib/netdev-vport.c
index 70cdf2907557c8e94f8a4015b78adefa5782f9ba..f6dbd03edd05443f08ce7e4c9b959621082c78a1 100644
(file)
--- a/
lib/netdev-vport.c
+++ b/
lib/netdev-vport.c
@@
-21,6
+21,7
@@
#include <errno.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/socket.h>
+#include <linux/openvswitch.h>
#include <linux/rtnetlink.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <linux/rtnetlink.h>
#include <net/if.h>
#include <sys/ioctl.h>
@@
-38,7
+39,6
@@
#include "netlink-notifier.h"
#include "netlink-socket.h"
#include "ofpbuf.h"
#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"
#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);
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;
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 {
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")) {
}
} 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);
}
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;
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, /* 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_miimon */ \
netdev_vport_get_stats, \
netdev_vport_set_stats, \