When trying to add a new tt_local_entry, if such entry already exists, we have
to ensure that the TT_CLIENT_PENDING flag is not set, otherwise the entry will
be deleted soon.
Reported-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
translation-table.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/translation-table.c b/translation-table.c
index 27753a0..65de6b7 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -188,6 +188,8 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
if (tt_local_entry) {
tt_local_entry->last_seen = jiffies;
+ /* possibly unset the TT_CLIENT_PENDING flag */
+ tt_local_entry->common.flags &= ~TT_CLIENT_PENDING;
goto out;
}
--
1.7.3.4
Hi!
After upgrading to latest batman version on openwt batman stopped adding
ethernet or bridge interfaces at start...
it add only wireless interfaces
I am using backfire for the core and trunk for packages the problem is related
to that?
Ok in this email my proposal patch.
I've to sleep 4s if you have an ap + adhoc vifs.
[ "$(echo $interface | awk '$0 ~ /^wlan[0-9]*/')" ] && sleep 4s
For convenience I sleep only if an wlan was triggered. If you have
only one interface in adhoc mode per radio 3 seconds are enought.
bye
---------- Messaggio inoltrato ----------
Da: Marek Lindner <lindner_marek(a)yahoo.de>
Date: 11 febbraio 2012 11:08
Oggetto: Re: /lib/batman-adv/config.sh
A: Filippo Sallemi <tonyputi(a)gmail.com>
On Friday, February 10, 2012 01:21:21 you wrote:
> > Yeah - looks good.
> > I still don't get why we don't need to wait 3/5 seconds anymore. Can you
> > explain this ?
>
> No i'm wrong we need to wait 3 seconds... i think that the sleep call
> could be moved to hotplug.d/99-batman-adv when an interface is added
> to mesh interface.
> I need some time.
Ok - I left the "sleep 3s" in the file. I applied your config_bat/bat_config
as well as the forgotten ap_isolation config fix.
Since the for loop does not fix the wait problem why do you wish to change it?
I am referring to your suggested change:
# Load network config here just in case!
config_load network
for iface in $interfaces; do
# copy iface into ifname
local ifname=$iface
[ -f "/sys/class/net/$ifname/batman_adv/mesh_iface" ] || {
# if ifname was not found try to find it via uci config
config_get ifname $iface ifname
[ -f "/sys/class/net/$ifname/batman_adv/mesh_iface" ] ||
continue
}
[ "$ifname" = "$interface" ] && echo $mesh >
/sys/class/net/$ifname/batman_adv/mesh_iface
done
bat_add_interface() and bat_del_interface() have the same loop but we only
change one ? The only difference I can see is another added variable and not
calling "uci -q -P/var/state get network.$iface.ifname". Why ?
Cheers,
Marek
--
Filippo Sallemi
This patch add the related options in order to support the DBG_DAT log level.
README and mas are updated accordingly.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
This patch is based on:
[PATCH] batctl: fix 'all' loglevel
README | 1 +
man/batctl.8 | 2 +-
sys.c | 7 ++++++-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/README b/README
index 64ee152..0fe192f 100644
--- a/README
+++ b/README
@@ -301,6 +301,7 @@ $ batctl loglevel
[ ] messages related to route added / changed / deleted (routes)
[ ] messages related to translation table operations (tt)
[ ] messages related to bridge loop avoidance (bla)
+[ ] messages related to the distributed arp table (dat)
batctl aggregation
==================
diff --git a/man/batctl.8 b/man/batctl.8
index 5cc37cb..036412b 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -65,7 +65,7 @@ Once started batctl will display the list of announced gateways in the network.
If no parameter is given the current originator interval setting is displayed otherwise the parameter is used to set the originator interval. The interval is in units of milliseconds.
.br
.IP "\fBloglevel\fP|\fBll\fP [\fBlevel\fP[ \fBlevel\fP[ \fBlevel\fP]] \fB...\fP]"
-If no parameter is given the current log level settings are displayed otherwise the parameter(s) is/are used to set the log level. Level 'none' disables all verbose logging. Level 'batman' enables messages related to routing / flooding / broadcasting. Level 'routes' enables messages related to routes being added / changed / deleted. Level 'tt' enables messages related to translation table operations. Level 'bla' enables messages related to the bridge loop avoidance. Level 'all' enables all messages. The messages are sent to the batman-adv debug log. Use \fBbatctl log\fP to see them. Make sure to have debugging output enabled when compiling the module otherwise the output as well as the loglevel options won't be available.
+If no parameter is given the current log level settings are displayed otherwise the parameter(s) is/are used to set the log level. Level 'none' disables all verbose logging. Level 'batman' enables messages related to routing / flooding / broadcasting. Level 'routes' enables messages related to routes being added / changed / deleted. Level 'tt' enables messages related to translation table operations. Level 'bla' enables messages related to the bridge loop avoidance. Level 'dat' enables messages related to the distributed arp table (DHT messages, ARP snooping and other debug logs). Level 'all' enables all messages. The messages are sent to the batman-adv debug log. Use \fBbatctl log\fP to see them. Make sure to have debugging output enabled when compiling the module otherwise the output as well as the loglevel options won't be available.
.br
.IP "\fBlog\fP|\fBl\fP [\fB\-n\fP]\fP"
batctl will read the batman-adv debug log which has to be compiled into the kernel module. If "\-n" is given batctl will not replace the MAC addresses with bat\-host names in the output.
diff --git a/sys.c b/sys.c
index 0b4cac3..e0dcb07 100644
--- a/sys.c
+++ b/sys.c
@@ -184,6 +184,7 @@ static void log_level_usage(void)
printf(" \t routes Messages related to route added / changed / deleted\n");
printf(" \t tt Messages related to translation table operations\n");
printf(" \t bla Messages related to bridge loop avoidance\n");
+ printf(" \t dat Messages related to the distributed arp table\n");
}
int handle_loglevel(char *mesh_iface, int argc, char **argv)
@@ -214,7 +215,7 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
log_level = 0;
break;
} else if (strcmp(argv[i], "all") == 0) {
- log_level = 15;
+ log_level = 31;
break;
} else if (strcmp(argv[i], "batman") == 0)
log_level |= (1 << 0);
@@ -224,6 +225,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
log_level |= (1 << 2);
else if (strcmp(argv[i], "bla") == 0)
log_level |= (1 << 3);
+ else if (strcmp(argv[i], "dat") == 0)
+ log_level |= (1 << 4);
else {
log_level_usage();
goto out;
@@ -253,6 +256,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
"messages related to translation table operations", "tt");
printf("[%c] %s (%s)\n", (log_level & 8) ? 'x' : ' ',
"messages related to bridge loop avoidance", "bla");
+ printf("[%c] %s (%s)\n", (log_level & 16) ? 'x' : ' ',
+ "messages related to the distributed arp table", "arp");
out:
free(path_buff);
--
1.7.3.4
Both the README and the man page have to report the new loglevel information in
the corresponding section
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
README | 1 +
man/batctl.8 | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/README b/README
index da0ac68..64ee152 100644
--- a/README
+++ b/README
@@ -300,6 +300,7 @@ $ batctl loglevel
[ ] messages related to routing / flooding / broadcasting (batman)
[ ] messages related to route added / changed / deleted (routes)
[ ] messages related to translation table operations (tt)
+[ ] messages related to bridge loop avoidance (bla)
batctl aggregation
==================
diff --git a/man/batctl.8 b/man/batctl.8
index f45a070..5cc37cb 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -65,7 +65,7 @@ Once started batctl will display the list of announced gateways in the network.
If no parameter is given the current originator interval setting is displayed otherwise the parameter is used to set the originator interval. The interval is in units of milliseconds.
.br
.IP "\fBloglevel\fP|\fBll\fP [\fBlevel\fP[ \fBlevel\fP[ \fBlevel\fP]] \fB...\fP]"
-If no parameter is given the current log level settings are displayed otherwise the parameter(s) is/are used to set the log level. Level 'none' disables all verbose logging. Level 'batman' enables messages related to routing / flooding / broadcasting. Level 'routes' enables messages related to routes being added / changed / deleted. Level 'tt' enables messages related to translation table operations. Level 'all' enables all messages. The messages are sent to the batman-adv debug log. Use \fBbatctl log\fP to see them. Make sure to have debugging output enabled when compiling the module otherwise the output as well as the loglevel options won't be available.
+If no parameter is given the current log level settings are displayed otherwise the parameter(s) is/are used to set the log level. Level 'none' disables all verbose logging. Level 'batman' enables messages related to routing / flooding / broadcasting. Level 'routes' enables messages related to routes being added / changed / deleted. Level 'tt' enables messages related to translation table operations. Level 'bla' enables messages related to the bridge loop avoidance. Level 'all' enables all messages. The messages are sent to the batman-adv debug log. Use \fBbatctl log\fP to see them. Make sure to have debugging output enabled when compiling the module otherwise the output as well as the loglevel options won't be available.
.br
.IP "\fBlog\fP|\fBl\fP [\fB\-n\fP]\fP"
batctl will read the batman-adv debug log which has to be compiled into the kernel module. If "\-n" is given batctl will not replace the MAC addresses with bat\-host names in the output.
--
1.7.3.4
In is_type_dhcprequest(), while parsing a DHCP message, if the entry we found in
the option list is neither a padding nor the dhcp-type, we have to ignore it and
jump as many bytes as its length + 1. The "+ 1" byte is given by the subtype
field itself that has to be jumped too.
Reported-by: Marek Lindner <lindner_marek(a)yahoo.de>
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
gateway_client.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gateway_client.c b/gateway_client.c
index 65a77a1..1f7e92d 100644
--- a/gateway_client.c
+++ b/gateway_client.c
@@ -563,10 +563,10 @@ static bool is_type_dhcprequest(struct sk_buff *skb, int header_len)
p++;
/* ...and then we jump over the data */
- if (pkt_len < *p)
+ if (pkt_len < 1 + (*p))
goto out;
- pkt_len -= *p;
- p += (*p);
+ pkt_len -= 1 + (*p);
+ p += 1 + (*p);
}
}
out:
--
1.7.3.4