[batman-adv] next: Merge branch 'maint' into next (fd9fec7)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
>---------------------------------------------------------------
commit fd9fec7e93906b3109b84a3c79513944cac71b45
Merge: 4522678 a636bf0
Author: Marek Lindner <mareklindner(a)neomailbox.ch>
Date: Mon May 2 21:37:28 2016 +0800
Merge branch 'maint' into next
>---------------------------------------------------------------
fd9fec7e93906b3109b84a3c79513944cac71b45
net/batman-adv/bat_v.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
6 years, 1 month
[batman-adv] maint: batman-adv: make sure ELP/OGM orig MAC is updated on address change (a636bf0)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : maint
>---------------------------------------------------------------
commit a636bf0b69010222ea58337d425ca9ff8ce52639
Author: Antonio Quartulli <a(a)unstable.cc>
Date: Mon May 2 18:27:38 2016 +0800
batman-adv: make sure ELP/OGM orig MAC is updated on address change
When the MAC address of the primary interface is changed,
update the originator address in the ELP and OGM skb buffers as
well in order to reflect the change.
Fixes: a4b88af77e28 ("batman-adv: ELP - adding basic infrastructure")
Reported-by: Marek Lindner <marek(a)neomailbox.ch>
Signed-off-by: Antonio Quartulli <a(a)unstable.cc>
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
a636bf0b69010222ea58337d425ca9ff8ce52639
net/batman-adv/bat_v.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 4026f19..4547fce 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -72,16 +72,34 @@ static void batadv_v_iface_disable(struct batadv_hard_iface *hard_iface)
batadv_v_elp_iface_disable(hard_iface);
}
-static void batadv_v_iface_update_mac(struct batadv_hard_iface *hard_iface)
-{
-}
-
static void batadv_v_primary_iface_set(struct batadv_hard_iface *hard_iface)
{
batadv_v_elp_primary_iface_set(hard_iface);
batadv_v_ogm_primary_iface_set(hard_iface);
}
+/**
+ * batadv_v_iface_update_mac - react to hard-interface MAC address change
+ * @hard_iface: the modified interface
+ *
+ * If the modified interface is the primary one, update the originator
+ * address in the ELP and OGM messages to reflect the new MAC address.
+ */
+static void batadv_v_iface_update_mac(struct batadv_hard_iface *hard_iface)
+{
+ struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
+ struct batadv_hard_iface *primary_if;
+
+ primary_if = batadv_primary_if_get_selected(bat_priv);
+ if (primary_if != hard_iface)
+ goto out;
+
+ batadv_v_primary_iface_set(hard_iface);
+out:
+ if (primary_if)
+ batadv_hardif_put(primary_if);
+}
+
static void
batadv_v_hardif_neigh_init(struct batadv_hardif_neigh_node *hardif_neigh)
{
6 years, 1 month
[batctl] master: batctl: tcpdump - filter OGM and OGMv2 packets independently (f29682c)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit f29682c97c327ffef4bea4d3ca46e01c55db3214
Author: Antonio Quartulli <a(a)unstable.cc>
Date: Thu Apr 14 17:29:57 2016 +0800
batctl: tcpdump - filter OGM and OGMv2 packets independently
for debugging purposes it might be required to dump either OGMs
or OGM2s only. For this reason it is better to make the tcpdump
engine more flexible and accept distinct filters for the two
packet types.
Signed-off-by: Antonio Quartulli <antonio(a)open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
f29682c97c327ffef4bea4d3ca46e01c55db3214
tcpdump.c | 15 ++++++++-------
tcpdump.h | 15 ++++++++-------
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/tcpdump.c b/tcpdump.c
index e969d7d..363e9e4 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -64,10 +64,11 @@ if ((size_t)(buff_len) < (check_len)) { \
return; \
}
-static unsigned short dump_level_all = DUMP_TYPE_BATOGM | DUMP_TYPE_BATELP |
- DUMP_TYPE_BATICMP | DUMP_TYPE_BATUCAST |
- DUMP_TYPE_BATBCAST | DUMP_TYPE_BATUTVLV |
- DUMP_TYPE_BATFRAG | DUMP_TYPE_NONBAT;
+static unsigned short dump_level_all = DUMP_TYPE_BATOGM | DUMP_TYPE_BATOGM2 |
+ DUMP_TYPE_BATELP | DUMP_TYPE_BATICMP |
+ DUMP_TYPE_BATUCAST | DUMP_TYPE_BATBCAST |
+ DUMP_TYPE_BATUTVLV | DUMP_TYPE_BATFRAG |
+ DUMP_TYPE_NONBAT;
static unsigned short dump_level;
static void parse_eth_hdr(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed);
@@ -82,8 +83,8 @@ static void tcpdump_usage(void)
fprintf(stderr, " \t -p dump specific packet type\n");
fprintf(stderr, " \t -x dump all packet types except specified\n");
fprintf(stderr, "packet types:\n");
- fprintf(stderr, " \t\t%3d - batman ogm/ogmv2 packets\n",
- DUMP_TYPE_BATOGM);
+ fprintf(stderr, " \t\t%3d - batman ogm packets\n", DUMP_TYPE_BATOGM);
+ fprintf(stderr, " \t\t%3d - batman ogmv2 packets\n", DUMP_TYPE_BATOGM2);
fprintf(stderr, " \t\t%3d - batman elp packets\n", DUMP_TYPE_BATELP);
fprintf(stderr, " \t\t%3d - batman icmp packets\n", DUMP_TYPE_BATICMP);
fprintf(stderr, " \t\t%3d - batman unicast packets\n", DUMP_TYPE_BATUCAST);
@@ -969,7 +970,7 @@ static void parse_eth_hdr(unsigned char *packet_buff, ssize_t buff_len, int read
dump_batman_iv_ogm(packet_buff, buff_len, read_opt, time_printed);
break;
case BATADV_OGM2:
- if (dump_level & DUMP_TYPE_BATOGM)
+ if (dump_level & DUMP_TYPE_BATOGM2)
dump_batman_ogm2(packet_buff, buff_len,
read_opt, time_printed);
break;
diff --git a/tcpdump.h b/tcpdump.h
index 5ec474f..229ee70 100644
--- a/tcpdump.h
+++ b/tcpdump.h
@@ -38,13 +38,14 @@
#endif
#define DUMP_TYPE_BATOGM 1
-#define DUMP_TYPE_BATELP 2
-#define DUMP_TYPE_BATICMP 4
-#define DUMP_TYPE_BATUCAST 8
-#define DUMP_TYPE_BATBCAST 16
-#define DUMP_TYPE_BATUTVLV 32
-#define DUMP_TYPE_BATFRAG 64
-#define DUMP_TYPE_NONBAT 128
+#define DUMP_TYPE_BATOGM2 2
+#define DUMP_TYPE_BATELP 4
+#define DUMP_TYPE_BATICMP 8
+#define DUMP_TYPE_BATUCAST 16
+#define DUMP_TYPE_BATBCAST 32
+#define DUMP_TYPE_BATUTVLV 64
+#define DUMP_TYPE_BATFRAG 128
+#define DUMP_TYPE_NONBAT 256
#define IEEE80211_FCTL_FTYPE 0x0c00
#define IEEE80211_FCTL_TODS 0x0001
6 years, 1 month