Author: marek Date: 2010-05-03 01:24:21 +0200 (Mon, 03 May 2010) New Revision: 1649
Modified: trunk/batman-adv-kernelland/originator.c Log: batman-adv: fix originator table output if no neighbor is in range
If no neighbor was in range the originator sysfs file would print nothing at all. Now it will print a message saying that no neighbors are in range.
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
Modified: trunk/batman-adv-kernelland/originator.c =================================================================== --- trunk/batman-adv-kernelland/originator.c 2010-05-02 22:45:33 UTC (rev 1648) +++ trunk/batman-adv-kernelland/originator.c 2010-05-02 23:24:21 UTC (rev 1649) @@ -296,23 +296,22 @@ unsigned long flags; char orig_str[ETH_STR_LEN], router_str[ETH_STR_LEN];
- if (!bat_priv->primary_if) { - if (off == 0) + if ((!bat_priv->primary_if) || + (bat_priv->primary_if->if_status != IF_ACTIVE)) { + if (off > 0) + return 0; + + if (!bat_priv->primary_if) return sprintf(buff, - "BATMAN mesh %s disabled - " - "please specify interfaces to enable it\n", - net_dev->name); + "BATMAN mesh %s disabled - " + "please specify interfaces to enable it\n", + net_dev->name);
- return 0; - } - - if (bat_priv->primary_if->if_status != IF_ACTIVE && off == 0) return sprintf(buff, "BATMAN mesh %s " "disabled - primary interface not active\n", net_dev->name); - else if (bat_priv->primary_if->if_status != IF_ACTIVE) - return 0; + }
rcu_read_lock(); hdr_len = sprintf(buff,