Skip to content

Commit

Permalink
network/net-genrules.sh: generate rules for all interfaces
Browse files Browse the repository at this point in the history
previously, if "rd.neednet" and bond was specified, only the bond
interface was configured.

https://bugzilla.redhat.com/show_bug.cgi?id=1282680
  • Loading branch information
haraldh committed Jun 10, 2016
1 parent ac422d5 commit e6ae0c6
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions modules.d/40network/net-genrules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
# bridge: attempt only the defined interface
if [ -e /tmp/bridge.info ]; then
. /tmp/bridge.info
IFACES="$IFACES ${bridgeslaves%% *}"
RAW_IFACES="$RAW_IFACES $bridgeslaves"
MASTER_IFACES="$MASTER_IFACES $bridgename"
fi

Expand All @@ -27,7 +27,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
unset bondname
. "$i"
# It is enough to fire up only one
IFACES="$IFACES ${bondslaves%% *}"
RAW_IFACES="$RAW_IFACES $bondslaves"
MASTER_IFACES="$MASTER_IFACES ${bondname}"
done

Expand All @@ -36,15 +36,17 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
unset teamslaves
unset teammaster
. "$i"
IFACES="$IFACES ${teamslaves}"
RAW_IFACES="$RAW_IFACES ${teamslaves}"
MASTER_IFACES="$MASTER_IFACES ${teammaster}"
done

if [ -e /tmp/vlan.info ]; then
. /tmp/vlan.info
IFACES="$IFACES $phydevice"
RAW_IFACES="$RAW_IFACES $phydevice"
MASTER_IFACES="$MASTER_IFACES ${vlanname}"
fi
MASTER_IFACES="$(trim "$MASTER_IFACES")"
RAW_IFACES="$(trim "$RAW_IFACES")"

if [ -z "$IFACES" ]; then
[ -e /tmp/net.ifaces ] && read IFACES < /tmp/net.ifaces
Expand All @@ -59,10 +61,10 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""

# We have some specific interfaces to handle
if [ -n "$IFACES" ]; then
if [ -n "${RAW_IFACES}${IFACES}" ]; then
echo 'SUBSYSTEM!="net", GOTO="net_end"'
echo 'ACTION!="add|change|move", GOTO="net_end"'
for iface in $IFACES; do
for iface in $IFACES $RAW_IFACES; do
case "$iface" in
??:??:??:??:??:??) # MAC address
cond="ATTR{address}==\"$iface\""
Expand All @@ -83,13 +85,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
done
echo 'LABEL="net_end"'

if [ -n "$MASTER_IFACES" ]; then
wait_ifaces=$MASTER_IFACES
else
wait_ifaces=$IFACES
fi

for iface in $wait_ifaces; do
for iface in $IFACES; do
if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
echo "[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh
fi
Expand Down

0 comments on commit e6ae0c6

Please sign in to comment.