summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2014-03-01 21:44:34 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2014-03-01 22:17:13 +0100
commit6d83ce0798af47143a9698847f05b272e3fcb7e0 (patch)
tree3950e69786654fd7593165a40fb69e4123bef3b1 /src
parent23ae1791917d48da7237d918f19dfa55a6a13d8f (diff)
downloadnetctl-6d83ce0798af47143a9698847f05b272e3fcb7e0.tar.gz
netctl-6d83ce0798af47143a9698847f05b272e3fcb7e0.tar.xz
Minor improvements to bridge/vlan code
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