From 7420e9bf38939da9fe9086bb3041dee5a5d680fe Mon Sep 17 00:00:00 2001 From: oblique Date: Sun, 19 Jul 2015 11:58:03 +0300 Subject: [PATCH] Fix bridged interface allocation. Bridge interface was allocated before COMMON_CONFDIR was set. This has as result the allocation to be done under `/ifaces` directory instead of `/tmp/create_ap.common.conf/ifaces`, so a new bridged interface name is allocated each name. Fix #94 --- create_ap | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/create_ap b/create_ap index aed73ac..85bb348 100755 --- a/create_ap +++ b/create_ap @@ -1352,14 +1352,6 @@ if [[ $(get_adapter_kernel_module ${WIFI_IFACE}) =~ ^rtl[0-9].*$ ]]; then echo "WARN: If AP doesn't work, please read: howto/realtek.md" >&2 fi -if [[ "$SHARE_METHOD" == "bridge" ]]; then - if is_bridge_interface $INTERNET_IFACE; then - BRIDGE_IFACE=$INTERNET_IFACE - else - BRIDGE_IFACE=$(alloc_new_iface br) - fi -fi - if [[ $NO_VIRT -eq 1 && "$WIFI_IFACE" == "$INTERNET_IFACE" ]]; then echo -n "ERROR: You can not share your connection from the same" >&2 echo " interface if you are using --no-virt option." >&2 @@ -1392,6 +1384,14 @@ if [[ -e /proc/sys/net/bridge/bridge-nf-call-iptables ]]; then fi mutex_unlock +if [[ "$SHARE_METHOD" == "bridge" ]]; then + if is_bridge_interface $INTERNET_IFACE; then + BRIDGE_IFACE=$INTERNET_IFACE + else + BRIDGE_IFACE=$(alloc_new_iface br) + fi +fi + if [[ $NO_VIRT -eq 0 ]]; then VWIFI_IFACE=$(alloc_new_iface ap)