[B.A.T.M.A.N.] [PATCH] batman-adv: unset the TT_CLIENT_PENDING flag if the new local entry already exists
by Antonio Quartulli
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
8 years, 9 months
[B.A.T.M.A.N.] batman openwrt
by Gioacchino Mazzurco
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?
8 years, 10 months
[B.A.T.M.A.N.] pull request: batman-adv 2012-02-28
by Marek Lindner
Hi David,
here comes the second set of patches I'd like to see pulled into
net-next-2.6/3.4. It mostly contains code cleanups, some code
refactoring work and a minor fix. Let me know if there any problems.
Thanks,
Marek
The following changes since commit ea3d2fd1b11fb3ef8706a48ece0a49a61bcd08bc:
batman-adv: export used routing algorithm via sysfs (2012-02-17 02:50:20 +0800)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git batman-adv-for-davem
or older git versions:
git://git.open-mesh.org/linux-merge.git tags/batman-adv-for-davem
for you to fetch changes up to 7c64fd98ce512de6c6dae0452dc026446bd368d5:
batman-adv: Fix indentation of multiline statements (2012-02-28 19:14:31 +0800)
----------------------------------------------------------------
code cleanups and code refactoring
----------------------------------------------------------------
Antonio Quartulli (3):
batman-adv: set TT_CLIENT_NEW flag before invoking hash_add()
batman-adv: code refactoring - move debug print into tt_local_set_pending
batman-adv: TT_CLIENT_PENDING is never set in struct tt_global_entry
Marek Lindner (1):
batman-adv: convert time_after instances to has_timed_out
Sven Eckelmann (4):
batman-adv: refactor tt_global_del() to avoid misalignment
batman-adv: Update copyright years
batman-adv: Start new development cycle
batman-adv: Fix indentation of multiline statements
net/batman-adv/Makefile | 2 +-
net/batman-adv/bat_algo.h | 2 +-
net/batman-adv/bat_debugfs.c | 2 +-
net/batman-adv/bat_debugfs.h | 2 +-
net/batman-adv/bat_iv_ogm.c | 2 +-
net/batman-adv/bat_sysfs.c | 6 +-
net/batman-adv/bat_sysfs.h | 2 +-
net/batman-adv/bitarray.c | 10 ++--
net/batman-adv/bitarray.h | 2 +-
net/batman-adv/gateway_client.c | 6 +-
net/batman-adv/gateway_client.h | 2 +-
net/batman-adv/gateway_common.c | 6 +-
net/batman-adv/gateway_common.h | 2 +-
net/batman-adv/hard-interface.c | 32 +++++-----
net/batman-adv/hard-interface.h | 2 +-
net/batman-adv/hash.c | 2 +-
net/batman-adv/hash.h | 2 +-
net/batman-adv/icmp_socket.c | 2 +-
net/batman-adv/icmp_socket.h | 2 +-
net/batman-adv/main.c | 2 +-
net/batman-adv/main.h | 17 +++---
net/batman-adv/originator.c | 18 ++---
net/batman-adv/originator.h | 2 +-
net/batman-adv/packet.h | 2 +-
net/batman-adv/ring_buffer.c | 2 +-
net/batman-adv/ring_buffer.h | 2 +-
net/batman-adv/routing.c | 13 ++--
net/batman-adv/routing.h | 2 +-
net/batman-adv/send.c | 2 +-
net/batman-adv/send.h | 2 +-
net/batman-adv/soft-interface.c | 6 +-
net/batman-adv/soft-interface.h | 2 +-
net/batman-adv/translation-table.c | 119 ++++++++++++++++-------------------
net/batman-adv/translation-table.h | 2 +-
net/batman-adv/types.h | 2 +-
net/batman-adv/unicast.c | 2 +-
net/batman-adv/unicast.h | 2 +-
net/batman-adv/vis.c | 5 +-
net/batman-adv/vis.h | 5 +-
39 files changed, 141 insertions(+), 156 deletions(-)
8 years, 10 months
[B.A.T.M.A.N.] [PATCH] batman-adv: Fix indentation of multiline statements
by Sven Eckelmann
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
This patch is for *next*
bat_sysfs.c | 4 ++--
bitarray.c | 8 ++++----
gateway_client.c | 2 +-
gateway_common.c | 4 ++--
hard-interface.c | 30 +++++++++++++++---------------
originator.c | 5 ++---
routing.c | 8 ++++----
soft-interface.c | 2 +-
translation-table.c | 26 +++++++++++++-------------
9 files changed, 44 insertions(+), 45 deletions(-)
diff --git a/bat_sysfs.c b/bat_sysfs.c
index 7317729..b00101d 100644
--- a/bat_sysfs.c
+++ b/bat_sysfs.c
@@ -321,11 +321,11 @@ static ssize_t store_gw_mode(struct kobject *kobj, struct attribute *attr,
gw_mode_tmp = GW_MODE_OFF;
if (strncmp(buff, GW_MODE_CLIENT_NAME,
- strlen(GW_MODE_CLIENT_NAME)) == 0)
+ strlen(GW_MODE_CLIENT_NAME)) == 0)
gw_mode_tmp = GW_MODE_CLIENT;
if (strncmp(buff, GW_MODE_SERVER_NAME,
- strlen(GW_MODE_SERVER_NAME)) == 0)
+ strlen(GW_MODE_SERVER_NAME)) == 0)
gw_mode_tmp = GW_MODE_SERVER;
if (gw_mode_tmp < 0) {
diff --git a/bitarray.c b/bitarray.c
index e63069d..6d0aa21 100644
--- a/bitarray.c
+++ b/bitarray.c
@@ -154,8 +154,8 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
/* sequence number is much newer, probably missed a lot of packets */
- if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE)
- && (seq_num_diff < EXPECTED_SEQNO_RANGE)) {
+ if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE) &&
+ (seq_num_diff < EXPECTED_SEQNO_RANGE)) {
bat_dbg(DBG_BATMAN, bat_priv,
"We missed a lot of packets (%i) !\n",
seq_num_diff - 1);
@@ -170,8 +170,8 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
* packet should be dropped without calling this function if the
* seqno window is protected. */
- if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE)
- || (seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
+ if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
+ (seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
bat_dbg(DBG_BATMAN, bat_priv,
"Other host probably restarted!\n");
diff --git a/gateway_client.c b/gateway_client.c
index 65a77a1..0fa8e2d 100644
--- a/gateway_client.c
+++ b/gateway_client.c
@@ -629,7 +629,7 @@ bool gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len)
/* check for bootp port */
if ((ntohs(ethhdr->h_proto) == ETH_P_IP) &&
- (ntohs(udphdr->dest) != 67))
+ (ntohs(udphdr->dest) != 67))
return false;
if ((ntohs(ethhdr->h_proto) == ETH_P_IPV6) &&
diff --git a/gateway_common.c b/gateway_common.c
index 7f79e15..3ccb9c8 100644
--- a/gateway_common.c
+++ b/gateway_common.c
@@ -93,7 +93,7 @@ static bool parse_gw_bandwidth(struct net_device *net_dev, char *buff,
multi = 1024;
if ((strnicmp(tmp_ptr, "kbit", 4) == 0) ||
- (multi > 1))
+ (multi > 1))
*tmp_ptr = '\0';
}
@@ -118,7 +118,7 @@ static bool parse_gw_bandwidth(struct net_device *net_dev, char *buff,
multi = 1024;
if ((strnicmp(tmp_ptr, "kbit", 4) == 0) ||
- (multi > 1))
+ (multi > 1))
*tmp_ptr = '\0';
}
diff --git a/hard-interface.c b/hard-interface.c
index 41826b9..409d027 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -341,23 +341,23 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
ETH_DATA_LEN + BAT_HEADER_LEN)
bat_info(hard_iface->soft_iface,
- "The MTU of interface %s is too small (%i) to handle "
- "the transport of batman-adv packets. Packets going "
- "over this interface will be fragmented on layer2 "
- "which could impact the performance. Setting the MTU "
- "to %zi would solve the problem.\n",
- hard_iface->net_dev->name, hard_iface->net_dev->mtu,
- ETH_DATA_LEN + BAT_HEADER_LEN);
+ "The MTU of interface %s is too small (%i) to handle "
+ "the transport of batman-adv packets. Packets going "
+ "over this interface will be fragmented on layer2 "
+ "which could impact the performance. Setting the MTU "
+ "to %zi would solve the problem.\n",
+ hard_iface->net_dev->name, hard_iface->net_dev->mtu,
+ ETH_DATA_LEN + BAT_HEADER_LEN);
if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
ETH_DATA_LEN + BAT_HEADER_LEN)
bat_info(hard_iface->soft_iface,
- "The MTU of interface %s is too small (%i) to handle "
- "the transport of batman-adv packets. If you experience"
- " problems getting traffic through try increasing the "
- "MTU to %zi.\n",
- hard_iface->net_dev->name, hard_iface->net_dev->mtu,
- ETH_DATA_LEN + BAT_HEADER_LEN);
+ "The MTU of interface %s is too small (%i) to handle "
+ "the transport of batman-adv packets. If you "
+ "experience problems getting traffic through try "
+ "increasing the MTU to %zi.\n",
+ hard_iface->net_dev->name, hard_iface->net_dev->mtu,
+ ETH_DATA_LEN + BAT_HEADER_LEN);
if (hardif_is_iface_up(hard_iface))
hardif_activate_interface(hard_iface);
@@ -580,8 +580,8 @@ static int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
goto err_free;
/* expect a valid ethernet header here. */
- if (unlikely(skb->mac_len != sizeof(struct ethhdr)
- || !skb_mac_header(skb)))
+ if (unlikely(skb->mac_len != sizeof(struct ethhdr) ||
+ !skb_mac_header(skb)))
goto err_free;
if (!hard_iface->soft_iface)
diff --git a/originator.c b/originator.c
index c2e46b5..371cc93 100644
--- a/originator.c
+++ b/originator.c
@@ -143,7 +143,7 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
frag_list_free(&orig_node->frag_list);
tt_global_del_orig(orig_node->bat_priv, orig_node,
- "originator timed out");
+ "originator timed out");
kfree(orig_node->tt_buff);
kfree(orig_node->bcast_own);
@@ -333,9 +333,8 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
return true;
} else {
if (purge_orig_neighbors(bat_priv, orig_node,
- &best_neigh_node)) {
+ &best_neigh_node))
update_route(bat_priv, orig_node, best_neigh_node);
- }
}
return false;
diff --git a/routing.c b/routing.c
index cf9a2f6..f535155 100644
--- a/routing.c
+++ b/routing.c
@@ -72,7 +72,7 @@ static void _update_route(struct bat_priv *bat_priv,
bat_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n",
orig_node->orig);
tt_global_del_orig(bat_priv, orig_node,
- "Deleted route towards originator");
+ "Deleted route towards originator");
/* route added */
} else if ((!curr_router) && (neigh_node)) {
@@ -229,8 +229,8 @@ void bonding_save_primary(const struct orig_node *orig_node,
int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
unsigned long *last_reset)
{
- if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE)
- || (seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
+ if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
+ (seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
if (has_timed_out(*last_reset, RESET_PROTECTION_MS)) {
*last_reset = jiffies;
@@ -429,7 +429,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
if ((hdr_size == sizeof(struct icmp_packet_rr)) &&
(icmp_packet->rr_cur < BAT_RR_LEN)) {
memcpy(&(icmp_packet->rr[icmp_packet->rr_cur]),
- ethhdr->h_dest, ETH_ALEN);
+ ethhdr->h_dest, ETH_ALEN);
icmp_packet->rr_cur++;
}
diff --git a/soft-interface.c b/soft-interface.c
index 37fbcb5..8fb16d2 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -397,7 +397,7 @@ void softif_neigh_purge(struct bat_priv *bat_priv)
&softif_neigh_vid->softif_neigh_list,
list) {
if ((!has_timed_out(softif_neigh->last_seen,
- SOFTIF_NEIGH_TIMEOUT)) &&
+ SOFTIF_NEIGH_TIMEOUT)) &&
(atomic_read(&bat_priv->mesh_state) == MESH_ACTIVE))
continue;
diff --git a/translation-table.c b/translation-table.c
index 9a6f315..c950705 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -261,7 +261,7 @@ int tt_changes_fill_buffer(struct bat_priv *bat_priv,
atomic_set(&bat_priv->tt_local_changes, 0);
list_for_each_entry_safe(entry, safe, &bat_priv->tt_changes_list,
- list) {
+ list) {
if (count < tot_changes) {
memcpy(buff + tt_len(count),
&entry->change, sizeof(struct tt_change));
@@ -333,17 +333,17 @@ int tt_local_seq_print_text(struct seq_file *seq, void *offset)
hlist_for_each_entry_rcu(tt_common_entry, node,
head, hash_entry) {
seq_printf(seq, " * %pM [%c%c%c%c%c]\n",
- tt_common_entry->addr,
- (tt_common_entry->flags &
- TT_CLIENT_ROAM ? 'R' : '.'),
- (tt_common_entry->flags &
- TT_CLIENT_NOPURGE ? 'P' : '.'),
- (tt_common_entry->flags &
- TT_CLIENT_NEW ? 'N' : '.'),
- (tt_common_entry->flags &
- TT_CLIENT_PENDING ? 'X' : '.'),
- (tt_common_entry->flags &
- TT_CLIENT_WIFI ? 'W' : '.'));
+ tt_common_entry->addr,
+ (tt_common_entry->flags &
+ TT_CLIENT_ROAM ? 'R' : '.'),
+ (tt_common_entry->flags &
+ TT_CLIENT_NOPURGE ? 'P' : '.'),
+ (tt_common_entry->flags &
+ TT_CLIENT_NEW ? 'N' : '.'),
+ (tt_common_entry->flags &
+ TT_CLIENT_PENDING ? 'X' : '.'),
+ (tt_common_entry->flags &
+ TT_CLIENT_WIFI ? 'W' : '.'));
}
rcu_read_unlock();
}
@@ -704,7 +704,7 @@ void tt_global_del_orig(struct bat_priv *bat_priv,
spin_lock_bh(list_lock);
hlist_for_each_entry_safe(tt_common_entry, node, safe,
- head, hash_entry) {
+ head, hash_entry) {
tt_global_entry = container_of(tt_common_entry,
struct tt_global_entry,
common);
--
1.7.9
8 years, 10 months
[B.A.T.M.A.N.] Fwd: /lib/batman-adv/config.sh
by Filippo Sallemi
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
8 years, 10 months
[B.A.T.M.A.N.] [PATCH] batctl: add support for DBG_DAT log level
by Antonio Quartulli
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
8 years, 10 months
[B.A.T.M.A.N.] [PATCH] batctl: update README and man with bla loglevel information
by Antonio Quartulli
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
8 years, 10 months
[B.A.T.M.A.N.] [PATCH] batctl: fix 'all' loglevel
by Antonio Quartulli
After having added the "bla" log level, the numeric value for "all" is now 15,
not 7.
Reported-by: Marek Lindner <lindner_marek(a)yahoo.de>
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
sys.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sys.c b/sys.c
index 0b7ddf7..0b4cac3 100644
--- a/sys.c
+++ b/sys.c
@@ -214,7 +214,7 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
log_level = 0;
break;
} else if (strcmp(argv[i], "all") == 0) {
- log_level = 7;
+ log_level = 15;
break;
} else if (strcmp(argv[i], "batman") == 0)
log_level |= (1 << 0);
--
1.7.3.4
8 years, 10 months
[B.A.T.M.A.N.] [PATCH] batman-adv: remove unused variable
by Antonio Quartulli
Actually unicast_4addr_packet in interface_rx() is set but never used and
therefore can be safely be removed.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
soft-interface.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/soft-interface.c b/soft-interface.c
index 8b68e01..92137af 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -259,7 +259,6 @@ void interface_rx(struct net_device *soft_iface,
int hdr_size)
{
struct bat_priv *bat_priv = netdev_priv(soft_iface);
- struct unicast_4addr_packet *unicast_4addr_packet;
struct ethhdr *ethhdr;
struct vlan_ethhdr *vhdr;
short vid __maybe_unused = -1;
@@ -268,8 +267,6 @@ void interface_rx(struct net_device *soft_iface,
if (!pskb_may_pull(skb, hdr_size))
goto dropped;
- unicast_4addr_packet = (struct unicast_4addr_packet *)skb->data;
-
if (dat_snoop_incoming_arp_request(bat_priv, skb, hdr_size))
goto out;
--
1.7.3.4
8 years, 10 months
[B.A.T.M.A.N.] [PATCH] batman-adv: fix wrong dhcp option list browsing
by Antonio Quartulli
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
8 years, 10 months