summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/connections/bridge2
-rw-r--r--src/lib/connections/vlan3
-rwxr-xr-xsrc/lib/network2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/connections/bridge b/src/lib/connections/bridge
index b358e01..1b25f2b 100644
--- a/src/lib/connections/bridge
+++ b/src/lib/connections/bridge
@@ -29,7 +29,7 @@ bridge_up() {
bridge_down() {
for member in "${BindsToInterfaces[@]}"; do
- ip link set "$member" promisc off down
+ ip link set dev "$member" promisc off down
ip link set dev "$member" nomaster
done
diff --git a/src/lib/connections/vlan b/src/lib/connections/vlan
index b34a67e..037c971 100644
--- a/src/lib/connections/vlan
+++ b/src/lib/connections/vlan
@@ -10,6 +10,9 @@ vlan_up() {
if is_interface "$Interface"; then
report_error "Interface '$Interface' already exists"
return 1
+ elif [[ $VLANID != +([[:digit:]]) ]]; then
+ report_error "Invalid VLAN identifier: '$VLANID'"
+ return 1
else
bring_interface_up "$BindsToInterfaces"
interface_add vlan "$Interface" "$BindsToInterfaces" id "$VLANID"
diff --git a/src/lib/network b/src/lib/network
index b91b5e8..a875101 100755
--- a/src/lib/network
+++ b/src/lib/network
@@ -18,7 +18,7 @@ is_interface() {
interface_add() {
local type="$1" name="$2" link="$3"
shift 3
- ip link add ${link:+link "$link"} name "$name" type "$type" "$@"
+ ip link add ${link:+link "$link"} name "$name" type "$type" "$@" || return
if [[ -x "$PROFILE_DIR/interfaces/$name" ]]; then
source "$PROFILE_DIR/interfaces/$name"
fi