From 3035627c93c1d29cef7f6fb9b98d83f05964931c Mon Sep 17 00:00:00 2001 From: Maximilian Wilhelm Date: Fri, 25 Sep 2020 22:07:10 +0200 Subject: [PATCH] link executor: Add dependency between veth pairs Signed-off-by: Maximilian Wilhelm --- executor-scripts/linux/link | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/executor-scripts/linux/link b/executor-scripts/linux/link index 24db96f..c8c05ce 100755 --- a/executor-scripts/linux/link +++ b/executor-scripts/linux/link @@ -28,6 +28,17 @@ is_vlan() { } case "$PHASE" in +depend) + # vlan-raw-device + if is_vlan; then + echo "$IF_VLAN_RAW_DEVICE" + + # veth-peer-name + elif [ "${IF_LINK_TYPE}" = "veth" -a "${IF_VETH_PEER_NAME}" ]; then + echo "${IF_VETH_PEER_NAME}" + fi + ;; + create) if [ "${IF_LINK_TYPE}" = "dummy" ]; then if [ -d "/sys/class/net/${IFACE}" ]; then @@ -94,9 +105,4 @@ destroy) ${MOCK} ip link del "${IFACE}" fi ;; -depend) - if is_vlan; then - echo "$IF_VLAN_RAW_DEVICE" - fi - ;; esac