Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit 3e54c9219b965a7f6e54a5241ec8e546a1ca95c6 Merge: c71c622 2535f8c Author: Marek Lindner mareklindner@neomailbox.ch Date: Wed Jun 17 18:57:14 2015 +0800
Merge branch 'next'
Conflicts: net/batman-adv/multicast.c net/batman-adv/types.h
3e54c9219b965a7f6e54a5241ec8e546a1ca95c6 net/batman-adv/distributed-arp-table.c | 4 +- net/batman-adv/multicast.c | 68 ++++++++++++++++++++++++-------- net/batman-adv/network-coding.c | 4 +- net/batman-adv/originator.c | 4 ++ net/batman-adv/translation-table.c | 4 +- net/batman-adv/types.h | 7 +++- 6 files changed, 67 insertions(+), 24 deletions(-)
diff --cc net/batman-adv/distributed-arp-table.c index 910b057,b9312bc..dc1191a --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@@ -709,13 -708,14 +709,13 @@@ void batadv_dat_status_update(struct ne */ static void batadv_dat_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv, struct batadv_orig_node *orig, - uint8_t flags, - void *tvlv_value, - uint16_t tvlv_value_len) + u8 flags, + void *tvlv_value, u16 tvlv_value_len) { if (flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND) - orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_DAT; + clear_bit(BATADV_ORIG_CAPA_HAS_DAT, &orig->capabilities); else - orig->capabilities |= BATADV_ORIG_CAPA_HAS_DAT; + set_bit(BATADV_ORIG_CAPA_HAS_DAT, &orig->capabilities); }
/** diff --cc net/batman-adv/multicast.c index 9f455ce,9e2a853..2fa9983 --- a/net/batman-adv/multicast.c +++ b/net/batman-adv/multicast.c @@@ -591,8 -593,11 +593,11 @@@ batadv_mcast_forw_mode(struct batadv_pr */ static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv, struct batadv_orig_node *orig, - uint8_t mcast_flags) + u8 mcast_flags) { + struct hlist_node *node = &orig->mcast_want_all_unsnoopables_node; + struct hlist_head *head = &bat_priv->mcast.want_all_unsnoopables_list; + /* switched from flag unset to set */ if (mcast_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES && !(orig->mcast_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES)) { @@@ -624,8 -636,11 +636,11 @@@ */ static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv, struct batadv_orig_node *orig, - uint8_t mcast_flags) + u8 mcast_flags) { + struct hlist_node *node = &orig->mcast_want_all_ipv4_node; + struct hlist_head *head = &bat_priv->mcast.want_all_ipv4_list; + /* switched from flag unset to set */ if (mcast_flags & BATADV_MCAST_WANT_ALL_IPV4 && !(orig->mcast_flags & BATADV_MCAST_WANT_ALL_IPV4)) { @@@ -657,8 -679,11 +679,11 @@@ */ static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv, struct batadv_orig_node *orig, - uint8_t mcast_flags) + u8 mcast_flags) { + struct hlist_node *node = &orig->mcast_want_all_ipv6_node; + struct hlist_head *head = &bat_priv->mcast.want_all_ipv6_list; + /* switched from flag unset to set */ if (mcast_flags & BATADV_MCAST_WANT_ALL_IPV6 && !(orig->mcast_flags & BATADV_MCAST_WANT_ALL_IPV6)) { @@@ -689,14 -719,19 +719,19 @@@ */ static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv, struct batadv_orig_node *orig, - uint8_t flags, + u8 flags, void *tvlv_value, - uint16_t tvlv_value_len) + u16 tvlv_value_len) { bool orig_mcast_enabled = !(flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND); - uint8_t mcast_flags = BATADV_NO_FLAGS; + u8 mcast_flags = BATADV_NO_FLAGS; bool orig_initialized;
+ if (orig_mcast_enabled && tvlv_value && + (tvlv_value_len >= sizeof(mcast_flags))) - mcast_flags = *(uint8_t *)tvlv_value; ++ mcast_flags = *(u8 *)tvlv_value; + + spin_lock_bh(&orig->mcast_handler_lock); orig_initialized = orig->capa_initialized & BATADV_ORIG_CAPA_HAS_MCAST;
/* If mcast support is turned on decrease the disabled mcast node diff --cc net/batman-adv/network-coding.c index c06ed56,1686d19..9d8d6a9 --- a/net/batman-adv/network-coding.c +++ b/net/batman-adv/network-coding.c @@@ -129,13 -129,14 +129,13 @@@ void batadv_nc_status_update(struct net */ static void batadv_nc_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv, struct batadv_orig_node *orig, - uint8_t flags, - void *tvlv_value, - uint16_t tvlv_value_len) + u8 flags, + void *tvlv_value, u16 tvlv_value_len) { if (flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND) - orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_NC; + clear_bit(BATADV_ORIG_CAPA_HAS_NC, &orig->capabilities); else - orig->capabilities |= BATADV_ORIG_CAPA_HAS_NC; + set_bit(BATADV_ORIG_CAPA_HAS_NC, &orig->capabilities); }
/** diff --cc net/batman-adv/types.h index cd7c6d6,d587a53..da4c738 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h @@@ -268,16 -269,18 +269,18 @@@ struct batadv_orig_node unsigned long last_seen; unsigned long bcast_seqno_reset; #ifdef CONFIG_BATMAN_ADV_MCAST + /* synchronizes mcast tvlv specific orig changes */ + spinlock_t mcast_handler_lock; - uint8_t mcast_flags; + u8 mcast_flags; struct hlist_node mcast_want_all_unsnoopables_node; struct hlist_node mcast_want_all_ipv4_node; struct hlist_node mcast_want_all_ipv6_node; #endif - u8 capabilities; - u8 capa_initialized; + unsigned long capabilities; + unsigned long capa_initialized; atomic_t last_ttvn; unsigned char *tt_buff; - int16_t tt_buff_len; + s16 tt_buff_len; spinlock_t tt_buff_lock; /* protects tt_buff & tt_buff_len */ /* prevents from changing the table while reading it */ spinlock_t tt_lock;