The following commit has been merged in the merge/master branch: commit ff6511646a6c127ed472de2f92cfeeeb4fa3d19c Merge: cba8a50e21d0676e73c7fc4bee3bd32d518c3cd7 46b165b1793c47c1384fa2bac026ee50f5f54eb2 Author: Antonio Quartulli antonio@meshcoding.com Date: Thu Jan 2 21:57:55 2014 +0100
Merge commit '46b165b1793c47c1384fa2bac026ee50f5f54eb2' into merge/master
Conflicts: net/batman-adv/compat.h
diff --combined net/batman-adv/main.c index 945e441,ad6aeed..ad6aeed --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c @@@ -419,13 -419,23 +419,23 @@@ static void batadv_recv_handler_init(vo for (i = BATADV_UNICAST_MIN; i <= BATADV_UNICAST_MAX; i++) batadv_rx_handler[i] = batadv_recv_unhandled_unicast_packet;
- /* compile time checks for struct member offsets */ - BUILD_BUG_ON(offsetof(struct batadv_unicast_4addr_packet, src) != 10); - BUILD_BUG_ON(offsetof(struct batadv_unicast_packet, dest) != 4); - BUILD_BUG_ON(offsetof(struct batadv_unicast_tvlv_packet, dst) != 4); - BUILD_BUG_ON(offsetof(struct batadv_frag_packet, dest) != 4); - BUILD_BUG_ON(offsetof(struct batadv_icmp_packet, dst) != 4); - BUILD_BUG_ON(offsetof(struct batadv_icmp_packet_rr, dst) != 4); + /* compile time checks for sizes */ + BUILD_BUG_ON(sizeof(struct batadv_bla_claim_dst) != 6); + BUILD_BUG_ON(sizeof(struct batadv_ogm_packet) != 24); + BUILD_BUG_ON(sizeof(struct batadv_icmp_header) != 20); + BUILD_BUG_ON(sizeof(struct batadv_icmp_packet) != 20); + BUILD_BUG_ON(sizeof(struct batadv_icmp_packet_rr) != 116); + BUILD_BUG_ON(sizeof(struct batadv_unicast_packet) != 10); + BUILD_BUG_ON(sizeof(struct batadv_unicast_4addr_packet) != 18); + BUILD_BUG_ON(sizeof(struct batadv_frag_packet) != 20); + BUILD_BUG_ON(sizeof(struct batadv_bcast_packet) != 14); + BUILD_BUG_ON(sizeof(struct batadv_coded_packet) != 46); + BUILD_BUG_ON(sizeof(struct batadv_unicast_tvlv_packet) != 20); + BUILD_BUG_ON(sizeof(struct batadv_tvlv_hdr) != 4); + BUILD_BUG_ON(sizeof(struct batadv_tvlv_gateway_data) != 8); + BUILD_BUG_ON(sizeof(struct batadv_tvlv_tt_vlan_data) != 8); + BUILD_BUG_ON(sizeof(struct batadv_tvlv_tt_change) != 12); + BUILD_BUG_ON(sizeof(struct batadv_tvlv_roam_adv) != 8);
/* broadcast packet */ batadv_rx_handler[BATADV_BCAST] = batadv_recv_bcast_packet; diff --combined net/batman-adv/originator.c index 2243003,4a5d027..4a5d027 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@@ -783,14 -783,19 +783,19 @@@ batadv_find_best_neighbor(struct batadv struct batadv_algo_ops *bao = bat_priv->bat_algo_ops;
rcu_read_lock(); - hlist_for_each_entry_rcu(neigh, &orig_node->neigh_list, list) - if (!best || - (bao->bat_neigh_cmp(neigh, if_outgoing, - best, if_outgoing) <= 0)) - best = neigh; - - if (!atomic_inc_not_zero(&best->refcount)) - best = NULL; + hlist_for_each_entry_rcu(neigh, &orig_node->neigh_list, list) { + if (best && (bao->bat_neigh_cmp(neigh, if_outgoing, + best, if_outgoing) <= 0)) + continue; + + if (!atomic_inc_not_zero(&neigh->refcount)) + continue; + + if (best) + batadv_neigh_node_free_ref(best); + + best = neigh; + } rcu_read_unlock();
return best; diff --combined net/batman-adv/soft-interface.c index 2190466,2f1e843..2f1e843 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@@ -351,6 -351,11 +351,11 @@@ void batadv_interface_rx(struct net_dev skb_pull_rcsum(skb, hdr_size); skb_reset_mac_header(skb);
+ /* clean the netfilter state now that the batman-adv header has been + * removed + */ + nf_reset(skb); + vid = batadv_get_vid(skb, hdr_size); ethhdr = eth_hdr(skb);
@@@ -412,14 -417,6 +417,6 @@@ goto dropped; }
- /* Clean the netfilter state before delivering the skb. - * This packet may have traversed a bridge when it was encapsulated into - * the batman header. Now that the header has been removed, the - * netfilter state must be cleaned up to avoid to mess up with a - * possible second bridge - */ - batadv_nf_bridge_skb_free(skb); - netif_rx(skb); goto out;
diff --combined net/batman-adv/soft-interface.h index 1b79c2e,4ab0167..4ab0167 --- a/net/batman-adv/soft-interface.h +++ b/net/batman-adv/soft-interface.h @@@ -31,20 -31,4 +31,4 @@@ void batadv_softif_vlan_free_ref(struc struct batadv_softif_vlan *batadv_softif_vlan_get(struct batadv_priv *bat_priv, unsigned short vid);
- #ifdef CONFIG_BRIDGE_NETFILTER - /** - * batadv_nf_bridge_skb_free - clean the NF bridge data in an skb - * @skb: the skb which nf data has to be free'd - */ - static inline void batadv_nf_bridge_skb_free(struct sk_buff *skb) - { - nf_bridge_put(skb->nf_bridge); - skb->nf_bridge = NULL; - } - #else - static inline void batadv_nf_bridge_skb_free(struct sk_buff *skb) - { - } - #endif /* CONFIG_BRIDGE_NETFILTER */ - #endif /* _NET_BATMAN_ADV_SOFT_INTERFACE_H_ */