From 6d83ce0798af47143a9698847f05b272e3fcb7e0 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Sat, 1 Mar 2014 21:44:34 +0100 Subject: Minor improvements to bridge/vlan code --- README | 1 - docs/netctl.profile.5.txt | 6 +++--- src/lib/connections/bridge | 2 +- src/lib/connections/vlan | 3 +++ src/lib/network | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README b/README index 517b8da..95df087 100644 --- a/README +++ b/README @@ -11,7 +11,6 @@ Optional: - dialog: for the interactive assistant - ifplugd: for automatic connection - wpa_actiond: for automatic connection -- bridge-utils: for bridge support For documentation generation: - asciidoc diff --git a/docs/netctl.profile.5.txt b/docs/netctl.profile.5.txt index 623a24d..9bdbb91 100644 --- a/docs/netctl.profile.5.txt +++ b/docs/netctl.profile.5.txt @@ -39,8 +39,7 @@ AVAILABLE CONNECTION TYPES +bond+:: For bonded interfaces. +bridge+:: - Network bridging. This connection type requires *brctl* to be - available. + For bridge interfaces. +dummy+:: For dummy interfaces. +ppp+:: @@ -455,7 +454,8 @@ single network interface. All options for connections of the `ethernet' type are understood for connections of the `vlan' type. Additionally, connections of the `vlan' -type can set a vlan identifier using 'VLANID='. See *ip*(8) for details. +type must set a vlan identifier using 'VLANID='. See *ip*(8) for +details. SPECIAL QUOTING RULES 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 -- cgit v1.2.3-24-g4f1b