summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémy Oudompheng <remy@archlinux.org>2011-08-09 00:27:53 +0200
committerRémy Oudompheng <remy@archlinux.org>2011-08-09 00:27:53 +0200
commit8dec3ca378062e538dd97eba1712338bbebc8f33 (patch)
tree3791de47b4d5411b6989b71894b3221222a24f11
parent82561d179d239bd7c3305e81fa62f01928fb390e (diff)
parent0b6ac7bf41ef2f1cf548eda8a4054c21a4bd9434 (diff)
downloadnetctl-8dec3ca378062e538dd97eba1712338bbebc8f33.tar.gz
netctl-8dec3ca378062e538dd97eba1712338bbebc8f33.tar.xz
Merge branch '2.6.x'
Conflicts: README
-rw-r--r--Makefile2
-rw-r--r--NEWS9
-rw-r--r--docs/examples/ethernet-static3
-rw-r--r--docs/netcfg-profiles.txt26
-rw-r--r--docs/netcfg.txt2
-rwxr-xr-xscripts/netcfg2
-rw-r--r--src/8021x24
-rw-r--r--src/connections/wireless5
-rw-r--r--src/network3
-rwxr-xr-xwpa_actiond/netcfg-wpa_actiond10
10 files changed, 57 insertions, 29 deletions
diff --git a/Makefile b/Makefile
index afee188..711c9e9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
DESTDIR=
-VERSION=2.6.5
+VERSION=2.6.7
VPATH = doc
.PHONY: install docs
diff --git a/NEWS b/NEWS
index e1cee06..75336ec 100644
--- a/NEWS
+++ b/NEWS
@@ -1,12 +1,19 @@
+version 2.6.7
+- fix wrong quoting of $profile (FS#25362)
+- fix wrong parsing of wpa_supplicant configuration (FS#25464)
+- fix conflict with old ROUTES variable (FS#25432)
+
version 2.6.6
- fix wrong rc scripts names in suspend hook (FS#20330)
+- fix wireless failure when using wpa-config and a custom
+ ctrl_interface path (FS#24949)
- bash-completion: add -r to option list (FS#25188)
version 2.6.5
- specify device name explicitly when setting gateways
version 2.6.4
-- documentation update
+- documentation update, new man page "netcfg-profiles"
- modify wireless workflow to avoid issues with association
version 2.6.3
diff --git a/docs/examples/ethernet-static b/docs/examples/ethernet-static
index 250896d..ea88bde 100644
--- a/docs/examples/ethernet-static
+++ b/docs/examples/ethernet-static
@@ -7,6 +7,9 @@ ADDR='192.168.1.23'
GATEWAY='192.168.1.1'
DNS=('192.168.1.1')
+## For IPv6 autoconfiguration
+#IP6=stateless
+
## For IPv6 static address configuration
#IP6='static'
#ADDR6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')
diff --git a/docs/netcfg-profiles.txt b/docs/netcfg-profiles.txt
index 07ee81f..5e11076 100644
--- a/docs/netcfg-profiles.txt
+++ b/docs/netcfg-profiles.txt
@@ -1,7 +1,7 @@
-% NETCFG-PROFILES(5) netcfg 2.6.5 | Arch Linux
+% NETCFG-PROFILES(5) netcfg 2.6.7 | Arch Linux
% Rémy Oudompheng <remy@archlinux.org>
James Rayner <james@archlinux.org>
-% 17 July 2011
+% 8 August 2011
NAME
====
@@ -76,13 +76,7 @@ NETMASK (requires IP of 'static')
: Set specified netmask. Defaults to 24
ROUTES
: An array of custom routes (of the form *address range* via *gateway*)
-IPCFG
-: Array of arguments to pass to 'ip'. The power of this options is that
- it allows both simple and complicated routing configurations, within the
- framework of netcfg.
-IFOPTS (deprecated, requires IP of 'static')
-: Arguments to pass to 'ifconfig'. This allows you to use the syntax
- for the older 'ifconfig' tool. Retained for compatability.
+
## IPv6 options
IP6 (required for IPv6)
: Either 'dhcp', 'dhcp-noaddr', 'stateless', 'static'. Leave unset to disable IPv6.
@@ -92,6 +86,7 @@ GATEWAY6 (for IP6=static)
: The gateway address for IPv6 routing.
ROUTES6
: An array of custom routes (of the form *address range* via *gateway*)
+
### DNS configuration
DNS
: Array of DNS nameservers. Simply specify the IP's of each of the DNS nameservers.
@@ -103,6 +98,7 @@ HOSTNAME
: Set the system hostname. Ensure any hostname is correctly referenced in /etc/hosts.
DNS1, DNS2 (deprecated)
: First and second DNS servers for /etc/resolv.conf
+
### DHCP configuration
DHCP_OPTIONS (ipv4)
: String. Any extra arguments to pass to the dhcp client, presently dhcpcd.
@@ -114,6 +110,7 @@ DHCLIENT_OPTIONS (ipv4)
: String. Extra options to pass to dhclient for IPv4.
DHCLIENT6_OPTIONS (ipv6)
: String. Extra options to pass to dhclient for IPv6.
+
### 802.11x Authentication
AUTH8021X
: Use 802.11x authentication. Enable with 'yes'.
@@ -123,6 +120,17 @@ WPA_OPTS (optional for an AUTH8021X of 'yes')
: Extra arguments for wpa_supplicant not specified otherwise. Any
option here must specify wpa_supplicant driver. Defaults to '-Dwired'.
+### Miscellaneous options
+IPCFG
+: Array of arguments to pass to 'ip'. The power of this options is that
+ it allows both simple and complicated routing configurations, within the
+ framework of netcfg.
+IFOPTS (deprecated, requires IP of 'static')
+: Arguments to pass to 'ifconfig'. This allows you to use the syntax
+ for the older 'ifconfig' tool. Retained for compatability.
+SKIPNOCARRIER
+: yes/no. Don't abort interface setup if no carrier is found.
+
## Examples
### Using ADDR and GATEWAY to set static IP and gateway
diff --git a/docs/netcfg.txt b/docs/netcfg.txt
index a00eb5d..e85abd8 100644
--- a/docs/netcfg.txt
+++ b/docs/netcfg.txt
@@ -1,4 +1,4 @@
-% NETCFG(8) netcfg 2.6.5 | Arch Linux
+% NETCFG(8) netcfg 2.6.7 | Arch Linux
% Rémy Oudompheng <remy@archlinux.org>
James Rayner <james@archlinux.org>
% July 2011
diff --git a/scripts/netcfg b/scripts/netcfg
index 9786f19..63fed27 100755
--- a/scripts/netcfg
+++ b/scripts/netcfg
@@ -2,7 +2,7 @@
. /usr/lib/network/network
-NETCFG_VER=2.6.5
+NETCFG_VER=2.6.7
version()
{
diff --git a/src/8021x b/src/8021x
index 8cdf0d5..3de0a00 100644
--- a/src/8021x
+++ b/src/8021x
@@ -1,5 +1,3 @@
-WPA_CLI="wpa_cli -p /run/wpa_supplicant"
-
# Uses wpa_supplicant to check for association to a network
# wpa_check interface [timeout]
wpa_check()
@@ -7,12 +5,13 @@ wpa_check()
local timeout=0 INTERFACE="$1" TIMEOUT="${2:-15}" CONDITION="${3:-COMPLETED}"
# CONDITION is required as wired connections are ready at ASSOCIATED not COMPLETED FS#20150
+ report_debug wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" status
while [[ $timeout -lt "$TIMEOUT" ]]; do
( # Sometimes wpa_supplicant isn't ready so silence errors for 2s only to avoid hiding real errors
if [[ $timeout -lt 2 ]]; then
- eval $($WPA_CLI -i "$INTERFACE" status 2> /dev/null | fgrep "wpa_state=")
+ eval $(wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" status 2> /dev/null | fgrep "wpa_state=")
else
- eval $($WPA_CLI -i "$INTERFACE" status | fgrep "wpa_state=")
+ eval $(wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" status | fgrep "wpa_state=")
fi
[[ "$wpa_state" = "$CONDITION" ]]
) && return 0
@@ -42,7 +41,7 @@ start_wpa()
stop_wpa()
{
- $WPA_CLI -i "$1" terminate &> /dev/null
+ wpa_cli -p "$WPA_CTRL_PATH" -i "$1" terminate &> /dev/null
sleep 1 # JP: need this else the file tends to disappear after [[ -f ... ]] but before cat...
# see <http://bbs.archlinux.org/viewtopic.php?pid=515667#p515667>
if [[ -f "/run/wpa_supplicant_$1.pid" ]]; then
@@ -52,7 +51,7 @@ stop_wpa()
wpa_reconfigure() {
local INTERFACE=$1
- $WPA_CLI -i "$INTERFACE" reconfigure
+ wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" reconfigure
return $?
}
@@ -60,7 +59,7 @@ wpa_check_current_essid() {
# usage: wpa_check_current_essid $interface $essid
# check that wpa_supplicant is connected to the right essid
local INTERFACE=$1 ESSID=$2 status
- status=$($WPA_CLI -i "$INTERFACE" status | grep "^ssid=")
+ status=$(wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" status | grep "^ssid=")
if (( $? == 0 )) && [[ "$status" == "ssid=$ESSID" ]]; then
return 0
else
@@ -97,11 +96,12 @@ wpa_supplicant_scan_and_find() {
# item = string to lookup
local INTERFACE="$1" FIELD="$2" ITEM="$3" RETRIES=5 try scan_ok
scan_ok=0
- $WPA_CLI -i "$INTERFACE" scan &> /dev/null
+ report_debug wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan
+ wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan &> /dev/null
for ((try=0; try < $RETRIES; try++)); do
local found
sleep 2
- found=$($WPA_CLI -i "$INTERFACE" scan_results | tail -n+2 | cut -f ${FIELD} | grep -F -x -m 1 "${ITEM}")
+ found=$(wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan_results | tail -n+2 | cut -f ${FIELD} | grep -F -x -m 1 "${ITEM}")
(( $? == 0 )) && scan_ok=1
# ITEM has been found, echo it
@@ -109,7 +109,7 @@ wpa_supplicant_scan_and_find() {
echo "$found"
return 0
fi
- $WPA_CLI -i "$INTERFACE" scan &> /dev/null
+ wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan &> /dev/null
done
if (( $scan_ok != 1 )); then
report_debug wpa_supplicant_scan_and_find "unable to retrieve scan results"
@@ -132,9 +132,9 @@ wpa_supplicant_scan_info() {
essids=$(mktemp --tmpdir essid.XXXXXXXX)
wpa_supplicant -B -i"$INTERFACE" -Dnl80211,wext -C/run/wpa_supplicant -P/run/wpa_supplicant.pid || return 1
- $WPA_CLI -i "$INTERFACE" scan &> /dev/null
+ wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan &> /dev/null
sleep 2.5
- $WPA_CLI -i "$INTERFACE" scan_results |
+ wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan_results |
grep -v "^Selected" |
grep -v "^bssid" |
sort -rn -k3 |
diff --git a/src/connections/wireless b/src/connections/wireless
index 7f95c6f..7ed5abe 100644
--- a/src/connections/wireless
+++ b/src/connections/wireless
@@ -26,8 +26,13 @@ wireless_up() {
stop_wpa "$INTERFACE"
# Start wpa_supplicant
+ WPA_CTRL_PATH=/run/wpa_supplicant
if [ "$SECURITY" = "wpa-config" ]; then
WPA_CONF="${WPA_CONF:-/etc/wpa_supplicant.conf}"
+ # Use defined control path (FS#24949)
+ if grep "ctrl_interface=" "$WPA_CONF" &>/dev/null; then
+ WPA_CTRL_PATH=$(grep -m 1 "^ctrl_interface=" "$WPA_CONF" | tail -n 1 | cut -d= -f 2- | sed -r 's/DIR=(.*) +GROUP=.*/\1/')
+ fi
else
WPA_CONF=$(make_wpa_config_file $INTERFACE)
fi
diff --git a/src/network b/src/network
index 195c480..e1a57a2 100644
--- a/src/network
+++ b/src/network
@@ -6,6 +6,7 @@
# $1: profile name
load_profile()
{
+ unset ROUTES
[[ -z "$1" ]] && return 1
if [[ ! -f "$PROFILE_DIR/$1" ]]; then
report_err "Profile \"$1\" does not exist"
@@ -333,7 +334,7 @@ set_iface() {
local PROFILE="$3"
[[ -z "$PROFILE" ]] && PROFILE=external
if [[ "$1" == "up" ]]; then
- echo "PROFILE=$PROFILE" > "$STATE_DIR/interfaces/$2"
+ echo "PROFILE='$PROFILE'" > "$STATE_DIR/interfaces/$2"
elif [[ "$1" == "down" ]]; then
rm -f "$STATE_DIR/interfaces/$2" # JP: add -f so we don't complain if the interface isn't up
fi
diff --git a/wpa_actiond/netcfg-wpa_actiond b/wpa_actiond/netcfg-wpa_actiond
index 3bbb9fc..9ad319f 100755
--- a/wpa_actiond/netcfg-wpa_actiond
+++ b/wpa_actiond/netcfg-wpa_actiond
@@ -51,10 +51,14 @@ fi
WPA_CONF="$(make_wpa_config_file $interface)"
-for profile in ${AUTO_PROFILES:-$(list_profiles)}; do
- echo $profile
+if [[ -n "${AUTO_PROFILES}" ]]; then
+ for prof in ${AUTO_PROFILES}; do echo $prof; done
+else
+ list_profiles
+fi | while read profile; do
+ echo "$profile"
(
- load_profile $profile
+ load_profile "$profile"
[[ $CONNECTION != "wireless" ]] && exit 1
[[ $INTERFACE != $interface ]] && exit 1