create_ap

create a nat-ed wifi ap
git clone git://git.2f30.org/create_ap
Log | Files | Refs | README | LICENSE

commit 7420e9bf38939da9fe9086bb3041dee5a5d680fe
parent 9c4a95b0b100119987e0b4bf2050b17edaab96c1
Author: oblique <psyberbits@gmail.com>
Date:   Sun, 19 Jul 2015 11:58:03 +0300

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

Diffstat:
Mcreate_ap | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git 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)