[OpenWrt-Devel] [PATCH] hostapd: correctly handle macfile uci option
From: Antonio Quartulli Make hostapd.sh correctly handle the macfile uci option. Such option specifies the macfile name to pass into the hostapd configuration file. Moreover, if a maclist option has been specified, copy the macfile before appending new entries. Signed-off-by: Antonio Quartulli --- package/network/services/hostapd/files/hostapd.sh | 33 --- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 00c6a09..8d6f305 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -215,10 +215,31 @@ hostapd_set_bss_options() { esac fi - config_get macfilter "$vif" macfilter - macfile="/var/run/hostapd-$ifname.maclist" - [ -e "$macfile" ] && rm -f "$macfile" + config_get macfile "$vif" macfile + config_get maclist "$vif" maclist + if [ -z "$macfile" ] + then + # if no macfile has been specified, fallback to the default name + macfile="/var/run/hostapd-$ifname.maclist" + else + if [ -n "$maclist" ] + then + # to avoid to overwrite the original file, make a copy + # before appending the entries specified by the maclist + # option + cp $macfile $macfile.maclist + macfile=$macfile.maclist + fi + fi + + if [ -n "$maclist" ] + then + for mac in $maclist; do + echo "$mac" >> $macfile + done + fi + config_get macfilter "$vif" macfilter case "$macfilter" in allow) append "$var" "macaddr_acl=1" "$N" @@ -229,12 +250,6 @@ hostapd_set_bss_options() { append "$var" "deny_mac_file=$macfile" "$N" ;; esac - config_get maclist "$vif" maclist - [ -n "$maclist" ] && { - for mac in $maclist; do - echo "$mac" >> $macfile - done - } } hostapd_set_log_options() { -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] broken unicast?
* Nicolás Echániz [07.06.2013 07:57]: > We recently upgraded QuintanaLibre to r36655 and we started seeing this > strange behavior, where some nodes are suddenly inaccesible from others. > It seems quite random. A node that's not accesible through one neighbor > at some point in time, is accessible through others. After a full > network reset, the previous bad path may be fixed and a different one > broken. have you checked the kernel-log, if your wifi-driver is reporting maybe strange things? which hardware/models are involved? do you have a watchdog running, which counts "incoming frames" on each wifi-devices and logs if there are 0 frames transmitted within 60 seconds? bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] broken unicast?
We recently upgraded QuintanaLibre to r36655 and we started seeing this strange behavior, where some nodes are suddenly inaccesible from others. It seems quite random. A node that's not accesible through one neighbor at some point in time, is accessible through others. After a full network reset, the previous bad path may be fixed and a different one broken. Here's a series of tests I made to try to understando the problem: http://pastebin.com/Qq4D8KGQ summary: arping and batman OGMs are getting through while regular unicast traffic (ping or batctl ping for example) are not. ping through fe80 addresses of associated interfaces also fails (this discards batman as the source of the problem). ...see the pastebin for actual tests. The same network was working fine with r33815. Please let me know if some other information would be useful for debugging this problem. I'll leave the network in r36655 until tomorrow in case it's useful to get more data, then I'll revert revision because people are mad :) and it's a production net. Cheers! Nico ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] Compiling 8device uboot source for Ralink.
I'm compiling the 8device uboot located here: https://github.com/8devices/u-boot.git Using the OpenWRT cross compiler. When I get to the end I can't link because of a missing _GLOBAL_OFFSET_TABLE_ symbol. Googling around people say that adding -fno-pic may solve this but I haven't had any success. UNDEF_SYM=`/home/apps/openwrt/staging_dir/toolchain-mipsel_dsp_gcc-4.7.2_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-objdump -x lib_generic/libgeneric.a board/rt2880/librt2880.a cpu/ralink_soc/libralink_soc.a lib_mips/libmips.a net/libnet.a rtc/librtc.a drivers/libdrivers.a common/libcommon.a |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ /home/apps/openwrt/staging_dir/toolchain-mipsel_dsp_gcc-4.7.2_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-ld -Bstatic -T /home/apps/8boot/board/rt2880/u-boot.lds -Ttext 0x8020 $UNDEF_SYM cpu/ralink_soc/start.o \ --start-group lib_generic/libgeneric.a board/rt2880/librt2880.a cpu/ralink_soc/libralink_soc.a lib_mips/libmips.a net/libnet.a rtc/librtc.a drivers/libdrivers.a common/libcommon.a --end-group -L /home/apps/openwrt/staging_dir/toolchain-mipsel_dsp_gcc-4.7.2_uClibc-0.9.33.2/lib/gcc/mipsel-openwrt-linux-uclibc/4.7.2 \ -Map u-boot.map -o u-boot /bin/sh: line 0: [: : integer expression expected cpu/ralink_soc/start.o: In function `reset': (.text+0x6b8): undefined reference to `_GLOBAL_OFFSET_TABLE_' make: *** [u-boot] Error 1 -- Jon Smirl jonsm...@gmail.com ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH v2] authsae: adapt uci scripts to use authsae
Hi The patch work ok for me (tested with wr1043nd and rspro, both ath9k) For information, we still need to disable hwcrypt, for exemple by editing '/etc/modules.d/28-ath9k' and putting 'ath9k nohwcrypt=1' in it Le 03/06/2013 15:57, Emanuel Taube a écrit : > This patch modifies the uci scripts to be able to > start meshd-nl80211 for encrypted mesh networks, > therefor a new script (authsae.sh) is inserted. > > Signed-off-by: Emanuel Taube > > diff --git a/package/mac80211/files/lib/wifi/mac80211.sh > b/package/mac80211/files/lib/wifi/mac80211.sh > index a052a1c..a79b6b8 100644 > --- a/package/mac80211/files/lib/wifi/mac80211.sh > +++ b/package/mac80211/files/lib/wifi/mac80211.sh > @@ -251,7 +251,7 @@ disable_mac80211() ( > include /lib/network > for wdev in $(list_phy_interfaces "$phy"); do > [ -f "/var/run/$wdev.pid" ] && kill $(cat /var/run/$wdev.pid) > >&/dev/null 2>&1 > - for pid in `pidof wpa_supplicant`; do > + for pid in `pidof wpa_supplicant` `pidof meshd-nl80211`; do > grep "$wdev" /proc/$pid/cmdline >/dev/null && \ > kill $pid > done > @@ -370,8 +370,13 @@ enable_mac80211() { > [ "$apidx" -gt 1 ] || iw phy "$phy" interface > add "$ifname" type managed > ;; > mesh) > - config_get mesh_id "$vif" mesh_id > - iw phy "$phy" interface add "$ifname" type mp > mesh_id "$mesh_id" > + config_get key "$vif" key "" > + if [ -n "$key" ]; then > + iw phy "$phy" interface add "$ifname" > type mp > + else > + config_get mesh_id "$vif" mesh_id > + iw phy "$phy" interface add "$ifname" > type mp mesh_id "$mesh_id" > + fi > ;; > monitor) > iw phy "$phy" interface add "$ifname" type > monitor > @@ -426,9 +431,16 @@ enable_mac80211() { > rm -f /var/run/hostapd-$phy.conf > for vif in $vifs; do > config_get mode "$vif" mode > - [ "$mode" = "ap" ] || continue > - mac80211_hostapd_setup_bss "$phy" "$vif" > - start_hostapd=1 > + case "$mode" in > + ap) > + mac80211_hostapd_setup_bss "$phy" "$vif" > + start_hostapd=1 > + ;; > + mesh) > + config_get key "$vif" key "" > + [ -n "$key" ] && authsae_start_interface > "$device" "$vif" > + ;; > + esac > done > > [ -n "$start_hostapd" ] && { > diff --git a/package/network/services/authsae/Makefile > b/package/network/services/authsae/Makefile > index 63320ae..4232653 100644 > --- a/package/network/services/authsae/Makefile > +++ b/package/network/services/authsae/Makefile > @@ -37,6 +37,8 @@ TARGET_CFLAGS += -D_GNU_SOURCE > define Package/authsae/install > $(INSTALL_DIR) $(1)/usr/bin > $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin > + $(INSTALL_DIR) $(1)/lib/wifi > + $(INSTALL_DATA) ./files/lib/wifi/authsae.sh $(1)/lib/wifi/ > endef > > $(eval $(call BuildPackage,authsae)) > diff --git a/package/network/services/authsae/files/lib/wifi/authsae.sh > b/package/network/services/authsae/files/lib/wifi/authsae.sh > new file mode 100644 > index 000..daa43eb > --- /dev/null > +++ b/package/network/services/authsae/files/lib/wifi/authsae.sh > @@ -0,0 +1,53 @@ > +authsae_start_interface() { > + local device="$1" # to use the correct channel > + local vif="$2" > + local band > + > + cfgfile="/var/run/authsae-$vif.cfg" > + config_get channel "$device" channel > + config_get hwmode "$device" hwmode > + config_get htmode "$device" htmode > + config_get ifname "$vif" ifname > + config_get key "$vif" key > + config_get mesh_id "$vif" mesh_id > + config_get mcast_rate "$vif" mcast_rate "12" > + > + case "$htmode" in > + HT20|HT40+|HT40-) htmode="$htmode";; > + NOHT|none|*) htmode="none";; > + esac > + > + case "$hwmode" in > + *g*) band=11g;; > + *a*) band=11a;; > + esac > + > + cat > "$cfgfile" < +authsae: > +{ > + sae: > + { > +debug = 0; > +password = "$key"; > +group = [19, 26, 21, 25, 20]; > +blacklist = 5; > +thresh = 5; > +lifetime = 3600; > + }; > + meshd: > + { > +meshid = "$mesh_id"; > +interface = "$ifname"; > +passive = 0; > +debug = 0; > +mediaopt = 1; > +band = "$band"; > +channel = $channel; > +htmode = "$htmode"; > +mcast-rate = $mcast_rate;
Re: [OpenWrt-Devel] [PATCH] [packages] puppet (second try)
Bump? Let me know if anything is missing or requires improvement. On Thu, May 23, 2013 at 8:29 PM, Kyle Anderson wrote: > This patch provides the Puppet package, a configuration management tool. > > I've already got upstream support for OpenWrt into Puppet, so this patch > doesn't require any puppet modifications, so that is cool. > > Signed-off-by: Kyle Anderson > > Index: admin/puppet/files/puppet.init > === > --- admin/puppet/files/puppet.init (revision 0) > +++ admin/puppet/files/puppet.init (working copy) > @@ -0,0 +1,12 @@ > +#!/bin/sh /etc/rc.common > +# Copyright (C) 2013 OpenWrt.org > + > +START=70 > + > +start() { > + service_start /usr/bin/ruby /usr/bin/puppet agent > +} > + > +stop() { > + service_stop /usr/bin/ruby /usr/bin/puppet agent > +} > Index: admin/puppet/files/etckeeper-commit-post > === > --- admin/puppet/files/etckeeper-commit-post(revision 0) > +++ admin/puppet/files/etckeeper-commit-post(working copy) > @@ -0,0 +1,10 @@ > +#!/bin/sh > + > +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin > + > +which etckeeper > /dev/null 2>&1 || exit 0 > + > +etckeeper commit "committing changes in /etc after puppet catalog run" > + > +# Failure of etckeeper should not be fatal. > +exit 0 > > Property changes on: admin/puppet/files/etckeeper-commit-post > ___ > Added: svn:executable > ## -0,0 +1 ## > +* > \ No newline at end of property > Index: admin/puppet/files/etckeeper-commit-pre > === > --- admin/puppet/files/etckeeper-commit-pre (revision 0) > +++ admin/puppet/files/etckeeper-commit-pre (working copy) > @@ -0,0 +1,10 @@ > +#!/bin/sh > + > +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin > + > +which etckeeper > /dev/null 2>&1 || exit 0 > + > +etckeeper commit "saving uncommitted changes in /etc prior to puppet > catalog run" > + > +# Failure of etckeeper should not be fatal. > +exit 0 > > Property changes on: admin/puppet/files/etckeeper-commit-pre > ___ > Added: svn:executable > ## -0,0 +1 ## > +* > \ No newline at end of property > Index: admin/puppet/files/puppet.conf > === > --- admin/puppet/files/puppet.conf (revision 0) > +++ admin/puppet/files/puppet.conf (working copy) > @@ -0,0 +1,17 @@ > +[main] > +# Careful as /var is ephemeral on OpenWrt. > +logdir=/var/log/puppet > +vardir=/etc/puppet > +ssldir=/etc/puppet/ssl > +rundir=/var/run/puppet > +factpath=$vardir/lib/facter > +templatedir=$confdir/templates > +prerun_command=/etc/puppet/etckeeper-commit-pre > +postrun_command=/etc/puppet/etckeeper-commit-post > + > +[master] > +# These are needed when the puppetmaster is run by passenger > +# and can safely be removed if webrick is used. > +ssl_client_header = SSL_CLIENT_S_DN > +ssl_client_verify_header = SSL_CLIENT_VERIFY > + > Index: admin/puppet/Makefile > === > --- admin/puppet/Makefile (revision 0) > +++ admin/puppet/Makefile (working copy) > @@ -0,0 +1,98 @@ > +# > +# Copyright (C) 2013 OpenWrt.org > +# > +# This is free software, licensed under the GNU General Public License v2. > +# See /LICENSE for more information. > +# > + > +include $(TOPDIR)/rules.mk > + > +PKG_NAME:=puppet > +PKG_VERSION:=3.2.1 > +PKG_RELEASE:=1 > + > +PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz > +PKG_SOURCE_URL:=http://downloads.puppetlabs.com/puppet/ > +PKG_MD5SUM:=a9bce4fe7a68aebcb6e97256e7faac5b > + > +include $(INCLUDE_DIR)/package.mk > + > +define Package/puppet > + SECTION:=admin > + CATEGORY:=Administration > + DEPENDS:= +libruby +ruby-core +ruby-enc +facter +ruby-yaml +ruby-gems > +ruby-cgi +ruby-openssl +shadow-useradd +ruby-xmlrpc \ > ++shadow-useradd +shadow-userdel +shadow-usermod > +shadow-groups +shadow-groupmod +shadow-groupdel +shadow-groupadd > +shadow-chage +net-tools-hostname > + > + TITLE:=Centralized configuration management > + URL:=http://projects.puppetlabs.com/projects/puppet > +endef > + > +define Package/puppet/description > + Puppet lets you centrally manage every important aspect of your system > + using a cross-platform specification language that manages all the > + separate elements normally aggregated in different files, like users, > + cron jobs, and hosts, along with obviously discrete elements like > + packages, services, and files. > + > + Puppet's simple declarative specification language provides powerful > + classing abilities for drawing out the similarities between hosts while > + allowing them to be as specific as necessary, and it handles dependency > + and prerequisite relationships between objects cle
Re: [OpenWrt-Devel] failsafe ping works but
* Shabbir Ahmed [06.06.2013 12:43]: > Hi, my tp-link after upgrade if i assign ip address to vlan it say invalid > interface, but it works under failsafe mode i upgraded the os from there. Which model? which OpenWrt-revision? bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] failsafe ping works but
Hi, my tp-link after upgrade if i assign ip address to vlan it say invalid interface, but it works under failsafe mode i upgraded the os from there. kindly help ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel