diff -urNp -x '*.orig' lxc-4.0.8.org/config/init/common/lxc-net.in lxc-4.0.8/config/init/common/lxc-net.in --- lxc-4.0.8.org/config/init/common/lxc-net.in 2021-04-30 20:16:25.000000000 +0200 +++ lxc-4.0.8/config/init/common/lxc-net.in 2021-05-02 22:01:52.309594885 +0200 @@ -26,6 +26,17 @@ LXC_IPV6_NAT="false" [ ! -f $distrosysconfdir/lxc ] || . $distrosysconfdir/lxc +# Additional network based on macvlan +# It can be overridden in @LXC_DISTRO_SYSCONF@/lxc_macvlan +# by default is not used + +macvlan="@LIBEXECDIR@/lxc/lxc_macvlan" +USE_LXC_MACVLAN="false" + +[ ! -f $distrosysconfdir/lxc_macvlan ] || . $distrosysconfdir/lxc_macvlan +[ ! -f $macvlan ] || . $macvlan + + use_iptables_lock="-w" iptables -w -L -n > /dev/null 2>&1 || use_iptables_lock="" @@ -51,7 +62,9 @@ _ifup() { ip link set dev ${LXC_BRIDGE} up } + start() { + [ "x$USE_LXC_MACVLAN" = "xtrue" ] && { macvlan_start; exit $?; } [ "x$USE_LXC_BRIDGE" = "xtrue" ] || { exit 0; } [ ! -f "${varrun}/network_up" ] || { echo "lxc-net is already running"; exit 1; } @@ -145,6 +158,7 @@ start() { } stop() { + [ "x$USE_LXC_MACVLAN" = "xtrue" ] && { macvlan_stop; exit $?; } [ "x$USE_LXC_BRIDGE" = "xtrue" ] || { exit 0; } [ -f "${varrun}/network_up" ] || [ "$1" = "force" ] || { echo "lxc-net isn't running"; exit 1; }