[B.A.T.M.A.N.] [PATCH] batman-adv: only bloat with bla-structures if activated
by Simon Wunderlich
We don't have to bloat the batman internal structures if bla is not
configured. This patch adds a few ifdefs to do this.
Signed-off-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
---
types.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/types.h b/types.h
index 7f7f610..a5b1a63 100644
--- a/types.h
+++ b/types.h
@@ -140,11 +140,13 @@ struct neigh_node {
spinlock_t tq_lock; /* protects: tq_recv, tq_index */
};
+#ifdef CONFIG_BATMAN_ADV_BLA
struct bcast_duplist_entry {
uint8_t orig[ETH_ALEN];
uint16_t crc;
unsigned long entrytime;
};
+#endif
struct bat_priv {
atomic_t mesh_state;
@@ -186,14 +188,18 @@ struct bat_priv {
struct hashtable_t *orig_hash;
struct hashtable_t *tt_local_hash;
struct hashtable_t *tt_global_hash;
+#ifdef CONFIG_BATMAN_ADV_BLA
struct hashtable_t *claim_hash;
struct hashtable_t *backbone_hash;
+#endif
struct list_head tt_req_list; /* list of pending tt_requests */
struct list_head tt_roam_list;
struct hashtable_t *vis_hash;
+#ifdef CONFIG_BATMAN_ADV_BLA
struct bcast_duplist_entry bcast_duplist[DUPLIST_SIZE];
int bcast_duplist_curr;
struct bla_claim_dst claim_dest;
+#endif
spinlock_t forw_bat_list_lock; /* protects forw_bat_list */
spinlock_t forw_bcast_list_lock; /* protects */
spinlock_t tt_changes_list_lock; /* protects tt_changes */
@@ -261,6 +267,7 @@ struct tt_orig_list_entry {
struct hlist_node list;
};
+#ifdef CONFIG_BATMAN_ADV_BLA
struct backbone_gw {
uint8_t orig[ETH_ALEN];
short vid; /* used VLAN ID */
@@ -282,6 +289,7 @@ struct claim {
atomic_t refcount;
struct hlist_node hash_entry;
};
+#endif
struct tt_change_node {
struct list_head list;
--
1.7.8.3
10 years, 4 months
[B.A.T.M.A.N.] multi path TCP
by Christian Huldt
As a complete newbie to batman, please excuse if this question is unusually stupid, but I just got home after getting update on the mptcp kernel module http://mptcp.info.ucl.ac.be/ and it seems to me that running mptcp over a batman mesh could potentially be quite nice. It that correct or am I just being ignorant?
tia
Christian
10 years, 4 months
[B.A.T.M.A.N.] [PATCH] batman-adv: Remove declaration of only locally used functions
by Sven Eckelmann
The blaII code removed references to two functions outside of the own source
file. route_unicast_packet can be marked as static since
9c11509d3bbf914060be1bcb4448ea69d571fcb9 and tt_global_del since
7c5289cb52a5cecaeeddc719cd52b50bb17263dd
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
routing.c | 5 ++++-
routing.h | 1 -
translation-table.c | 7 ++++---
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/routing.c b/routing.c
index 4a0e265..7b7fcbe 100644
--- a/routing.c
+++ b/routing.c
@@ -31,6 +31,9 @@
#include "unicast.h"
#include "bridge_loop_avoidance.h"
+static int route_unicast_packet(struct sk_buff *skb,
+ struct hard_iface *recv_if);
+
void slide_own_bcast_window(struct hard_iface *hard_iface)
{
struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
@@ -806,7 +809,7 @@ static int check_unicast_packet(struct sk_buff *skb, int hdr_size)
return 0;
}
-int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
+static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
{
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct orig_node *orig_node = NULL;
diff --git a/routing.h b/routing.h
index 92ac100..3d729cb 100644
--- a/routing.h
+++ b/routing.h
@@ -25,7 +25,6 @@
void slide_own_bcast_window(struct hard_iface *hard_iface);
void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
struct neigh_node *neigh_node);
-int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if);
int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if);
int recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if);
int recv_ucast_frag_packet(struct sk_buff *skb, struct hard_iface *recv_if);
diff --git a/translation-table.c b/translation-table.c
index 295d4b3..9a07882 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -816,9 +816,10 @@ static void tt_global_del_roaming(struct bat_priv *bat_priv,
-void tt_global_del(struct bat_priv *bat_priv,
- struct orig_node *orig_node, const unsigned char *addr,
- const char *message, bool roaming)
+static void tt_global_del(struct bat_priv *bat_priv,
+ struct orig_node *orig_node,
+ const unsigned char *addr,
+ const char *message, bool roaming)
{
struct tt_global_entry *tt_global_entry = NULL;
struct tt_local_entry *tt_local_entry = NULL;
--
1.7.8.3
10 years, 5 months
[B.A.T.M.A.N.] [PATCHv3 00/10] bridge loop avoidance II
by Simon Wunderlich
This series of patches contains the changes for the redesigned
bridge loop avoidance. The general concept is described in the wiki
[1]. I've already performed a few testcases [2] which worked fine in
my kvm environment. No crashes while running or unloading the
extension either.
This is the fourth version of the patchset, rebased on the master and
including the TT changes after the discussion with Antonio to get the
flags straight (see [3]):
* Roaming flag should only be set when the last entry moved
* clean up tt_global_add()
* remove (debug) crc global computation - it breaks more than it helps
* add debug message when committed locally
Cheers,
Simon
The git repositories can be found on git.open-mesh.org:
* blaII_rebase branch [4] contains the latest patchset
* blaII_rebase_rework branch [5] contains the latest patchset with individual patches from v2
* blaII branch in batctl [6] contains the batctl changes
Cheers,
Simon
[1] http://www.open-mesh.org/wiki/batman-adv/Bridge-loop-avoidance-II
[2] http://www.open-mesh.org/wiki/batman-adv/Bridge-loop-avoidance-Testcases
[3] http://www.open-mesh.org/wiki/2/TT-Flags
[4] http://git.open-mesh.org/?p=simon/batman-adv.git;a=shortlog;h=refs/heads/...
[5] http://git.open-mesh.org/?p=simon/batman-adv.git;a=shortlog;h=refs/heads/...
[6] http://git.open-mesh.org/?p=simon/batctl.git;a=shortlog;h=refs/heads/blaII
Simon Wunderlich (10):
batman-adv: remove old bridge loop avoidance code
batman-adv: add basic bridge loop avoidance code
batman-adv: make bridge loop avoidance switchable
batman-adv: export claim tables through debugfs
batman-adv: allow multiple entries in tt_global_entries
batman-adv: don't let backbone gateways exchange tt entries
batman-adv: add broadcast duplicate check
batman-adv: drop STP over batman
batman-adv: form groups in the bridge loop avoidance
batman-adv: add bridge loop avoidance compile option
Makefile | 2 +
Makefile.kbuild | 1 +
README | 19 +-
README.external | 1 +
bat_debugfs.c | 23 +-
bat_sysfs.c | 8 +-
bridge_loop_avoidance.c | 1594 +++++++++++++++++++++++++++++++++++++++++++++++
bridge_loop_avoidance.h | 55 ++
compat.c | 16 +-
compat.h | 3 +-
gen-compat-autoconf.sh | 1 +
hard-interface.c | 18 +-
main.c | 9 +-
main.h | 9 +-
originator.c | 3 +-
packet.h | 16 +
routing.c | 16 +
soft-interface.c | 490 +--------------
soft-interface.h | 2 -
sysfs-class-net-mesh | 9 +
translation-table.c | 415 ++++++++++---
types.h | 67 ++-
22 files changed, 2140 insertions(+), 637 deletions(-)
create mode 100644 bridge_loop_avoidance.c
create mode 100644 bridge_loop_avoidance.h
--
1.7.8.3
10 years, 5 months
[B.A.T.M.A.N.] [PATCH] batman-adv: Remove declaration of only locally used functions
by Sven Eckelmann
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
This should help us to find unused code. The test was done with
a script that was inspired by another script from d0tslash.
I would like to add this to the daily tests when this patch
was added to next.
set -e
defined="`nm -g --defined-only *.o|awk '{print $3}'|sort|uniq`"
used="`nm -g --undefined-only *.o|awk '{print $2}'|sort|uniq`"
for i in $defined; do
found=0
for j in $used; do
[ "$i" = "$j" ] && found=1 && break
done
[ "$found" = "0" ] && echo $i
done
---
translation-table.c | 22 ++++++++++++++--------
translation-table.h | 8 --------
2 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/translation-table.c b/translation-table.c
index 9a6f315..c1abf48 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -30,6 +30,8 @@
#include <linux/crc16.h>
+static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
+ struct orig_node *orig_node);
static void _tt_global_del(struct bat_priv *bat_priv,
struct tt_global_entry *tt_global_entry,
const char *message);
@@ -644,9 +646,10 @@ out:
tt_global_entry_free_ref(tt_global_entry);
}
-void tt_global_del(struct bat_priv *bat_priv,
- struct orig_node *orig_node, const unsigned char *addr,
- const char *message, bool roaming)
+static void tt_global_del(struct bat_priv *bat_priv,
+ struct orig_node *orig_node,
+ const unsigned char *addr,
+ const char *message, bool roaming)
{
struct tt_global_entry *tt_global_entry = NULL;
struct tt_local_entry *tt_local_entry = NULL;
@@ -848,7 +851,8 @@ out:
}
/* Calculates the checksum of the local table of a given orig_node */
-uint16_t tt_global_crc(struct bat_priv *bat_priv, struct orig_node *orig_node)
+static uint16_t tt_global_crc(struct bat_priv *bat_priv,
+ struct orig_node *orig_node)
{
uint16_t total = 0, total_one;
struct hashtable_t *hash = bat_priv->tt_global_hash;
@@ -936,8 +940,10 @@ static void tt_req_list_free(struct bat_priv *bat_priv)
spin_unlock_bh(&bat_priv->tt_req_list_lock);
}
-void tt_save_orig_buffer(struct bat_priv *bat_priv, struct orig_node *orig_node,
- const unsigned char *tt_buff, uint8_t tt_num_changes)
+static void tt_save_orig_buffer(struct bat_priv *bat_priv,
+ struct orig_node *orig_node,
+ const unsigned char *tt_buff,
+ uint8_t tt_num_changes)
{
uint16_t tt_buff_len = tt_len(tt_num_changes);
@@ -1629,8 +1635,8 @@ unlock:
return ret;
}
-void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
- struct orig_node *orig_node)
+static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
+ struct orig_node *orig_node)
{
struct neigh_node *neigh_node = NULL;
struct sk_buff *skb = NULL;
diff --git a/translation-table.h b/translation-table.h
index c753633..bfebe26 100644
--- a/translation-table.h
+++ b/translation-table.h
@@ -39,23 +39,15 @@ int tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
int tt_global_seq_print_text(struct seq_file *seq, void *offset);
void tt_global_del_orig(struct bat_priv *bat_priv,
struct orig_node *orig_node, const char *message);
-void tt_global_del(struct bat_priv *bat_priv,
- struct orig_node *orig_node, const unsigned char *addr,
- const char *message, bool roaming);
struct orig_node *transtable_search(struct bat_priv *bat_priv,
const uint8_t *src, const uint8_t *addr);
-void tt_save_orig_buffer(struct bat_priv *bat_priv, struct orig_node *orig_node,
- const unsigned char *tt_buff, uint8_t tt_num_changes);
uint16_t tt_local_crc(struct bat_priv *bat_priv);
-uint16_t tt_global_crc(struct bat_priv *bat_priv, struct orig_node *orig_node);
void tt_free(struct bat_priv *bat_priv);
bool send_tt_response(struct bat_priv *bat_priv,
struct tt_query_packet *tt_request);
bool is_my_client(struct bat_priv *bat_priv, const uint8_t *addr);
void handle_tt_response(struct bat_priv *bat_priv,
struct tt_query_packet *tt_response);
-void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
- struct orig_node *orig_node);
void tt_commit_changes(struct bat_priv *bat_priv);
bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst);
void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
--
1.7.8.3
10 years, 5 months
[B.A.T.M.A.N.] [PATCH] batman-adv: encourage batman to take shorter routes by changing the default hop penalty
by Marek Lindner
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
---
soft-interface.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/soft-interface.c b/soft-interface.c
index 2ffdc74..7548762 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -836,7 +836,7 @@ struct net_device *softif_create(const char *name)
atomic_set(&bat_priv->gw_sel_class, 20);
atomic_set(&bat_priv->gw_bandwidth, 41);
atomic_set(&bat_priv->orig_interval, 1000);
- atomic_set(&bat_priv->hop_penalty, 10);
+ atomic_set(&bat_priv->hop_penalty, 30);
atomic_set(&bat_priv->log_level, 0);
atomic_set(&bat_priv->fragmentation, 1);
atomic_set(&bat_priv->bcast_queue_left, BCAST_QUEUE_LEN);
--
1.7.5.4
10 years, 5 months
[B.A.T.M.A.N.] [RFC] batman-adv: Replace bitarray operations with bitmap [aka. lets break batman-av]
by Sven Eckelmann
bitarray.c consists mostly of functionality that is already available as part
of the standard kernel API. batman-adv could use architecture optimized code
and reduce the binary size by switching to the standard functions.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
--
This patch is completely untested. Simon and I just talked about standard
kernel bit operations and noticed that we hadn't fulfilled our promise to
remove the code that is already available in the linux kernel. So this is just
a reminder and should not be seen as a finished patch.
bat_iv_ogm.c | 5 ++-
bitarray.c | 92 +++++----------------------------------------------------
bitarray.h | 5 ---
main.h | 2 +-
routing.c | 2 +-
types.h | 4 +-
6 files changed, 15 insertions(+), 95 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 2b66dae..d026819 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -874,7 +874,8 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
seq_diff, set_mark);
tmp_neigh_node->real_packet_count =
- bit_packet_count(tmp_neigh_node->real_bits);
+ bitmap_weight(tmp_neigh_node->real_bits,
+ TQ_LOCAL_WINDOW_SIZE);
}
rcu_read_unlock();
@@ -1013,7 +1014,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
if_incoming_seqno -
batman_ogm_packet->seqno - 2);
orig_neigh_node->bcast_own_sum[if_incoming->if_num] =
- bit_packet_count(word);
+ bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE);
spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock);
}
diff --git a/bitarray.c b/bitarray.c
index e63069d..8220506 100644
--- a/bitarray.c
+++ b/bitarray.c
@@ -29,95 +29,32 @@
int get_bit_status(const unsigned long *seq_bits, uint32_t last_seqno,
uint32_t curr_seqno)
{
- int32_t diff, word_offset, word_num;
+ int32_t diff;
diff = last_seqno - curr_seqno;
- if (diff < 0 || diff >= TQ_LOCAL_WINDOW_SIZE) {
+ if (diff < 0 || diff >= TQ_LOCAL_WINDOW_SIZE)
return 0;
- } else {
- /* which word */
- word_num = (last_seqno - curr_seqno) / WORD_BIT_SIZE;
- /* which position in the selected word */
- word_offset = (last_seqno - curr_seqno) % WORD_BIT_SIZE;
-
- if (test_bit(word_offset, &seq_bits[word_num]))
- return 1;
- else
- return 0;
- }
+ else
+ return test_bit(diff, seq_bits);
}
/* turn corresponding bit on, so we can remember that we got the packet */
void bit_mark(unsigned long *seq_bits, int32_t n)
{
- int32_t word_offset, word_num;
-
/* if too old, just drop it */
if (n < 0 || n >= TQ_LOCAL_WINDOW_SIZE)
return;
- /* which word */
- word_num = n / WORD_BIT_SIZE;
- /* which position in the selected word */
- word_offset = n % WORD_BIT_SIZE;
-
- set_bit(word_offset, &seq_bits[word_num]); /* turn the position on */
+ set_bit(n, seq_bits); /* turn the position on */
}
/* shift the packet array by n places. */
static void bit_shift(unsigned long *seq_bits, int32_t n)
{
- int32_t word_offset, word_num;
- int32_t i;
-
if (n <= 0 || n >= TQ_LOCAL_WINDOW_SIZE)
return;
- word_offset = n % WORD_BIT_SIZE;/* shift how much inside each word */
- word_num = n / WORD_BIT_SIZE; /* shift over how much (full) words */
-
- for (i = NUM_WORDS - 1; i > word_num; i--) {
- /* going from old to new, so we don't overwrite the data we copy
- * from.
- *
- * left is high, right is low: FEDC BA98 7654 3210
- * ^^ ^^
- * vvvv
- * ^^^^ = from, vvvvv =to, we'd have word_num==1 and
- * word_offset==WORD_BIT_SIZE/2 ????? in this example.
- * (=24 bits)
- *
- * our desired output would be: 9876 5432 1000 0000
- * */
-
- seq_bits[i] =
- (seq_bits[i - word_num] << word_offset) +
- /* take the lower port from the left half, shift it left
- * to its final position */
- (seq_bits[i - word_num - 1] >>
- (WORD_BIT_SIZE-word_offset));
- /* and the upper part of the right half and shift it left to
- * its position */
- /* for our example that would be: word[0] = 9800 + 0076 =
- * 9876 */
- }
- /* now for our last word, i==word_num, we only have its "left" half.
- * that's the 1000 word in our example.*/
-
- seq_bits[i] = (seq_bits[i - word_num] << word_offset);
-
- /* pad the rest with 0, if there is anything */
- i--;
-
- for (; i >= 0; i--)
- seq_bits[i] = 0;
-}
-
-static void bit_reset_window(unsigned long *seq_bits)
-{
- int i;
- for (i = 0; i < NUM_WORDS; i++)
- seq_bits[i] = 0;
+ bitmap_shift_left(seq_bits, seq_bits, n, TQ_LOCAL_WINDOW_SIZE);
}
@@ -159,7 +96,7 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
bat_dbg(DBG_BATMAN, bat_priv,
"We missed a lot of packets (%i) !\n",
seq_num_diff - 1);
- bit_reset_window(seq_bits);
+ bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE);
if (set_mark)
bit_mark(seq_bits, 0);
return 1;
@@ -176,7 +113,7 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
bat_dbg(DBG_BATMAN, bat_priv,
"Other host probably restarted!\n");
- bit_reset_window(seq_bits);
+ bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE);
if (set_mark)
bit_mark(seq_bits, 0);
@@ -186,16 +123,3 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
/* never reached */
return 0;
}
-
-/* count the hamming weight, how many good packets did we receive? just count
- * the 1's.
- */
-int bit_packet_count(const unsigned long *seq_bits)
-{
- int i, hamming = 0;
-
- for (i = 0; i < NUM_WORDS; i++)
- hamming += hweight_long(seq_bits[i]);
-
- return hamming;
-}
diff --git a/bitarray.h b/bitarray.h
index c613572..48f940d 100644
--- a/bitarray.h
+++ b/bitarray.h
@@ -22,8 +22,6 @@
#ifndef _NET_BATMAN_ADV_BITARRAY_H_
#define _NET_BATMAN_ADV_BITARRAY_H_
-#define WORD_BIT_SIZE (sizeof(unsigned long) * 8)
-
/* returns true if the corresponding bit in the given seq_bits indicates true
* and curr_seqno is within range of last_seqno */
int get_bit_status(const unsigned long *seq_bits, uint32_t last_seqno,
@@ -38,7 +36,4 @@ void bit_mark(unsigned long *seq_bits, int32_t n);
int bit_get_packet(void *priv, unsigned long *seq_bits,
int32_t seq_num_diff, int set_mark);
-/* count the hamming weight, how many good packets did we receive? */
-int bit_packet_count(const unsigned long *seq_bits);
-
#endif /* _NET_BATMAN_ADV_BITARRAY_H_ */
diff --git a/main.h b/main.h
index 7f2d737..fd50c6e 100644
--- a/main.h
+++ b/main.h
@@ -65,7 +65,7 @@
#define NULL_IFINDEX 0 /* dummy ifindex used to avoid iface checks */
-#define NUM_WORDS (TQ_LOCAL_WINDOW_SIZE / WORD_BIT_SIZE)
+#define NUM_WORDS BITS_TO_LONGS(TQ_LOCAL_WINDOW_SIZE)
#define LOG_BUF_LEN 8192 /* has to be a power of 2 */
diff --git a/routing.c b/routing.c
index cf9a2f6..efd543a 100644
--- a/routing.c
+++ b/routing.c
@@ -52,7 +52,7 @@ void slide_own_bcast_window(struct hard_iface *hard_iface)
bit_get_packet(bat_priv, word, 1, 0);
orig_node->bcast_own_sum[hard_iface->if_num] =
- bit_packet_count(word);
+ bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE);
spin_unlock_bh(&orig_node->ogm_cnt_lock);
}
rcu_read_unlock();
diff --git a/types.h b/types.h
index 302efb5..24c8a31 100644
--- a/types.h
+++ b/types.h
@@ -90,7 +90,7 @@ struct orig_node {
bool tt_poss_change;
uint32_t last_real_seqno;
uint8_t last_ttl;
- unsigned long bcast_bits[NUM_WORDS];
+ DECLARE_BITMAP(bcast_bits, TQ_LOCAL_WINDOW_SIZE);
uint32_t last_bcast_seqno;
struct hlist_head neigh_list;
struct list_head frag_list;
@@ -132,7 +132,7 @@ struct neigh_node {
uint8_t last_ttl;
struct list_head bonding_list;
unsigned long last_valid;
- unsigned long real_bits[NUM_WORDS];
+ DECLARE_BITMAP(real_bits, TQ_LOCAL_WINDOW_SIZE);
atomic_t refcount;
struct rcu_head rcu;
struct orig_node *orig_node;
--
1.7.7.3
10 years, 5 months
[B.A.T.M.A.N.] [PATCH] batman-adv: use ETH_ALEN instead of hardcoded numeric constants
by Antonio Quartulli
In packet.h the numeric constant 6 is used instead of the more portable ETH_ALEN
define. This patch substitute any hardcoded value with such define.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
packet.h | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/packet.h b/packet.h
index 441f3db..3496d38 100644
--- a/packet.h
+++ b/packet.h
@@ -100,8 +100,8 @@ struct batman_ogm_packet {
struct batman_header header;
uint8_t flags; /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
uint32_t seqno;
- uint8_t orig[6];
- uint8_t prev_sender[6];
+ uint8_t orig[ETH_ALEN];
+ uint8_t prev_sender[ETH_ALEN];
uint8_t gw_flags; /* flags related to gateway class */
uint8_t tq;
uint8_t tt_num_changes;
@@ -114,8 +114,8 @@ struct batman_ogm_packet {
struct icmp_packet {
struct batman_header header;
uint8_t msg_type; /* see ICMP message types above */
- uint8_t dst[6];
- uint8_t orig[6];
+ uint8_t dst[ETH_ALEN];
+ uint8_t orig[ETH_ALEN];
uint16_t seqno;
uint8_t uid;
uint8_t reserved;
@@ -128,8 +128,8 @@ struct icmp_packet {
struct icmp_packet_rr {
struct batman_header header;
uint8_t msg_type; /* see ICMP message types above */
- uint8_t dst[6];
- uint8_t orig[6];
+ uint8_t dst[ETH_ALEN];
+ uint8_t orig[ETH_ALEN];
uint16_t seqno;
uint8_t uid;
uint8_t rr_cur;
@@ -139,16 +139,16 @@ struct icmp_packet_rr {
struct unicast_packet {
struct batman_header header;
uint8_t ttvn; /* destination translation table version number */
- uint8_t dest[6];
+ uint8_t dest[ETH_ALEN];
} __packed;
struct unicast_frag_packet {
struct batman_header header;
uint8_t ttvn; /* destination translation table version number */
- uint8_t dest[6];
+ uint8_t dest[ETH_ALEN];
uint8_t flags;
uint8_t align;
- uint8_t orig[6];
+ uint8_t orig[ETH_ALEN];
uint16_t seqno;
} __packed;
@@ -156,7 +156,7 @@ struct bcast_packet {
struct batman_header header;
uint8_t reserved;
uint32_t seqno;
- uint8_t orig[6];
+ uint8_t orig[ETH_ALEN];
} __packed;
struct vis_packet {
@@ -165,9 +165,9 @@ struct vis_packet {
uint32_t seqno; /* sequence number */
uint8_t entries; /* number of entries behind this struct */
uint8_t reserved;
- uint8_t vis_orig[6]; /* originator that announces its neighbors */
- uint8_t target_orig[6]; /* who should receive this packet */
- uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
+ uint8_t vis_orig[ETH_ALEN]; /* originator that announces its neighbors */
+ uint8_t target_orig[ETH_ALEN]; /* who should receive this packet */
+ uint8_t sender_orig[ETH_ALEN]; /* who sent or rebroadcasted this packet */
} __packed;
struct tt_query_packet {
--
1.7.3.4
10 years, 5 months