diff options
-rw-r--r-- | contrib/PKGBUILD.in | 1 | ||||
-rw-r--r-- | docs/examples/bridge | 6 | ||||
-rw-r--r-- | docs/netctl.profile.5.txt | 10 | ||||
-rw-r--r-- | src/lib/connections/bridge | 19 | ||||
-rw-r--r-- | src/lib/connections/wireless | 2 | ||||
-rw-r--r-- | src/lib/wpa | 3 | ||||
-rwxr-xr-x | src/wifi-menu | 6 |
7 files changed, 19 insertions, 28 deletions
diff --git a/contrib/PKGBUILD.in b/contrib/PKGBUILD.in index b4e31f0..5375b36 100644 --- a/contrib/PKGBUILD.in +++ b/contrib/PKGBUILD.in @@ -17,7 +17,6 @@ optdepends=('dialog: for the menu based wifi assistant' 'ifplugd: for automatic wired connections through netctl-ifplugd' 'wpa_actiond: for automatic wireless connections through netctl-auto' 'ifenslave: for bond connections' - 'bridge-utils: for bridge connections' 'ppp: for pppoe connections' ) source=(ftp://ftp.archlinux.org/other/packages/netctl/netctl-${pkgver}.tar.xz{,.sig}) diff --git a/docs/examples/bridge b/docs/examples/bridge index 19cb0bd..3f38d7a 100644 --- a/docs/examples/bridge +++ b/docs/examples/bridge @@ -3,7 +3,5 @@ Interface=br0 Connection=bridge BindsToInterfaces=(eth0 eth1 tap0) IP=dhcp -## sets forward delay time -#FwdDelay=0 -## sets max age of hello message -#MaxAge=10 +## Ignore (R)STP and immediately activate the bridge +#SkipForwardingDelay=yes diff --git a/docs/netctl.profile.5.txt b/docs/netctl.profile.5.txt index fe0073e..ec36f47 100644 --- a/docs/netctl.profile.5.txt +++ b/docs/netctl.profile.5.txt @@ -286,14 +286,12 @@ connections of the `bond' type. OPTIONS FOR `bridge' CONNECTIONS -------------------------------- The interfaces of 'BindsToInterfaces' take part in the bridge named by -'Interface'. Next to the *ip options*, the following are understood for +'Interface'. Next to the *ip options*, the following is understood for connections of the `bridge' type: -'FwdDelay=':: - Forward delay of the bridge. See *brctl*(8) for details. - -'MaxAge=':: - Maximum age parameter. See *brctl*(8) for details. +'SkipForwardingDelay=':: + Skip \(R)STP and immediately activate all bridge members. This can + be useful when DHCP is used on the bridge. OPTIONS FOR `pppoe' CONNECTIONS diff --git a/src/lib/connections/bridge b/src/lib/connections/bridge index 94a9b64..3b0a94b 100644 --- a/src/lib/connections/bridge +++ b/src/lib/connections/bridge @@ -2,7 +2,6 @@ . "$SUBR_DIR/ip" -: ${BRCTL:=brctl} declare -ag BindsToInterfaces bridge_up() { @@ -12,17 +11,17 @@ bridge_up() { return 1 fi else - $BRCTL addbr "$Interface" + ip link add name "$Interface" type bridge fi for member in "${BindsToInterfaces[@]}"; do - ip link set "$member" promisc on up - ip addr flush dev "$member" - $BRCTL addif "$Interface" "$member" + ip link set dev "$member" promisc on up + ip addr flush dev "$member" scope host &>/dev/null + ip addr flush dev "$member" scope site &>/dev/null + ip addr flush dev "$member" scope global &>/dev/null + ip link set dev "member" master "$Interface" + is_yes "${SkipForwardingDelay:-no}" && bridge link set dev "$member" state 3 done - # Set options - [[ "$FwdDelay" ]] && $BRCTL setfd "$Interface" "$FwdDelay" - [[ "$MaxAge" ]] && $BRCTL setmaxage "$Interface" "$MaxAge" bring_interface_up "$Interface" ip_set @@ -31,12 +30,12 @@ bridge_up() { bridge_down() { for member in "${BindsToInterfaces[@]}"; do ip link set "$member" promisc off down - $BRCTL delif "$Interface" "$member" + ip link set dev "$member" nomaster done ip_unset bring_interface_down "$Interface" - $BRCTL delbr "$Interface" + ip link delete "$Interface" type bridge } diff --git a/src/lib/connections/wireless b/src/lib/connections/wireless index fe01b90..870af51 100644 --- a/src/lib/connections/wireless +++ b/src/lib/connections/wireless @@ -17,7 +17,7 @@ wireless_up() { : ${Security:=none} : ${WPADriver:=nl80211,wext} : ${TimeoutWPA:=15} - + if [[ $RFKill ]]; then enable_rf "$Interface" "$RFKill" || return 1 fi diff --git a/src/lib/wpa b/src/lib/wpa index ca9b83e..d79fdbe 100644 --- a/src/lib/wpa +++ b/src/lib/wpa @@ -12,8 +12,7 @@ wpa_call() { if [[ $WPA_CTRL_DIR ]]; then args+=("-p" "$WPA_CTRL_DIR") elif [[ $WPAConfigFile ]] && grep -q "^[[:space:]]*ctrl_interface=" "$WPAConfigFile"; then - WPA_CTRL_DIR=$(grep -m1 "^[[:space:]]*ctrl_interface=" "$WPAConfigFile") - WPA_CTRL_DIR=${WPA_CTRL_DIR#*ctrl_interface=} + WPA_CTRL_DIR=$(sed -n "0,/^[[:space:]]*ctrl_interface=/s///p" "$WPAConfigFile") if [[ $WPA_CTRL_DIR == DIR=* ]]; then WPA_CTRL_DIR=${WPA_CTRL_DIR:4} WPA_CTRL_DIR=${WPA_CTRL_DIR%% GROUP=*} diff --git a/src/wifi-menu b/src/wifi-menu index d0903aa..a62881e 100755 --- a/src/wifi-menu +++ b/src/wifi-menu @@ -111,8 +111,7 @@ create_profile() key=$(dialog $box "$msg" 10 40 --stdout) || return $? if [[ "${#key}" -ge 8 && "${#key}" -le 63 ]]; then if [[ "$OBSCURE" ]]; then - key=$(wpa_passphrase "$1" "$key" | grep -m 1 "^[[:space:]]*psk=") - key=${key#*psk=} + key=$(wpa_passphrase "$1" "$key" | sed -n "s/^[[:space:]]*psk=//p") else key=$(printf "%q" "$key") fi @@ -210,8 +209,7 @@ if [[ ! -d "/sys/class/net/$INTERFACE" ]]; then fi echo -n "Scanning for networks... " -CONNECTION=$(wpa_call "$INTERFACE" status 2> /dev/null | grep -m 1 "^ssid=") -CONNECTION=${CONNECTION#ssid=} +CONNECTION=$(wpa_call "$INTERFACE" status 2> /dev/null | sed -n "s/^ssid=//p") NETWORKS=$(wpa_supplicant_scan "$INTERFACE" 3,4,5) if [[ $? -eq 0 ]]; then trap 'rm -f "$NETWORKS"' EXIT |