#19345: netifd: radio0: sh: bad number
-------------------------------+-----------------------------------------
  Reporter:  braveheart_leo@…  |      Owner:  developers
      Type:  defect            |     Status:  new
  Priority:  normal            |  Milestone:  Chaos Calmer (trunk)
 Component:  packages          |    Version:  Trunk
Resolution:                    |   Keywords:  netifd radio0 sh bad number
-------------------------------+-----------------------------------------

Comment (by hnyman):

 The other error is similar: "start_disabled" is used in a condition check,
 while it may have no value. The file in a live router is
 /lib/netifd/wireless/mac80211.sh  ( =
 
https://dev.openwrt.org/browser/trunk/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh#L308
 )
 {{{
 root@OpenWrt2:/lib/netifd# diff /rom/lib/netifd/wireless/mac80211.sh
 /lib/netifd/wireless/mac80211.sh
 --- /rom/lib/netifd/wireless/mac80211.sh
 +++ /lib/netifd/wireless/mac80211.sh
 @@ -318,10 +318,12 @@
         json_get_vars wds dtim_period max_listen_int start_disabled

         set_default wds 0
 +#      set_default start_disabled 0

         [ "$wds" -gt 0 ] && append hostapd_cfg "wds_sta=1" "$N"
 +echo staidx=$staidx start_disabled=$start_disabled
         [ "$staidx" -gt 0 -o "$start_disabled" -eq 1 ] && append
 hostapd_cfg "start_disabled=1" "$N"
 -
 +echo after
         cat >> /var/run/hostapd-$phy.conf <<EOF
  $hostapd_cfg
  bssid=$macaddr
 root@OpenWrt2:/lib/netifd# wifi up
 root@OpenWrt2:/lib/netifd# logread | tail -n 40
 Sat Apr 11 11:47:48 2015 daemon.notice netifd: Network device 'wlan1' link
 is down
 Sat Apr 11 11:47:49 2015 daemon.notice netifd: radio0 (13540): staidx=0
 start_disabled=
 Sat Apr 11 11:47:49 2015 daemon.notice netifd: radio0 (13540): sh: bad
 number
 Sat Apr 11 11:47:49 2015 daemon.notice netifd: radio0 (13540): after
 Sat Apr 11 11:47:49 2015 daemon.notice netifd: radio0 (13540):
 Configuration file: /var/run/hostapd-phy0.conf
 Sat Apr 11 11:47:49 2015 kern.info kernel: [61019.680000] IPv6:
 ADDRCONF(NETDEV_UP): wlan0: link is not ready
 Sat Apr 11 11:47:49 2015 kern.info kernel: [61019.740000] device wlan0
 entered promiscuous mode
 Sat Apr 11 11:47:49 2015 kern.info kernel: [61019.740000] br-lan: port
 2(wlan0) entered forwarding state
 Sat Apr 11 11:47:49 2015 kern.info kernel: [61019.750000] br-lan: port
 2(wlan0) entered forwarding state
 Sat Apr 11 11:47:49 2015 daemon.notice netifd: radio1 (13553): staidx=0
 start_disabled=
 Sat Apr 11 11:47:49 2015 daemon.notice netifd: radio1 (13553): sh: bad
 number
 Sat Apr 11 11:47:49 2015 daemon.notice netifd: radio1 (13553): after
 Sat Apr 11 11:47:49 2015 daemon.notice netifd: radio1 (13553):
 Configuration file: /var/run/hostapd-phy1.conf
 }}}

 If default value is added, the "bad number" error disappears:
 {{{
 root@OpenWrt2:/lib/netifd# diff /rom/lib/netifd/wireless/mac80211.sh
 /lib/netifd/wireless/mac80211.sh
 --- /rom/lib/netifd/wireless/mac80211.sh
 +++ /lib/netifd/wireless/mac80211.sh
 @@ -318,10 +318,12 @@
         json_get_vars wds dtim_period max_listen_int start_disabled

         set_default wds 0
 +       set_default start_disabled 0

         [ "$wds" -gt 0 ] && append hostapd_cfg "wds_sta=1" "$N"
 +echo staidx=$staidx start_disabled=$start_disabled
         [ "$staidx" -gt 0 -o "$start_disabled" -eq 1 ] && append
 hostapd_cfg "start_disabled=1" "$N"
 -
 +echo after
         cat >> /var/run/hostapd-$phy.conf <<EOF
  $hostapd_cfg
  bssid=$macaddr


 Sat Apr 11 11:50:08 2015 daemon.notice netifd: Network device 'wlan1' link
 is down
 Sat Apr 11 11:50:09 2015 daemon.notice netifd: radio0 (13852): staidx=0
 start_disabled=0
 Sat Apr 11 11:50:09 2015 daemon.notice netifd: radio0 (13852): after
 Sat Apr 11 11:50:09 2015 daemon.notice netifd: radio0 (13852):
 Configuration file: /var/run/hostapd-phy0.conf
 Sat Apr 11 11:50:09 2015 kern.info kernel: [61159.390000] IPv6:
 ADDRCONF(NETDEV_UP): wlan0: link is not ready
 Sat Apr 11 11:50:09 2015 kern.info kernel: [61159.440000] device wlan0
 entered promiscuous mode
 Sat Apr 11 11:50:09 2015 kern.info kernel: [61159.440000] br-lan: port
 2(wlan0) entered forwarding state
 Sat Apr 11 11:50:09 2015 kern.info kernel: [61159.450000] br-lan: port
 2(wlan0) entered forwarding state
 Sat Apr 11 11:50:09 2015 daemon.notice netifd: radio1 (13867): staidx=0
 start_disabled=0
 Sat Apr 11 11:50:09 2015 daemon.notice netifd: radio1 (13867): after
 Sat Apr 11 11:50:09 2015 daemon.notice netifd: radio1 (13867):
 Configuration file: /var/run/hostapd-phy1.conf
 }}}

 Ps. I tried adding that start_disabled option to my /etc/config/wireless,
 but did not succeed passing the value upto the the function. There may be
 some option declaration missing.

--
Ticket URL: <https://dev.openwrt.org/ticket/19345#comment:2>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to