Skip to content

Proposal of fix for kernel segfault #116

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pipework
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ else
}
fi

# This avoids segfault when pipework is called twice on the same container
ip netns exec $NSPID [ -d /sys/class/net/$CONTAINER_IFNAME ] &&
echo "A bridge on ${CONTAINER_IFNAME} already exists for ${GUESTNAME}" &&
UIFS=$(ls /sys/class/net/${IFNAME}/upper_ph${NSPID}* | sed "s/\/sys\/class\/net\/${IFNAME}\/upper_ph${NSPID}//g") &&
echo "$UIFS\nare already taken" &&
exit 1

# Check if an incompatible VLAN device already exists
[ $IFTYPE = phys ] && [ "$VLAN" ] && [ -d /sys/class/net/$IFNAME.VLAN ] && {
[ -z "$(ip -d link show $IFNAME.$VLAN | grep "vlan.*id $VLAN")" ] && {
Expand Down