This regression was introduced in
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
routing.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/routing.c b/routing.c
index 3a3cfb8..7ca4b42 100644
@@ -1232,7 +1232,7 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
- /* packet needs to be linearised to access the TT changes records */
+ /* packet needs to be linearised to access the TT changes */
if (skb_linearize(skb) < 0)
I know bridging is not routing but I was thinking since some time if it
is possible to modify the linux bridge-code for forwarding layer2
packets according to the rules of some routing algorithm. This means the
bridge would not learn mac addresses from ARP protocol any longer but
from a daemon. The result would be a layer2 mesh routing like BATMAN does.
OLSR is doing quite the same one layer above by manipulating the routing
table with the OLSR daemon. Of course it's much easier to manipulate a
routing table because there are interfaces for doing this.
It's just an idea and I would like to hear your expert opinions.
In recv_tt_query(), in case of error the skb is freed and then
NET_RX_DROP is returned. This makes the caller function wrongly invoke
kfree_skb() again. To avoid this double free recv_tt_query() has to
always return NET_RX_DROP and not to free the skb.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
routing.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/routing.c b/routing.c
index 3a3cfb8..fc8eb87 100644
@@ -1194,7 +1194,6 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct tt_query_packet *tt_query;
struct ethhdr *ethhdr;
- int ret = NET_RX_DROP;
/* drop packet if it has not necessary minimum size */
if (unlikely(!pskb_may_pull(skb, sizeof(struct tt_query_packet))))
@@ -1248,11 +1247,11 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
- ret = NET_RX_SUCCESS;
- return ret;
+ /* returning NET_RX_DROP will make the caller function to kfree the
+ * skb */
+ return NET_RX_DROP;
int recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
count_real_packets() in batman-adv assumes char is signed, and returns -1
net/batman-adv/routing.c: In function 'receive_bat_packet':
net/batman-adv/routing.c:739: warning: comparison is always false due to limited range of data type
Use int instead.
This is also looks a bit weird as (presumably signed) is_duplicate is
constructed by OR'ding together the unsigned results of get_bit_status()
(though the latter only returns 0 or 1).
Signed-off-by: David Howells <dhowells(a)redhat.com>
cc: Marek Lindner <lindner_marek(a)yahoo.de>
cc: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
cc: Sven Eckelmann <sven(a)narfation.org>
net/batman-adv/routing.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index bb1c3ec..3075fcb 100644
@@ -531,15 +531,15 @@ static int window_protected(struct bat_priv *bat_priv,
* -1 the packet is old and has been received while the seqno window
* was protected. Caller should drop it.
-static char count_real_packets(struct ethhdr *ethhdr,
- struct batman_packet *batman_packet,
- struct hard_iface *if_incoming)
+static int count_real_packets(struct ethhdr *ethhdr,
+ struct batman_packet *batman_packet,
+ struct hard_iface *if_incoming)
struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
struct orig_node *orig_node;
struct neigh_node *tmp_neigh_node;
struct hlist_node *node;
- char is_duplicate = 0;
+ uint8_t is_duplicate = 0;
int need_update = 0;
int set_mark, ret = -1;
@@ -608,7 +608,7 @@ void receive_bat_packet(struct ethhdr *ethhdr,
char is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0;
char is_broadcast = 0, is_bidirectional, is_single_hop_neigh;
- char is_duplicate;
+ int is_duplicate;
/* Silently drop when the batman packet is actually not a
just looked a little bit closer at your tt_query implementation and was
reminded that we had a small discussion in IRC some weeks ago.
<ecsv> can those flags be mixed?
<ordex> mixed? in which way?
<ecsv> request | table -> still a valid package
<ecsv> sry, packet
<ordex> yes it is, because it means "I'm requesting a full table"
<ordex> all the combinations are valid
This sounds wrong when I look at the tt_query packet. There we have a tt_data
field which can used used exclusive by either TT_REQUEST (x)or TT_RESPONSE.
Therefore, it is not possible to use both flags at the same time. Can you
please explain how this is handled or otherwise change it so that only one bit
in flags is used to decide if it is an response or a request.
Maybe this was the result of the discussion with Marek about the roaming stuff
- but i don't think that it applies here.
Three new features have been added:
1) generic uevent support
2) uevent triggering for gw state changes
3) gw propagation for clients
- 1/3: a wrapper function that permits to trigger uevents has been added.
The function takes a "type", an "action" and a "data" as parameters which
will be used as uevent attributes. In particular they will respectively be
BATTYPE, BATACTION and BATDATA in the uevent environment.
The "type" and the "action" field are managed using two enum definitions and
two char arrais. Currently the supported "type" is 'gw' only and the supported
"actions" are 'add', 'change' and 'del'. The "data" parameter is a free field
which can be filled by the programmer to send any useful data to the userspace.
Uevents can be seen in userspace with the following command:
"$ udevadm monitor --property"
- 2/3: on a gateway add/change/del event a corresponding uevent of type 'gw' is
triggered. In particular, in case of setting up a gw for the first time a
uevent with action 'add' is triggered. In case of changing the best gateway a
uevent with action 'change' is triggered. In case of deselection of any gateway
a uevent with action DEL is triggered.
- 3/3: a gw propagation feature for clients has been provided. The main target
of this patch is to make clients able to change L3 gateway as soon as the mesh
node currently serving them changes its default one at the batman layer.
For this target a passive approach has been followed: whenever a unicast
DHCPREQUEST for renewal is sent from a client, the node will inspect it and
check if it is directed to the current default gateway or not. If it is not
the case then the packet is dropped. In this way the client will get a
timeout and a new DHCPREQUEST for discover will be sent giving the possibility
to the node to select the best gw to forward this packet to (current gw