mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
system-traffic: Add link-args for ADD_NATIVE_TUNNEL.
Ubuntu 14.04 with kernel 3.13 fails to set a GRE tunnel's mac address after device state is up. The patch first introduces additional args 'link-args' for 'ip link set' and uses it to adds mac address setting in ADD_NATIVE_TUNNEL. As a result, the device could be configured before becoming up state. Note that the original 'link-args' is renamed to 'type-args'. Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Joe Stringer <joe@ovn.org>
This commit is contained in:
@@ -118,22 +118,23 @@ m4_define([ADD_OVS_TUNNEL],
|
||||
)
|
||||
|
||||
# ADD_NATIVE_TUNNEL([type], [port], [namespace], [remote-addr], [overlay-addr],
|
||||
# [link-args])
|
||||
# [type-args], [link-args])
|
||||
#
|
||||
# Add a native tunnel device within 'namespace', with name 'port' and type
|
||||
# 'type'. The tunnel device will be configured as point-to-point with the
|
||||
# 'remote-addr' as the underlay address of the remote tunnel endpoint (as
|
||||
# viewed from the perspective of that namespace).
|
||||
#
|
||||
# 'port' will be configured with the address 'overlay-addr'. 'link-args' is
|
||||
# made available so that additional arguments can be passed to "ip link",
|
||||
# for instance to configure the vxlan destination port.
|
||||
# 'port' will be configured with the address 'overlay-addr'. 'type-args' is
|
||||
# made available so that additional arguments can be passed to "ip link add"
|
||||
# for configuring specific link type's arguments, for instance to configure
|
||||
# the vxlan destination port. 'link-args' is made for arguments passed to
|
||||
# "ip link set", for instance to configure MAC address.
|
||||
#
|
||||
m4_define([ADD_NATIVE_TUNNEL],
|
||||
[NS_CHECK_EXEC([$3], [ip link add dev $2 type $1 remote $4 $6])
|
||||
NS_CHECK_EXEC([$3], [ip addr add dev $2 $5])
|
||||
NS_CHECK_EXEC([$3], [ip link set dev $2 up])
|
||||
NS_CHECK_EXEC([$3], [ip link set dev $2 mtu 1450])
|
||||
NS_CHECK_EXEC([$3], [ip link set dev $2 mtu 1450 $7 up])
|
||||
]
|
||||
)
|
||||
|
||||
|
@@ -384,9 +384,9 @@ AT_CHECK([ip link set dev br-underlay up])
|
||||
dnl Set up tunnel endpoints on OVS outside the namespace and with a native
|
||||
dnl linux device inside the namespace.
|
||||
ADD_OVS_TUNNEL([gre], [br0], [at_gre0], [172.31.1.1], [10.1.1.100/24])
|
||||
ADD_NATIVE_TUNNEL([gretap], [ns_gre0], [at_ns0], [172.31.1.100], [10.1.1.1/24])
|
||||
ADD_NATIVE_TUNNEL([gretap], [ns_gre0], [at_ns0], [172.31.1.100], [10.1.1.1/24],
|
||||
[], [address e6:66:c1:11:11:11])
|
||||
AT_CHECK([ovs-vsctl -- set interface at_gre0 ofport_request=1])
|
||||
NS_CHECK_EXEC([at_ns0], [ip link set dev ns_gre0 address e6:66:c1:11:11:11])
|
||||
NS_CHECK_EXEC([at_ns0], [arp -s 10.1.1.2 e6:66:c1:22:22:22])
|
||||
|
||||
dnl Set up (p1 and ovs-p1) at br0
|
||||
|
Reference in New Issue
Block a user