The following commit has been merged in the merge/master branch:
commit e1b9cf4b021b60f664ece222c47b1c7b3c38d7d2
Merge: 150985e7766f4864b025efc3c5fac8b922d371e2 8cd753ef306c2273d0da3aff5df758880ca78e32
Author: Antonio Quartulli <antonio(a)meshcoding.com>
Date: Sun Jun 29 01:25:34 2014 +0200
Merge commit '8cd753ef306c2273d0da3aff5df758880ca78e32' into merge/master
diff --combined net/batman-adv/bridge_loop_avoidance.c
index 6f0d9ec,a957c81..a957c81
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@@ -800,11 -800,6 +800,6 @@@ static int batadv_check_claim_group(str
bla_dst = (struct batadv_bla_claim_dst *)hw_dst;
bla_dst_own = &bat_priv->bla.claim_dest;
- /* check if it is a claim packet in general */
- if (memcmp(bla_dst->magic, bla_dst_own->magic,
- sizeof(bla_dst->magic)) != 0)
- return 0;
-
/* if announcement packet, use the source,
* otherwise assume it is in the hw_src
*/
@@@ -866,12 -861,13 +861,13 @@@ static int batadv_bla_process_claim(str
struct batadv_hard_iface *primary_if,
struct sk_buff *skb)
{
- struct batadv_bla_claim_dst *bla_dst;
+ struct batadv_bla_claim_dst *bla_dst, *bla_dst_own;
uint8_t *hw_src, *hw_dst;
- struct vlan_ethhdr *vhdr;
+ struct vlan_hdr *vhdr, vhdr_buf;
struct ethhdr *ethhdr;
struct arphdr *arphdr;
unsigned short vid;
+ int vlan_depth = 0;
__be16 proto;
int headlen;
int ret;
@@@ -882,9 -878,24 +878,24 @@@
proto = ethhdr->h_proto;
headlen = ETH_HLEN;
if (vid & BATADV_VLAN_HAS_TAG) {
- vhdr = vlan_eth_hdr(skb);
- proto = vhdr->h_vlan_encapsulated_proto;
- headlen += VLAN_HLEN;
+ /* Traverse the VLAN/Ethertypes.
+ *
+ * At this point it is known that the first protocol is a VLAN
+ * header, so start checking at the encapsulated protocol.
+ *
+ * The depth of the VLAN headers is recorded to drop BLA claim
+ * frames encapsulated into multiple VLAN headers (QinQ).
+ */
+ do {
+ vhdr = skb_header_pointer(skb, headlen, VLAN_HLEN,
+ &vhdr_buf);
+ if (!vhdr)
+ return 0;
+
+ proto = vhdr->h_vlan_encapsulated_proto;
+ headlen += VLAN_HLEN;
+ vlan_depth++;
+ } while (proto == htons(ETH_P_8021Q));
}
if (proto != htons(ETH_P_ARP))
@@@ -914,6 -925,19 +925,19 @@@
hw_src = (uint8_t *)arphdr + sizeof(struct arphdr);
hw_dst = hw_src + ETH_ALEN + 4;
bla_dst = (struct batadv_bla_claim_dst *)hw_dst;
+ bla_dst_own = &bat_priv->bla.claim_dest;
+
+ /* check if it is a claim frame in general */
+ if (memcmp(bla_dst->magic, bla_dst_own->magic,
+ sizeof(bla_dst->magic)) != 0)
+ return 0;
+
+ /* check if there is a claim frame encapsulated deeper in (QinQ) and
+ * drop that, as this is not supported by BLA but should also not be
+ * sent via the mesh.
+ */
+ if (vlan_depth > 1)
+ return 1;
/* check if it is a claim frame. */
ret = batadv_check_claim_group(bat_priv, primary_if, hw_src, hw_dst,
--
linux integration
Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
>---------------------------------------------------------------
commit 11be1ac9cacdf843cdaaa0ae9f4dfe7206ac6d35
Author: Cong Wang <cwang(a)twopensource.com>
Date: Thu May 22 11:57:17 2014 -0700
batman-adv: fix a bogus warning from batadv_is_on_batman_iface()
batman tries to search dev->iflink to check if it's a batman interface,
but ->iflink could be 0, which is not a valid ifindex. It should just
avoid iflink == 0 case.
Reported-by: Jet Chen <jet.chen(a)intel.com>
Tested-by: Jet Chen <jet.chen(a)intel.com>
Cc: David S. Miller <davem(a)davemloft.net>
Cc: Steffen Klassert <steffen.klassert(a)secunet.com>
Cc: Antonio Quartulli <antonio(a)open-mesh.com>
Cc: Marek Lindner <mareklindner(a)neomailbox.ch>
Signed-off-by: Cong Wang <xiyou.wangcong(a)gmail.com>
Signed-off-by: Cong Wang <cwang(a)twopensource.com>
Signed-off-by: David S. Miller <davem(a)davemloft.net>
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
11be1ac9cacdf843cdaaa0ae9f4dfe7206ac6d35
hard-interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hard-interface.c b/hard-interface.c
index b851cc5..fbda6b5 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -83,7 +83,7 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev)
return true;
/* no more parents..stop recursion */
- if (net_dev->iflink == net_dev->ifindex)
+ if (net_dev->iflink == 0 || net_dev->iflink == net_dev->ifindex)
return false;
/* recurse over the parent device */
The annotated tag, v3.16-rc3 has been created
at dee9ef9e4858ca40b659cbec3204f3dd2ab4acca (tag)
tagging 4c834452aad01531db949414f94f817a86348d59 (commit)
replaces v3.16-rc2
tagged by Linus Torvalds
on Sun Jun 29 14:11:44 2014 -0700
- Shortlog ------------------------------------------------------------
Linux 3.16-rc3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAABAgAGBQJTsIEQAAoJEHm+PkMAQRiGPQgH/0Bs0Lw4MSnAMdS3B5Le8ZGp
9pFXZ3aK4jQErfA2spKtXDTRiQ9QOxzL6ZpDzrm36N98iX87402dPA+3wdea3HiK
LhPggj3d9hX8/L2yaBk7eY783NcPs2dTlqtLFx6k5UwGhZc1KmCcaDmZ4poI1yca
64pYT7zCCGSlKIbuiXoO5h/tTA0BzS+dAZZIsDVBHehXR4I37KTCDKQEn9V077P8
5+MLnyjvAgiDQ1+yHrTezdQHE2iKWJ1GDK11aTN85qzGt5fCWi5JlYwdLP/rC5wi
HcjPL/H+IgbZOhttnYmIE2yVJk7LPoRWwbf9LG5sKkBomqVe7Gh1GQKIYy69aOA=
=cfzs
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
Repository : ssh://git@open-mesh.org/batmand
On branch : master
>---------------------------------------------------------------
commit 3a1bed88a500d2fe857fa889a90c52340298979b
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Tue Jun 17 21:56:03 2014 +0200
batmand: Don't try to schedule_own_packet with no if_incoming
send_outstanding_packets checks if a forw_node has a correct if_incoming.
Otherwise it jumps to packet_free to deallocate the packet infrastructure. But
this also schedules packets with the batman interfaces as target incoming_if.
This is known to be NULL but is dereferenced in schedule_own_packet.
This NULL dereference should be avoided.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Elektra Wagenrad <onelektra(a)gmx.net>
>---------------------------------------------------------------
3a1bed88a500d2fe857fa889a90c52340298979b
schedule.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/schedule.c b/schedule.c
index 3e65d68..03cdb78 100644
--- a/schedule.c
+++ b/schedule.c
@@ -359,7 +359,7 @@ void send_outstanding_packets(uint32_t curr_time)
packet_free: list_del((struct list_head *)&forw_list, forw_pos, &forw_list);
- if (forw_node->own)
+ if (forw_node->own && forw_node->if_incoming)
schedule_own_packet(forw_node->if_incoming);
debugFree(forw_node->pack_buff, 1501);
Repository : ssh://git@open-mesh.org/batmand
On branch : master
>---------------------------------------------------------------
commit 0c2aa5e93522ade7f955e071a35e0c7b015a497b
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Tue Jun 17 21:56:00 2014 +0200
batmand: Fix bitarray 1 bit shift type
The default type of an integer constant is int. This reduced the possible bits
for a shift to 32. But the size of uintmax_t is most likely larger (64 bit).
Thus the upper 32 bit cannot be accessed correctly with this bitarray
implementation.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Elektra Wagenrad <onelektra(a)gmx.net>
>---------------------------------------------------------------
0c2aa5e93522ade7f955e071a35e0c7b015a497b
bitarray.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bitarray.c b/bitarray.c
index 133f6e7..354eddd 100644
--- a/bitarray.c
+++ b/bitarray.c
@@ -49,7 +49,7 @@ uint8_t get_bit_status( TYPE_OF_WORD *seq_bits, uint16_t last_seqno, uint16_t cu
word_offset= ( last_seqno - curr_seqno ) % WORD_BIT_SIZE; /* which position in the selected word */
word_num = ( last_seqno - curr_seqno ) / WORD_BIT_SIZE; /* which word */
- if ( seq_bits[word_num] & 1<<word_offset ) /* get position status */
+ if ( seq_bits[word_num] & (1ULL << word_offset)) /* get position status */
return 1;
else
return 0;
@@ -72,7 +72,7 @@ void bit_mark( TYPE_OF_WORD *seq_bits, int32_t n ) {
word_offset= n%WORD_BIT_SIZE; /* which position in the selected word */
word_num = n/WORD_BIT_SIZE; /* which word */
- seq_bits[word_num]|= 1<<word_offset; /* turn the position on */
+ seq_bits[word_num] |= 1ULL << word_offset; /* turn the position on */
}
/* shift the packet array p by n places. */
Repository : ssh://git@open-mesh.org/batmand
On branch : master
>---------------------------------------------------------------
commit 4de9e4b5b707631d065571a437391c2a0de11052
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Tue Jun 17 21:56:01 2014 +0200
batmand: Free socket when setsockopt failed
client_to_gw_tun calls setsockopt which can fail. In this case it jumps to the
error handling and cleanup code but doesn't close the udp_sock. This has to be
done to avoid leaking of file descriptors.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Elektra Wagenrad <onelektra(a)gmx.net>
>---------------------------------------------------------------
4de9e4b5b707631d065571a437391c2a0de11052
posix/tunnel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/posix/tunnel.c b/posix/tunnel.c
index 08c56a2..8e7611b 100644
--- a/posix/tunnel.c
+++ b/posix/tunnel.c
@@ -201,7 +201,7 @@ void *client_to_gw_tun(void *arg)
sock_opts = 1;
if (setsockopt(udp_sock, SOL_SOCKET, SO_REUSEADDR, &sock_opts, sizeof(sock_opts)) < 0) {
debug_output(0, "Error - can't set options on udp socket: %s\n", strerror(errno));
- goto out;
+ goto udp_out;
}
if (bind(udp_sock, (struct sockaddr *)&my_addr, sizeof(struct sockaddr_in)) < 0) {
Repository : ssh://git@open-mesh.org/batmand
On branch : master
>---------------------------------------------------------------
commit f2841283a3357c895b5d88c0b3be84b0dab6c665
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Tue Jun 17 21:56:02 2014 +0200
batmand: Don't cause NULL ptr dereference when searching through HNAs
The _hna_global_add function searches through the list of HNAs to check if
there is already a hna for this orig pointer. Otherwise it is automatically
allocated.
This was implemented by setting hna_orig_ptr to NULL after the comparison. This
will most likely crash the program because the list_for_each_entry
implementation uses hna_orig_ptr to find the next entry before doing the loop
condition check. The next entry cannot be found by dereferencing NULL+epsilon.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Elektra Wagenrad <onelektra(a)gmx.net>
>---------------------------------------------------------------
f2841283a3357c895b5d88c0b3be84b0dab6c665
hna.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hna.c b/hna.c
index f0d64e1..0f28bfe 100644
--- a/hna.c
+++ b/hna.c
@@ -322,6 +322,7 @@ static void _hna_global_add(struct orig_node *orig_node, struct hna_element *hna
struct hna_orig_ptr *hna_orig_ptr = NULL;
struct orig_node *old_orig_node = NULL;
struct hashtable_t *swaphash;
+ int found = 0;
hna_global_entry = ((struct hna_global_entry *)hash_find(hna_global_hash, hna_element));
@@ -354,14 +355,14 @@ static void _hna_global_add(struct orig_node *orig_node, struct hna_element *hna
return;
list_for_each_entry(hna_orig_ptr, &hna_global_entry->orig_list, list) {
- if (hna_orig_ptr->orig_node == orig_node)
+ if (hna_orig_ptr->orig_node == orig_node) {
+ found = 1;
break;
-
- hna_orig_ptr = NULL;
+ }
}
/* append the given orig node to the list */
- if (!hna_orig_ptr) {
+ if (!found) {
hna_orig_ptr = debugMalloc(sizeof(struct hna_orig_ptr), 704);
if (!hna_orig_ptr)