Test macro ADD_VET takes an optional argument to specify
MAC address for the interface. However this address is
set only after the interface is brought UP, causing it
to keep IPv6 Link Local Address based on its old MAC.

Toggling the interface down/up after a new MAC address
is set fixes this issue.

Signed-off-by: Martin Kalcok <[email protected]>
---
 tests/system-common-macros.at | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
index 691c271a3..e7dee9d28 100644
--- a/tests/system-common-macros.at
+++ b/tests/system-common-macros.at
@@ -69,6 +69,9 @@ m4_define([ADD_VETH],
       NS_CHECK_EXEC([$2], [ip link set dev $1 up])
       if test -n "$5"; then
         NS_CHECK_EXEC([$2], [ip link set dev $1 address $5])
+        # Toggle the interface down/up to get an IPv6 LLA that matches its MAC 
addr.
+        NS_CHECK_EXEC([$2], [ip link set down $1])
+        NS_CHECK_EXEC([$2], [ip link set up $1])
       fi
       if test -n "$6"; then
         NS_CHECK_EXEC([$2], [ip route add $6 dev $1])
-- 
2.40.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to