summaryrefslogtreecommitdiffstats
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
parent23ae1791917d48da7237d918f19dfa55a6a13d8f (diff)
downloadnetctl-6d83ce0798af47143a9698847f05b272e3fcb7e0.tar.gz
netctl-6d83ce0798af47143a9698847f05b272e3fcb7e0.tar.xz
Minor improvements to bridge/vlan code
-rw-r--r--README1
-rw-r--r--docs/netctl.profile.5.txt6
-rw-r--r--src/lib/connections/bridge2
-rw-r--r--src/lib/connections/vlan3
-rwxr-xr-xsrc/lib/network2
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