From: Antonio Quartulli <antonio(a)open-mesh.com>
the sequence number is not stored in struct neigh_node,
therefore there is no need to pass such value to the
neigh_node creation procedure.
At the moment the value is only used by a debug message, but
given the fact that the seqno is not related to the neighbor
object, it is better to print it elsewhere.
Signed-off-by: Antonio Quartulli <antonio(a)open-mesh.com>
---
do we really want to pass the seqno over every function just to print it at the
end? If this value is really important (debug? don't know) it should be printed
in a proper place, e.g. in the function that triggered the creation and that
possibly has the seqno for other purposes...
Otherwise we would not be able to create a neigh_nod unless we have a seqno to
pass.
Cheers,
bat_iv_ogm.c | 11 ++++-------
originator.c | 5 ++---
originator.h | 2 +-
3 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 071f288..da239c5 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -33,12 +33,11 @@ static struct batadv_neigh_node *
batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface,
const uint8_t *neigh_addr,
struct batadv_orig_node *orig_node,
- struct batadv_orig_node *orig_neigh, __be32 seqno)
+ struct batadv_orig_node *orig_neigh)
{
struct batadv_neigh_node *neigh_node;
- neigh_node = batadv_neigh_node_new(hard_iface, neigh_addr,
- ntohl(seqno));
+ neigh_node = batadv_neigh_node_new(hard_iface, neigh_addr);
if (!neigh_node)
goto out;
@@ -696,8 +695,7 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
neigh_node = batadv_iv_ogm_neigh_new(if_incoming,
ethhdr->h_source,
- orig_node, orig_tmp,
- batadv_ogm_packet->seqno);
+ orig_node, orig_tmp);
batadv_orig_node_free_ref(orig_tmp);
if (!neigh_node)
@@ -829,8 +827,7 @@ static int batadv_iv_ogm_calc_tq(struct batadv_orig_node *orig_node,
neigh_node = batadv_iv_ogm_neigh_new(if_incoming,
orig_neigh_node->orig,
orig_neigh_node,
- orig_neigh_node,
- batadv_ogm_packet->seqno);
+ orig_neigh_node);
if (!neigh_node)
goto out;
diff --git a/originator.c b/originator.c
index 2f34525..ddd417c 100644
--- a/originator.c
+++ b/originator.c
@@ -92,7 +92,7 @@ batadv_orig_node_get_router(struct batadv_orig_node *orig_node)
struct batadv_neigh_node *
batadv_neigh_node_new(struct batadv_hard_iface *hard_iface,
- const uint8_t *neigh_addr, uint32_t seqno)
+ const uint8_t *neigh_addr)
{
struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
struct batadv_neigh_node *neigh_node;
@@ -110,8 +110,7 @@ batadv_neigh_node_new(struct batadv_hard_iface *hard_iface,
atomic_set(&neigh_node->refcount, 2);
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
- "Creating new neighbor %pM, initial seqno %d\n",
- neigh_addr, seqno);
+ "Creating new neighbor %pM\n", neigh_addr);
out:
return neigh_node;
diff --git a/originator.h b/originator.h
index 7df48fa..476c623 100644
--- a/originator.h
+++ b/originator.h
@@ -30,7 +30,7 @@ struct batadv_orig_node *batadv_get_orig_node(struct batadv_priv *bat_priv,
const uint8_t *addr);
struct batadv_neigh_node *
batadv_neigh_node_new(struct batadv_hard_iface *hard_iface,
- const uint8_t *neigh_addr, uint32_t seqno);
+ const uint8_t *neigh_addr);
void batadv_neigh_node_free_ref(struct batadv_neigh_node *neigh_node);
struct batadv_neigh_node *
batadv_orig_node_get_router(struct batadv_orig_node *orig_node);
--
1.8.1.5
From: Antonio Quartulli <antonio(a)open-mesh.com>
every batman-adv encapsulated packet is supposed to begin
with an Ethernet header plus 2 bytes for correct alignment
on 4 bytes boundary.
However, even if allocations are made correctly, the final
encapsulation is not made properly since the encapsulating
function does not push NET_IP_ALIGN bytes other than
ETH_HLEN.
Fix it by pushing the correct amount of bytes.
Introduced by 7f91790974c258e71a62f6dee8cb1dbe5dff36c3
("batman-adv: Reserve extra bytes in skb for better alignment")
Signed-off-by: Antonio Quartulli <antonio(a)open-mesh.com>
---
Please review this patch as I am not 100% sure this is correct.
What I understood is that any batman-adv should have this shape:
+--------------+
| ETH_HEADER |
| |
+--------------+
| NET_IP_ALIGN |
+--------------+
| BATADV_HEADER|
+--------------+
| ... |
but by pushing ETH_HLEN only, we end up in a shorter packet, because the head
pointer is not moved up enough to contain the NET_IP_ALIGN bytes too (so we are
back to the situation where our headers are not properly placed in memory).
Cheers,
send.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/send.c b/send.c
index a67cffd..a338093 100644
--- a/send.c
+++ b/send.c
@@ -54,7 +54,7 @@ int batadv_send_skb_packet(struct sk_buff *skb,
}
/* push to the ethernet header. */
- if (batadv_skb_head_push(skb, ETH_HLEN) < 0)
+ if (batadv_skb_head_push(skb, ETH_HLEN + NET_IP_ALIGN) < 0)
goto send_skb_err;
skb_reset_mac_header(skb);
--
1.8.1.5
tags 703540 + pending patch
thanks
On Wednesday 20 March 2013 17:51:54 you wrote:
> While building the package using our research compiler infrastructure we
> noticed conflicting types being used in the linked executable. This is due
> to _GNU_SOURCE being defined in linux/route.c and posix/unix_socket.c, but
> not in any other file. As a result, system headers expand to conflicting
> declarations. (This was at least noticed for the sendto function, but may
> extend to others.)
>
> Either all or no file should #define _GNU_SOURCE.
Please add information how to reproduce this the next time you are adding such
such a bug. Now I can just assume what you are writing is true (even when the
man page about sendto says otherwise). Not knowing how to reproduce it in the
best possible way just makes it harder for everyone to check the impact of the
problem.
I've forwarded it to the upstream maintainer and attached the change for
Debian.
Kind regards,
Sven