untabify
This commit is contained in:
1 parent
7c979d6725
commit
fd7b034713
1 file changed
+14
-14
+14
-14
@@ -121,24 +121,24 @@ configure_container_networking() {
|
|||||||
LOCAL_IFNAME="v${CONTAINER_IFNAME}pl${NSPID}"
|
LOCAL_IFNAME="v${CONTAINER_IFNAME}pl${NSPID}"
|
||||||
GUEST_IFNAME="v${CONTAINER_IFNAME}pg${NSPID}"
|
GUEST_IFNAME="v${CONTAINER_IFNAME}pg${NSPID}"
|
||||||
if ip link add name $LOCAL_IFNAME mtu $MTU type veth peer name $GUEST_IFNAME mtu $MTU ; then
|
if ip link add name $LOCAL_IFNAME mtu $MTU type veth peer name $GUEST_IFNAME mtu $MTU ; then
|
||||||
if ip link set $LOCAL_IFNAME master $BRIDGE && \
|
if ip link set $LOCAL_IFNAME master $BRIDGE && \
|
||||||
ip link set $LOCAL_IFNAME up && \
|
ip link set $LOCAL_IFNAME up && \
|
||||||
ip link set $GUEST_IFNAME netns $NSPID
|
ip link set $GUEST_IFNAME netns $NSPID
|
||||||
then
|
then
|
||||||
ip netns exec $NSPID ip link set $GUEST_IFNAME name $CONTAINER_IFNAME && \
|
ip netns exec $NSPID ip link set $GUEST_IFNAME name $CONTAINER_IFNAME && \
|
||||||
ip netns exec $NSPID ip addr add $2 dev $CONTAINER_IFNAME && \
|
ip netns exec $NSPID ip addr add $2 dev $CONTAINER_IFNAME && \
|
||||||
ip netns exec $NSPID ip link set $CONTAINER_IFNAME up && \
|
ip netns exec $NSPID ip link set $CONTAINER_IFNAME up && \
|
||||||
$(check_command_and_run ethtool ip netns exec $NSPID ethtool -K $3 tx off >/dev/null) && \
|
$(check_command_and_run ethtool ip netns exec $NSPID ethtool -K $3 tx off >/dev/null) && \
|
||||||
EXITCODE=0
|
EXITCODE=0
|
||||||
else
|
else
|
||||||
# failed before we assigned the veth to the container's namespace - delete it
|
# failed before we assigned the veth to the container's namespace - delete it
|
||||||
ip link delete $LOCAL_IFNAME type veth || true
|
ip link delete $LOCAL_IFNAME type veth || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -f /var/run/netns/$NSPID ] && rm -f /var/run/netns/$NSPID
|
[ -f /var/run/netns/$NSPID ] && rm -f /var/run/netns/$NSPID
|
||||||
|
|
||||||
exit $EXITCODE
|
exit $EXITCODE
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$COMMAND" in
|
case "$COMMAND" in
|
||||||
|
|||||||
Reference in new issue
Block a user