Hi, On Thu, 24 Aug 2017 14:41:16 +0200 Florian Zumbiehl <fl...@florz.de> wrote: > This line in /lib/bridge-utils/bridge-utils.sh is problematic: > > | if ! grep -q "$port:" /proc/net/dev > > 1. If there exists an interface whose name is a suffix of the interface > that is to be added to the bridge, this line incorrectly detects it as > already existing (like, eth0.3, if veth0.3 exists). > > 2. This line treats $port as a regular expression, which it isn't. eth1.2, > for example would match eth102, and thus, again, incorrectly detect the > interface as existing. > > Therefore, it should be replaced by something like this: > > | if ! sed 's/ *\(.*\):.*/\1/' /proc/net/dev | fgrep -qx -- "$port"
I think it's best to drop /proc/net/dev from the scripts completely and replace it with tests against the existence of files/directories under /sys/class/net/, which is much more robust and cleaner to code. But let's see what the maintainer thinks :) Regards, Apollon