Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network: skip already enslaved interfaces #450

Merged
merged 1 commit into from Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules.d/35network-legacy/ifup.sh
Expand Up @@ -408,7 +408,11 @@ for p in $(getargs ip=); do
esac

# If this option isn't directed at our interface, skip it
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
if [ -n "$dev" ]; then
[ "$dev" != "$netif" ] && continue
else
iface_is_enslaved "$netif" && continue
fi

# Store config for later use
for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do
Expand Down
7 changes: 7 additions & 0 deletions modules.d/40network/net-lib.sh
Expand Up @@ -745,6 +745,13 @@ iface_has_link() {
iface_has_carrier "$@"
}

iface_is_enslaved() {
local _li
_li=$(ip -o link show dev $1)
strstr "$li" " master " || return 1
return 0
}

find_iface_with_link() {
local iface_path="" iface=""
for iface_path in /sys/class/net/*; do
Expand Down