[batctl] master: batctl: properly align roaming tvlv container (1c7c38e)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 1c7c38ecd496be841fca19c7e4b63053cdc8a950
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Sun May 26 06:15:21 2013 +0800
batctl: properly align roaming tvlv container
4bytes long members must start at an address multiple of 4
in order to avoid unaligned memory access.
Introduced by 3de4e64df0f1326db7cc0ef25f5af8522850252d
"batman-adv: tvlv - convert roaming adv packet to use
tvlv unicast packets"
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
1c7c38ecd496be841fca19c7e4b63053cdc8a950
packet.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/packet.h b/packet.h
index 2bc60fb..e3ae41a 100644
--- a/packet.h
+++ b/packet.h
@@ -409,9 +409,11 @@ struct batadv_tvlv_tt_change {
/**
* struct batadv_tvlv_roam_adv - roaming advertisement
* @client: mac address of roaming client
+ * @reserved: field reserved for future use
*/
struct batadv_tvlv_roam_adv {
- uint8_t client[ETH_ALEN];
+ uint8_t client[ETH_ALEN];
+ uint16_t reserved;
};
#endif /* _NET_BATMAN_ADV_PACKET_H_ */
9 years, 8 months
[batctl] master: batctl: properly align tvlv infrastructure (26025bf)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 26025bf1d7f3e580c1d1396250bdc2c038a2a53b
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Sun May 26 06:15:20 2013 +0800
batctl: properly align tvlv infrastructure
4bytes long members must start at an address multiple of 4
in order to avoid unaligned memory access.
Therefore, the tvlv short type is eliminated in favor of
tvlv long and that distinction removed from the code.
Introduced by 0b6aa0d43767889eeda43a132cf5e73df4e63bf2
"batman-adv: tvlv - basic infrastructure"
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
26025bf1d7f3e580c1d1396250bdc2c038a2a53b
packet.h | 44 +++++++++-----------------------------------
1 file changed, 9 insertions(+), 35 deletions(-)
diff --git a/packet.h b/packet.h
index 8b8b03f..2bc60fb 100644
--- a/packet.h
+++ b/packet.h
@@ -345,53 +345,27 @@ struct batadv_coded_packet {
* @src: address of the source
* @dst: address of the destination
* @tvlv_len: length of tvlv data following the unicast tvlv header
+ * @align: 2 bytes to align the header to a 4 byte boundry
*/
struct batadv_unicast_tvlv_packet {
struct batadv_header header;
- uint8_t reserved;
- uint8_t dst[ETH_ALEN];
- uint8_t src[ETH_ALEN];
- __be16 tvlv_len;
+ uint8_t reserved;
+ uint8_t dst[ETH_ALEN];
+ uint8_t src[ETH_ALEN];
+ __be16 tvlv_len;
+ uint16_t align;
};
/**
* struct batadv_tvlv_hdr - base tvlv header struct
- * @long_tvlv: flag indicating whether this is a short tvlv container (max 256
- * bytes) or a long tvlv one (up to ETH_DATA_LEN)
* @type: tvlv container type (see batadv_tvlv_type)
* @version: tvlv container version
+ * @len: tvlv container length
*/
struct batadv_tvlv_hdr {
-#if defined(__BIG_ENDIAN_BITFIELD)
- uint8_t long_tvlv:1;
- uint8_t type:7;
-#elif defined(__LITTLE_ENDIAN_BITFIELD)
- uint8_t type:7;
- uint8_t long_tvlv:1;
-#else
-#error "unknown bitfield endianess"
-#endif
+ uint8_t type;
uint8_t version;
-};
-
-/**
- * struct batadv_tvlv_short - short tvlv header struct
- * @tvlv_hdr: base tvlv header
- * @len: tvlv container length (limited to 255 bytes)
- */
-struct batadv_tvlv_short {
- struct batadv_tvlv_hdr tvlv_hdr;
- uint8_t len;
-};
-
-/**
- * struct batadv_tvlv_long - long tvlv header struct
- * @tvlv_hdr: base tvlv header
- * @len: tvlv container length
- */
-struct batadv_tvlv_long {
- struct batadv_tvlv_hdr tvlv_hdr;
- __be16 len;
+ __be16 len;
};
/**
9 years, 8 months
[batctl] master: batctl: create common header for ICMP packets (9ffe18f)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 9ffe18f08da9f5bdb42fb32e837650e377fb52e4
Author: Antonio Quartulli <antonio(a)open-mesh.com>
Date: Wed May 29 09:58:24 2013 +0200
batctl: create common header for ICMP packets
the icmp and the icmp_rr packets share the same initial
fields since they use the same code to be processed and
forwarded.
Extract the common fields and put them into a separate
struct so that future ICMP packets can be easily added
without bloating the packet definition.
However, keep the seqno field outside of the newly created
common header because future ICMP types may require a
bigger sequence number space.
This change breaks compatibility due to fields reordering
in the ICMP headers.
Signed-off-by: Antonio Quartulli <antonio(a)open-mesh.com>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
9ffe18f08da9f5bdb42fb32e837650e377fb52e4
packet.h | 38 ++++++++++++++++++++++++++++----------
ping.c | 24 ++++++++++++++----------
tcpdump.c | 27 +++++++++++++++++----------
traceroute.c | 31 +++++++++++++++++++------------
4 files changed, 78 insertions(+), 42 deletions(-)
diff --git a/packet.h b/packet.h
index 57d2002..8b8b03f 100644
--- a/packet.h
+++ b/packet.h
@@ -186,29 +186,47 @@ struct batadv_ogm_packet {
#define BATADV_OGM_HLEN sizeof(struct batadv_ogm_packet)
-struct batadv_icmp_packet {
+/**
+ * batadc_icmp_header - common ICMP header
+ * @header: common batman header
+ * @msg_type: ICMP packet type
+ * @dst: address of the destination node
+ * @orig: address of the source node
+ * @uid: local ICMP socket identifier
+ */
+struct batadv_icmp_header {
struct batadv_header header;
uint8_t msg_type; /* see ICMP message types above */
uint8_t dst[ETH_ALEN];
uint8_t orig[ETH_ALEN];
- __be16 seqno;
uint8_t uid;
+};
+
+/**
+ * batadv_icmp_packet - ICMP packet
+ * @icmph: common ICMP header
+ * @reserved: not used - useful for alignment
+ * @seqno: ICMP sequence number
+ */
+struct batadv_icmp_packet {
+ struct batadv_icmp_header icmph;
uint8_t reserved;
+ __be16 seqno;
};
#define BATADV_RR_LEN 16
-/* icmp_packet_rr must start with all fields from imcp_packet
- * as this is assumed by code that handles ICMP packets
+/**
+ * batadv_icmp_packet_rr - ICMP RouteRecord packet
+ * @icmph: common ICMP header
+ * @rr_cur: number of entries the rr array
+ * @seqno: ICMP sequence number
+ * @rr: route record array
*/
struct batadv_icmp_packet_rr {
- struct batadv_header header;
- uint8_t msg_type; /* see ICMP message types above */
- uint8_t dst[ETH_ALEN];
- uint8_t orig[ETH_ALEN];
- __be16 seqno;
- uint8_t uid;
+ struct batadv_icmp_header icmph;
uint8_t rr_cur;
+ __be16 seqno;
uint8_t rr[BATADV_RR_LEN][ETH_ALEN];
};
diff --git a/ping.c b/ping.c
index 5d6b7e9..6679604 100644
--- a/ping.c
+++ b/ping.c
@@ -171,11 +171,11 @@ int ping(char *mesh_iface, int argc, char **argv)
packet_len = sizeof(struct batadv_icmp_packet);
- memcpy(&icmp_packet_out.dst, dst_mac, ETH_ALEN);
- icmp_packet_out.header.packet_type = BATADV_ICMP;
- icmp_packet_out.header.version = BATADV_COMPAT_VERSION;
- icmp_packet_out.msg_type = BATADV_ECHO_REQUEST;
- icmp_packet_out.header.ttl = 50;
+ memcpy(&icmp_packet_out.icmph.dst, dst_mac, ETH_ALEN);
+ icmp_packet_out.icmph.header.packet_type = BATADV_ICMP;
+ icmp_packet_out.icmph.header.version = BATADV_COMPAT_VERSION;
+ icmp_packet_out.icmph.msg_type = BATADV_ECHO_REQUEST;
+ icmp_packet_out.icmph.header.ttl = 50;
icmp_packet_out.seqno = 0;
if (rr) {
@@ -245,12 +245,14 @@ read_packet:
if (htons(seq_counter) != icmp_packet_in.seqno)
goto read_packet;
- switch (icmp_packet_in.msg_type) {
+ switch (icmp_packet_in.icmph.msg_type) {
case BATADV_ECHO_REPLY:
time_delta = end_timer();
printf("%zd bytes from %s icmp_seq=%hu ttl=%d time=%.2f ms",
- read_len, dst_string, ntohs(icmp_packet_in.seqno),
- icmp_packet_in.header.ttl, time_delta);
+ read_len, dst_string,
+ ntohs(icmp_packet_in.seqno),
+ icmp_packet_in.icmph.header.ttl,
+ time_delta);
if (read_len == sizeof(struct batadv_icmp_packet_rr)) {
if (last_rr_cur == icmp_packet_in.rr_cur
@@ -299,11 +301,13 @@ read_packet:
break;
case BATADV_PARAMETER_PROBLEM:
fprintf(stderr, "Error - the batman adv kernel module version (%d) differs from ours (%d)\n",
- icmp_packet_in.header.version, BATADV_COMPAT_VERSION);
+ icmp_packet_in.icmph.header.version,
+ BATADV_COMPAT_VERSION);
printf("Please make sure to use compatible versions!\n");
goto out;
default:
- printf("Unknown message type %d len %zd received\n", icmp_packet_in.msg_type, read_len);
+ printf("Unknown message type %d len %zd received\n",
+ icmp_packet_in.icmph.msg_type, read_len);
break;
}
diff --git a/tcpdump.c b/tcpdump.c
index 3e932cd..7e0987b 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -361,32 +361,39 @@ static void dump_batman_icmp(unsigned char *packet_buff, ssize_t buff_len, int r
if (!time_printed)
print_time();
- printf("BAT %s > ", get_name_by_macaddr((struct ether_addr *)icmp_packet->orig, read_opt));
+ printf("BAT %s > ",
+ get_name_by_macaddr((struct ether_addr *)icmp_packet->icmph.orig,
+ read_opt));
- name = get_name_by_macaddr((struct ether_addr *)icmp_packet->dst, read_opt);
+ name = get_name_by_macaddr((struct ether_addr *)icmp_packet->icmph.dst,
+ read_opt);
- switch (icmp_packet->msg_type) {
+ switch (icmp_packet->icmph.msg_type) {
case BATADV_ECHO_REPLY:
printf("%s: ICMP echo reply, id %hhu, seq %hu, ttl %2d, v %d, length %zu\n",
- name, icmp_packet->uid, ntohs(icmp_packet->seqno),
- icmp_packet->header.ttl, icmp_packet->header.version,
+ name, icmp_packet->icmph.uid, ntohs(icmp_packet->seqno),
+ icmp_packet->icmph.header.ttl,
+ icmp_packet->icmph.header.version,
(size_t)buff_len - sizeof(struct ether_header));
break;
case BATADV_ECHO_REQUEST:
printf("%s: ICMP echo request, id %hhu, seq %hu, ttl %2d, v %d, length %zu\n",
- name, icmp_packet->uid, ntohs(icmp_packet->seqno),
- icmp_packet->header.ttl, icmp_packet->header.version,
+ name, icmp_packet->icmph.uid, ntohs(icmp_packet->seqno),
+ icmp_packet->icmph.header.ttl,
+ icmp_packet->icmph.header.version,
(size_t)buff_len - sizeof(struct ether_header));
break;
case BATADV_TTL_EXCEEDED:
printf("%s: ICMP time exceeded in-transit, id %hhu, seq %hu, ttl %2d, v %d, length %zu\n",
- name, icmp_packet->uid, ntohs(icmp_packet->seqno),
- icmp_packet->header.ttl, icmp_packet->header.version,
+ name, icmp_packet->icmph.uid, ntohs(icmp_packet->seqno),
+ icmp_packet->icmph.header.ttl,
+ icmp_packet->icmph.header.version,
(size_t)buff_len - sizeof(struct ether_header));
break;
default:
printf("%s: ICMP type %hhu, length %zu\n",
- name, icmp_packet->msg_type, (size_t)buff_len - sizeof(struct ether_header));
+ name, icmp_packet->icmph.msg_type,
+ (size_t)buff_len - sizeof(struct ether_header));
break;
}
}
diff --git a/traceroute.c b/traceroute.c
index 38d3796..362d293 100644
--- a/traceroute.c
+++ b/traceroute.c
@@ -129,17 +129,19 @@ int traceroute(char *mesh_iface, int argc, char **argv)
goto out;
}
- memcpy(&icmp_packet_out.dst, dst_mac, ETH_ALEN);
- icmp_packet_out.header.version = BATADV_COMPAT_VERSION;
- icmp_packet_out.header.packet_type = BATADV_ICMP;
- icmp_packet_out.msg_type = BATADV_ECHO_REQUEST;
+ memcpy(&icmp_packet_out.icmph.dst, dst_mac, ETH_ALEN);
+ icmp_packet_out.icmph.header.version = BATADV_COMPAT_VERSION;
+ icmp_packet_out.icmph.header.packet_type = BATADV_ICMP;
+ icmp_packet_out.icmph.msg_type = BATADV_ECHO_REQUEST;
icmp_packet_out.seqno = 0;
icmp_packet_out.reserved = 0;
printf("traceroute to %s (%s), %d hops max, %zu byte packets\n",
dst_string, mac_string, TTL_MAX, sizeof(icmp_packet_out));
- for (icmp_packet_out.header.ttl = 1; !dst_reached && icmp_packet_out.header.ttl < TTL_MAX; icmp_packet_out.header.ttl++) {
+ for (icmp_packet_out.icmph.header.ttl = 1;
+ !dst_reached && icmp_packet_out.icmph.header.ttl < TTL_MAX;
+ icmp_packet_out.icmph.header.ttl++) {
return_mac = NULL;
bat_host = NULL;
@@ -183,7 +185,7 @@ read_packet:
if (htons(seq_counter) != icmp_packet_in.seqno)
goto read_packet;
- switch (icmp_packet_in.msg_type) {
+ switch (icmp_packet_in.icmph.msg_type) {
case BATADV_ECHO_REPLY:
dst_reached = 1;
/* fall through */
@@ -191,10 +193,10 @@ read_packet:
time_delta[i] = end_timer();
if (!return_mac) {
- return_mac = ether_ntoa_long((struct ether_addr *)&icmp_packet_in.orig);
+ return_mac = ether_ntoa_long((struct ether_addr *)&icmp_packet_in.icmph.orig);
if (read_opt & USE_BAT_HOSTS)
- bat_host = bat_hosts_find_by_mac((char *)&icmp_packet_in.orig);
+ bat_host = bat_hosts_find_by_mac((char *)&icmp_packet_in.icmph.orig);
}
break;
@@ -203,19 +205,24 @@ read_packet:
goto out;
case BATADV_PARAMETER_PROBLEM:
fprintf(stderr, "Error - the batman adv kernel module version (%d) differs from ours (%d)\n",
- icmp_packet_in.header.version, BATADV_COMPAT_VERSION);
+ icmp_packet_in.icmph.header.version,
+ BATADV_COMPAT_VERSION);
fprintf(stderr, "Please make sure to use compatible versions!\n");
goto out;
default:
- printf("Unknown message type %d len %zd received\n", icmp_packet_in.msg_type, read_len);
+ printf("Unknown message type %d len %zd received\n",
+ icmp_packet_in.icmph.msg_type, read_len);
break;
}
}
if (!bat_host)
- printf("%2hhu: %s", icmp_packet_out.header.ttl, (return_mac ? return_mac : "*"));
+ printf("%2hhu: %s", icmp_packet_out.icmph.header.ttl,
+ (return_mac ? return_mac : "*"));
else
- printf("%2hhu: %s (%s)", icmp_packet_out.header.ttl, bat_host->name, return_mac);
+ printf("%2hhu: %s (%s)",
+ icmp_packet_out.icmph.header.ttl,
+ bat_host->name, return_mac);
for (i = 0; i < NUM_PACKETS; i++) {
if (time_delta[i])
9 years, 8 months
[batman-adv] master: batman-adv: fix network order complaints in the TVLV code (422ec22)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 422ec22d69ce6bddc6f61ef39fad4df990c48409
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Tue May 28 14:06:06 2013 +0200
batman-adv: fix network order complaints in the TVLV code
Intorduced by 1ab746a3f2441d3466592b86134fbc72a9fe0558
("batman-adv: properly align tvlv infrastructure")
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
422ec22d69ce6bddc6f61ef39fad4df990c48409
main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/main.c b/main.c
index 9df71bc..1192e61 100644
--- a/main.c
+++ b/main.c
@@ -630,7 +630,7 @@ static uint16_t batadv_tvlv_container_list_size(struct batadv_priv *bat_priv)
hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) {
tvlv_len += sizeof(struct batadv_tvlv_hdr);
- tvlv_len += tvlv->tvlv_hdr.len;
+ tvlv_len += ntohs(tvlv->tvlv_hdr.len);
}
return tvlv_len;
@@ -701,9 +701,9 @@ void batadv_tvlv_container_register(struct batadv_priv *bat_priv,
tvlv_new->tvlv_hdr.version = version;
tvlv_new->tvlv_hdr.type = type;
- tvlv_new->tvlv_hdr.len = tvlv_value_len;
+ tvlv_new->tvlv_hdr.len = htons(tvlv_value_len);
- memcpy(tvlv_new + 1, tvlv_value, tvlv_new->tvlv_hdr.len);
+ memcpy(tvlv_new + 1, tvlv_value, ntohs(tvlv_new->tvlv_hdr.len));
INIT_HLIST_NODE(&tvlv_new->list);
atomic_set(&tvlv_new->refcount, 1);
@@ -790,10 +790,10 @@ uint16_t batadv_tvlv_container_ogm_append(struct batadv_priv *bat_priv,
tvlv_hdr = tvlv_value;
tvlv_hdr->type = tvlv->tvlv_hdr.type;
tvlv_hdr->version = tvlv->tvlv_hdr.version;
- tvlv_hdr->len = htons(tvlv->tvlv_hdr.len);
+ tvlv_hdr->len = tvlv->tvlv_hdr.len;
tvlv_value = tvlv_hdr + 1;
- memcpy(tvlv_value, tvlv + 1, tvlv->tvlv_hdr.len);
- tvlv_value = (uint8_t *)tvlv_value + tvlv->tvlv_hdr.len;
+ memcpy(tvlv_value, tvlv + 1, ntohs(tvlv->tvlv_hdr.len));
+ tvlv_value = (uint8_t *)tvlv_value + ntohs(tvlv->tvlv_hdr.len);
}
end:
9 years, 8 months
[batman-adv] master: batman-adv: fix network order complaints in the TVLV code (692ed0d)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 692ed0dfac2c485763b367d525bdc6138e869b3a
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Tue May 28 14:06:06 2013 +0200
batman-adv: fix network order complaints in the TVLV code
Intorduced by 1ab746a3f2441d3466592b86134fbc72a9fe0558
("batman-adv: properly align tvlv infrastructure")
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
692ed0dfac2c485763b367d525bdc6138e869b3a
main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/main.c b/main.c
index 9df71bc..1192e61 100644
--- a/main.c
+++ b/main.c
@@ -630,7 +630,7 @@ static uint16_t batadv_tvlv_container_list_size(struct batadv_priv *bat_priv)
hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) {
tvlv_len += sizeof(struct batadv_tvlv_hdr);
- tvlv_len += tvlv->tvlv_hdr.len;
+ tvlv_len += ntohs(tvlv->tvlv_hdr.len);
}
return tvlv_len;
@@ -701,9 +701,9 @@ void batadv_tvlv_container_register(struct batadv_priv *bat_priv,
tvlv_new->tvlv_hdr.version = version;
tvlv_new->tvlv_hdr.type = type;
- tvlv_new->tvlv_hdr.len = tvlv_value_len;
+ tvlv_new->tvlv_hdr.len = htons(tvlv_value_len);
- memcpy(tvlv_new + 1, tvlv_value, tvlv_new->tvlv_hdr.len);
+ memcpy(tvlv_new + 1, tvlv_value, ntohs(tvlv_new->tvlv_hdr.len));
INIT_HLIST_NODE(&tvlv_new->list);
atomic_set(&tvlv_new->refcount, 1);
@@ -790,10 +790,10 @@ uint16_t batadv_tvlv_container_ogm_append(struct batadv_priv *bat_priv,
tvlv_hdr = tvlv_value;
tvlv_hdr->type = tvlv->tvlv_hdr.type;
tvlv_hdr->version = tvlv->tvlv_hdr.version;
- tvlv_hdr->len = htons(tvlv->tvlv_hdr.len);
+ tvlv_hdr->len = tvlv->tvlv_hdr.len;
tvlv_value = tvlv_hdr + 1;
- memcpy(tvlv_value, tvlv + 1, tvlv->tvlv_hdr.len);
- tvlv_value = (uint8_t *)tvlv_value + tvlv->tvlv_hdr.len;
+ memcpy(tvlv_value, tvlv + 1, ntohs(tvlv->tvlv_hdr.len));
+ tvlv_value = (uint8_t *)tvlv_value + ntohs(tvlv->tvlv_hdr.len);
}
end:
9 years, 8 months
[batman-adv] master: batman-adv: Add dummy soft-interface rx mode handler (923b190)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 923b1909063d161849a546f0cfedfe2a655bf694
Author: Linus Lüssing <linus.luessing(a)web.de>
Date: Sun May 26 17:56:07 2013 +0200
batman-adv: Add dummy soft-interface rx mode handler
We do not actually need to set any rx filters for the virtual batman
soft interface. However a dummy handler enables a user to set static
multicast listeners for instance.
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
923b1909063d161849a546f0cfedfe2a655bf694
soft-interface.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/soft-interface.c b/soft-interface.c
index d4fdc61..2d182b6 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -137,6 +137,18 @@ static int batadv_interface_change_mtu(struct net_device *dev, int new_mtu)
return 0;
}
+/**
+ * batadv_interface_set_rx_mode - set the rx mode of a device
+ * @dev: registered network device to modify
+ *
+ * We do not actually need to set any rx filters for the virtual batman
+ * soft interface. However a dummy handler enables a user to set static
+ * multicast listeners for instance.
+ */
+static void batadv_interface_set_rx_mode(struct net_device *dev)
+{
+}
+
static int batadv_interface_tx(struct sk_buff *skb,
struct net_device *soft_iface)
{
@@ -572,6 +584,7 @@ static const struct net_device_ops batadv_netdev_ops = {
.ndo_get_stats = batadv_interface_stats,
.ndo_set_mac_address = batadv_interface_set_mac_addr,
.ndo_change_mtu = batadv_interface_change_mtu,
+ .ndo_set_rx_mode = batadv_interface_set_rx_mode,
.ndo_start_xmit = batadv_interface_tx,
.ndo_validate_addr = eth_validate_addr,
.ndo_add_slave = batadv_softif_slave_add,
9 years, 8 months
[batctl] master: batctl: correctly align the tt_tvlv_data struct (7beba2a)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 7beba2affd8d7d235e7b9a6b8aa8911434291f13
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Fri May 24 15:04:44 2013 +0200
batctl: correctly align the tt_tvlv_data struct
4bytes long members must start at an address multiple of 4
in order to avoid unaligned memory access.
Add 2 padding bytes to satisfy this requirement.
Introduced by c5e7a06a29612056006e4dc01910c0b44e858583
"batman-adv: use CRC32C instead of CRC16 in TT code"
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
7beba2affd8d7d235e7b9a6b8aa8911434291f13
packet.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/packet.h b/packet.h
index 21254a4..57d2002 100644
--- a/packet.h
+++ b/packet.h
@@ -391,11 +391,13 @@ struct batadv_tvlv_gateway_data {
* struct batadv_tvlv_tt_data - tt data propagated through the tt tvlv container
* @flags: translation table flags (see batadv_tt_data_flags)
* @ttvn: translation table version number
+ * @reserved: field reserved for future use
* @crc: crc32 checksum of the local translation table
*/
struct batadv_tvlv_tt_data {
uint8_t flags;
uint8_t ttvn;
+ uint16_t reserved;
__be32 crc;
};
9 years, 8 months
[batctl] master: batctl: fix typo in kernel doc (8b27534)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 8b27534c01e25dcbc75efae14dd7cc263406bba1
Author: Antonio Quartulli <antonio(a)open-mesh.com>
Date: Fri May 24 11:21:25 2013 +0200
batctl: fix typo in kernel doc
Introduced by 8405301b979466610a726b7d595b6bfee5306cf7
("batman-adv: tvlv - convert tt data sent within OGMs")
Signed-off-by: Antonio Quartulli <antonio(a)open-mesh.com>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
8b27534c01e25dcbc75efae14dd7cc263406bba1
packet.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packet.h b/packet.h
index 2a73ebd..21254a4 100644
--- a/packet.h
+++ b/packet.h
@@ -388,7 +388,7 @@ struct batadv_tvlv_gateway_data {
};
/**
- * struct tvlv_tt_data - tt data propagated through the tt tvlv container
+ * struct batadv_tvlv_tt_data - tt data propagated through the tt tvlv container
* @flags: translation table flags (see batadv_tt_data_flags)
* @ttvn: translation table version number
* @crc: crc32 checksum of the local translation table
9 years, 8 months
[linux-merge]linux integration; annotated tag, batman-adv-for-davem, updated. batman-adv-for-davem
by postmaster@open-mesh.org
The annotated tag, batman-adv-for-davem has been updated
to d258640b88dc4a51546f88106cb224d8a5a4540d (tag)
from 2f8800869688941db44bcd160c4836bd8baa0fbf (which is now obsolete)
tagging 6715fd3f0538e805b6a769d66823ec16b8b647ac (commit)
replaces v3.10-rc2
tagged by Antonio Quartulli
on Wed May 29 02:45:41 2013 +0200
- Shortlog ------------------------------------------------------------
Included changes:
- reduce broadcast overhead on non-lossy wired links
- fix typos in kernel doc
- use eth_hdr() when possible
- use netdev_allock_skb_ip_align() and don't deal with NET_IP_ALIGN
- change VID semantic in the BLA component
- other minor cleanups and code refactoring
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIcBAABCAAGBQJRpVCoAAoJEADl0hg6qKeOC0MP/ROgdprMTQNSFnvJLo9YZ4qP
EZpEwPqU8gCmnOKdQJ/KYSiyAX/iFjwTBgfelq1ekAbUmzV1y/cLOjHgZuOhM7Bk
5xEiC5Yunj+5Q14f1rW6uDs8+B84gnl4Iow9j6aAlOW6g0BAf3Pb9caN7sSheh/w
dKUHQKaDHaNMrHVerEHRDkzlWSJes6YIYMKgbX1mwMGddMtFJbMKIvylzilLXUl6
3jLlwC8XDvgH+0ygLvuFWEhOwkSdWTo32J92VE/WSTpDPyZYvXj/r+/e/U2Pi3q2
2owariF4PCr+4cc2tcDOPIh/zRdt0OTCZ2lW/z2CZbCCGZ3AYoQ8ue4hulf9AyZS
9Ff/wdgMmPN/aM+t7+QtKrKAcCBb9JqY3eVRL6jeBUF+SP0O/dfVDaQreQExy+iF
H0LhsE6eqMFaucjZit/yZ2SpR6kMo42BmCZjLJVujm0REUsqaq3GKolzrRGNDX91
Wzc/eZkqyES3R6rMrbvW0iqRAAPiUi6YOv9f8MoYbqXNOcmJJdyoMVWthAEFOnFB
4qJw2O5HlROL2TmOKw7cR4TPDX9reWN0OdZrSLabEXYkqVhoqB08ojSLAZbHVTe4
h3EEjGc8eaIpAYb5B68JE41ZNEZFIUlwOCMxeZsk2LV05LTOHCmrUPbF+n/psag9
9zt30TKyPu2b/+XFyOfd
=22js
-----END PGP SIGNATURE-----
Antonio Quartulli (14):
batman-adv: drop useless argument seqno in neighbor creation
batman-adv: slightly improve neighbor creation debug message
batman-adv: don't check the source address twice
batman-adv: don't check compat version twice
batman-adv: do not silently ignore wrong condition
batman-adv: don't initialise batman_iv private members in hard-interface.c
batman-adv: use eth_hdr() when it makes sense
batman-adv: move ring_buffer helper functions in bat_iv_ogm
batman-adv: move batadv_slide_own_bcast_window to bat_iv_ogm.c
batman-adv: refactor batadv_tt_local_event()
batman-adv: don't deal with NET_IP_ALIGN manually
batman-adv: pass a 16bit long flag argument to tt_global_add()
batman-adv: change VID semantic in the BLA code
batman-adv: print the VID properly
Jiri Pirko (1):
net: pass info struct via netdevice notifier
Linus Lüssing (2):
batman-adv: Fix rcu_barrier() miss due to double call_rcu() in TT code
batman-adv: Remove unnecessary INIT_HLIST_NODE() calls
Marek Lindner (2):
batman-adv: fix typos in kernel doc & comments
batman-adv: do not print orig nodes without nc neighbors on nc table print
Martin Hundebøll (2):
batman-adv: Avoid double freeing of bat_counters
batman-adv: Move call to batadv_nc_skb_forward() from routing.c to send.c
Matthias Schiffer (2):
batman-adv: split batadv_is_wifi_iface() into two functions
batman-adv: send each broadcast only once on non-wireless interfaces
Simon Wunderlich (1):
batman-adv: Start new development cycle
-----------------------------------------------------------------------
--
linux integration
9 years, 8 months
[linux-merge]linux integration; branch, merge/master, updated. v3.10-rc1-1796-gce223ee
by postmaster@open-mesh.org
The following commit has been merged in the merge/master branch:
commit ce223eebdbb456784e5f95eb80583e22833e1ef2
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Wed May 29 02:33:18 2013 +0200
batman-adv: fix merge conflict
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index dcfae83..2f0bd3f 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -850,12 +850,6 @@ static int batadv_route_unicast_packet(struct sk_buff *skb,
ret = NET_RX_SUCCESS;
}
- /* Update stats counter */
- batadv_inc_counter(bat_priv, BATADV_CNT_FORWARD);
- batadv_add_counter(bat_priv, BATADV_CNT_FORWARD_BYTES,
- skb->len + ETH_HLEN);
- }
-
out:
if (neigh_node)
batadv_neigh_node_free_ref(neigh_node);
--
linux integration
9 years, 8 months