Failed check next types.h
by postmaster@open-mesh.org
ERROR: need consistent spacing around '*' (ctx:WxV)
#70: FILE: types.h:70:
+ struct neigh_node __rcu *router; /* rcu protected pointer */
^
ERROR: need consistent spacing around '*' (ctx:WxV)
#203: FILE: types.h:203:
+ struct gw_node __rcu *curr_gw; /* rcu protected pointer */
^
ERROR: need consistent spacing around '*' (ctx:WxV)
#205: FILE: types.h:205:
+ struct hard_iface __rcu *primary_if; /* rcu protected pointer */
^
ERROR: need consistent spacing around '*' (ctx:WxV)
#332: FILE: types.h:332:
+ struct softif_neigh __rcu *softif_neigh;
^
total: 4 errors, 0 warnings, 0 checks, 345 lines checked
types.h has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11 years, 6 months
Failed check master types.h
by postmaster@open-mesh.org
ERROR: need consistent spacing around '*' (ctx:WxV)
#70: FILE: types.h:70:
+ struct neigh_node __rcu *router; /* rcu protected pointer */
^
ERROR: need consistent spacing around '*' (ctx:WxV)
#204: FILE: types.h:204:
+ struct gw_node __rcu *curr_gw; /* rcu protected pointer */
^
ERROR: need consistent spacing around '*' (ctx:WxV)
#206: FILE: types.h:206:
+ struct hard_iface __rcu *primary_if; /* rcu protected pointer */
^
ERROR: need consistent spacing around '*' (ctx:WxV)
#333: FILE: types.h:333:
+ struct softif_neigh __rcu *softif_neigh;
^
total: 4 errors, 0 warnings, 0 checks, 346 lines checked
types.h has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11 years, 6 months
Noticed difference in packet.h in master.diff
by postmaster@open-mesh.org
--- batman-adv_master.packet.h 2011-07-26 00:15:01.000000000 +0200
+++ batctl_master.packet.h 2011-07-26 00:15:01.000000000 +0200
@@ -84,7 +84,6 @@
enum tt_client_flags {
TT_CLIENT_DEL = 1 << 0,
TT_CLIENT_ROAM = 1 << 1,
- TT_CLIENT_WIFI = 1 << 2,
TT_CLIENT_NOPURGE = 1 << 8,
TT_CLIENT_NEW = 1 << 9,
TT_CLIENT_PENDING = 1 << 10
11 years, 6 months
[linux-next] LinuxNextTracking branch, master, updated. next-20110716
by batman@open-mesh.org
The following commit has been merged in the master branch:
commit e2270ea62ae4d7a47d6d72942cdb8c669be6357a
Author: David S. Miller <davem(a)davemloft.net>
Date: Tue Jul 12 10:37:21 2011 -0700
netdevice: Kill 'feature' test macros.
Almost all of these have long outstayed their welcome.
And for every one of these macros, there are 10 features for which we
didn't add macros.
Let's just delete them all, and get out of habit of doing things this
way.
Signed-off-by: David S. Miller <davem(a)davemloft.net>
Acked-by: Stephen Hemminger <shemminger(a)vyatta.com>
Acked-by: Arnd Bergmann <arnd(a)arndb.de>
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index 8a6f891..3942a82 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -2421,7 +2421,6 @@ static int __devinit enable_msix(struct adapter *adapter)
return err;
}
-#ifdef HAVE_NET_DEVICE_OPS
static const struct net_device_ops cxgb4vf_netdev_ops = {
.ndo_open = cxgb4vf_open,
.ndo_stop = cxgb4vf_stop,
@@ -2437,7 +2436,6 @@ static const struct net_device_ops cxgb4vf_netdev_ops = {
.ndo_poll_controller = cxgb4vf_poll_controller,
#endif
};
-#endif
/*
* "Probe" a device: initialize a device and construct all kernel and driver
@@ -2611,22 +2609,7 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
if (pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA;
-#ifdef HAVE_NET_DEVICE_OPS
netdev->netdev_ops = &cxgb4vf_netdev_ops;
-#else
- netdev->vlan_rx_register = cxgb4vf_vlan_rx_register;
- netdev->open = cxgb4vf_open;
- netdev->stop = cxgb4vf_stop;
- netdev->hard_start_xmit = t4vf_eth_xmit;
- netdev->get_stats = cxgb4vf_get_stats;
- netdev->set_rx_mode = cxgb4vf_set_rxmode;
- netdev->do_ioctl = cxgb4vf_do_ioctl;
- netdev->change_mtu = cxgb4vf_change_mtu;
- netdev->set_mac_address = cxgb4vf_set_mac_addr;
-#ifdef CONFIG_NET_POLL_CONTROLLER
- netdev->poll_controller = cxgb4vf_poll_controller;
-#endif
-#endif
SET_ETHTOOL_OPS(netdev, &cxgb4vf_ethtool_ops);
/*
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
index b0a4211..3f303ea 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
@@ -671,7 +671,6 @@ static int ft1000_reset_card(struct net_device *dev)
return TRUE;
}
-#ifdef HAVE_NET_DEVICE_OPS
static const struct net_device_ops ftnet_ops =
{
.ndo_open = &ft1000_open,
@@ -679,7 +678,6 @@ static const struct net_device_ops ftnet_ops =
.ndo_start_xmit = &ft1000_start_xmit,
.ndo_get_stats = &ft1000_netdev_stats,
};
-#endif
//---------------------------------------------------------------------------
@@ -764,14 +762,7 @@ int init_ft1000_netdev(struct ft1000_device *ft1000dev)
INIT_LIST_HEAD(&pInfo->nodes.list);
-#ifdef HAVE_NET_DEVICE_OPS
netdev->netdev_ops = &ftnet_ops;
-#else
- netdev->hard_start_xmit = &ft1000_start_xmit;
- netdev->get_stats = &ft1000_netdev_stats;
- netdev->open = &ft1000_open;
- netdev->stop = &ft1000_close;
-#endif
ft1000dev->net = netdev;
diff --git a/drivers/staging/wlags49_h2/wl_internal.h b/drivers/staging/wlags49_h2/wl_internal.h
index cd129b3..e86aad5 100644
--- a/drivers/staging/wlags49_h2/wl_internal.h
+++ b/drivers/staging/wlags49_h2/wl_internal.h
@@ -990,14 +990,7 @@ struct wl_private
#endif // USE_WDS
}; // wl_private
-#ifdef HAVE_NETDEV_PRIV
#define wl_priv(dev) ((struct wl_private *) netdev_priv(dev))
-#else
-extern inline struct wl_private *wl_priv(struct net_device *dev)
-{
- return dev->priv;
-}
-#endif
/********************************************************************/
/* Locking and synchronization functions */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 011eb89..30f17e4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -60,11 +60,6 @@ struct wireless_dev;
#define SET_ETHTOOL_OPS(netdev,ops) \
( (netdev)->ethtool_ops = (ops) )
-#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
- functions are available. */
-#define HAVE_FREE_NETDEV /* free_netdev() */
-#define HAVE_NETDEV_PRIV /* netdev_priv() */
-
/* hardware address assignment types */
#define NET_ADDR_PERM 0 /* address is permanent (default) */
#define NET_ADDR_RANDOM 1 /* address is generated randomly */
@@ -313,7 +308,6 @@ struct header_ops {
const void *saddr, unsigned len);
int (*parse)(const struct sk_buff *skb, unsigned char *haddr);
int (*rebuild)(struct sk_buff *skb);
-#define HAVE_HEADER_CACHE
int (*cache)(const struct neighbour *neigh, struct hh_cache *hh);
void (*cache_update)(struct hh_cache *hh,
const struct net_device *dev,
@@ -887,7 +881,6 @@ struct netdev_tc_txq {
* Must return >0 or -errno if it changed dev->features itself.
*
*/
-#define HAVE_NET_DEVICE_OPS
struct net_device_ops {
int (*ndo_init)(struct net_device *dev);
void (*ndo_uninit)(struct net_device *dev);
@@ -1781,8 +1774,6 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd,
DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
-#define HAVE_NETIF_QUEUE
-
extern void __netif_schedule(struct Qdisc *q);
static inline void netif_schedule_queue(struct netdev_queue *txq)
@@ -2058,10 +2049,8 @@ extern void dev_kfree_skb_irq(struct sk_buff *skb);
*/
extern void dev_kfree_skb_any(struct sk_buff *skb);
-#define HAVE_NETIF_RX 1
extern int netif_rx(struct sk_buff *skb);
extern int netif_rx_ni(struct sk_buff *skb);
-#define HAVE_NETIF_RECEIVE_SKB 1
extern int netif_receive_skb(struct sk_buff *skb);
extern gro_result_t dev_gro_receive(struct napi_struct *napi,
struct sk_buff *skb);
@@ -2241,7 +2230,6 @@ extern void netif_device_attach(struct net_device *dev);
/*
* Network interface message level settings
*/
-#define HAVE_NETIF_MSG 1
enum {
NETIF_MSG_DRV = 0x0001,
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 3f20332..3e2f91f 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -750,7 +750,6 @@ out:
return;
}
-#ifdef HAVE_NET_DEVICE_OPS
static const struct net_device_ops bat_netdev_ops = {
.ndo_open = interface_open,
.ndo_stop = interface_release,
@@ -760,7 +759,6 @@ static const struct net_device_ops bat_netdev_ops = {
.ndo_start_xmit = interface_tx,
.ndo_validate_addr = eth_validate_addr
};
-#endif
static void interface_setup(struct net_device *dev)
{
@@ -769,16 +767,7 @@ static void interface_setup(struct net_device *dev)
ether_setup(dev);
-#ifdef HAVE_NET_DEVICE_OPS
dev->netdev_ops = &bat_netdev_ops;
-#else
- dev->open = interface_open;
- dev->stop = interface_release;
- dev->get_stats = interface_stats;
- dev->set_mac_address = interface_set_mac_addr;
- dev->change_mtu = interface_change_mtu;
- dev->hard_start_xmit = interface_tx;
-#endif
dev->destructor = free_netdev;
dev->tx_queue_len = 0;
@@ -885,13 +874,8 @@ void softif_destroy(struct net_device *soft_iface)
int softif_is_valid(const struct net_device *net_dev)
{
-#ifdef HAVE_NET_DEVICE_OPS
if (net_dev->netdev_ops->ndo_start_xmit == interface_tx)
return 1;
-#else
- if (net_dev->hard_start_xmit == interface_tx)
- return 1;
-#endif
return 0;
}
--
LinuxNextTracking
11 years, 6 months
[linux-next] LinuxNextTracking branch, master, updated. next-20110716
by batman@open-mesh.org
The following commit has been merged in the master branch:
commit 058d0e26989e3da2fa031f551235f6ff1e0bc27c
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Thu Jul 7 01:40:58 2011 +0200
batman-adv: keep local table consistency for further TT_RESPONSE
To keep transtable consistency among all the nodes, an originator must
not send not yet announced clients within a full table TT_RESPONSE.
Instead, deleted client have to be kept in the table in order to be sent
within an immediate TT_RESPONSE. In this way all the nodes in the
network will always provide the same response for the same request.
All the modification are committed at the next ttvn increment event.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h
index 590e4a6..b76b4be 100644
--- a/net/batman-adv/packet.h
+++ b/net/batman-adv/packet.h
@@ -84,7 +84,9 @@ enum tt_query_flags {
enum tt_client_flags {
TT_CLIENT_DEL = 1 << 0,
TT_CLIENT_ROAM = 1 << 1,
- TT_CLIENT_NOPURGE = 1 << 8
+ TT_CLIENT_NOPURGE = 1 << 8,
+ TT_CLIENT_NEW = 1 << 9,
+ TT_CLIENT_PENDING = 1 << 10
};
struct batman_packet {
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 4b8e11b..58d1447 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -309,10 +309,8 @@ void schedule_own_packet(struct hard_iface *hard_iface)
if (hard_iface == primary_if) {
/* if at least one change happened */
if (atomic_read(&bat_priv->tt_local_changes) > 0) {
+ tt_commit_changes(bat_priv);
prepare_packet_buffer(bat_priv, hard_iface);
- /* Increment the TTVN only once per OGM interval */
- atomic_inc(&bat_priv->ttvn);
- bat_priv->tt_poss_change = false;
}
/* if the changes have been sent enough times */
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 06d361d..7cc67c0 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -215,11 +215,14 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr)
tt_local_event(bat_priv, addr, tt_local_entry->flags);
+ /* The local entry has to be marked as NEW to avoid to send it in
+ * a full table response going out before the next ttvn increment
+ * (consistency check) */
+ tt_local_entry->flags |= TT_CLIENT_NEW;
+
hash_add(bat_priv->tt_local_hash, compare_ltt, choose_orig,
tt_local_entry, &tt_local_entry->hash_entry);
- atomic_inc(&bat_priv->num_local_tt);
-
/* remove address from global hash if present */
tt_global_entry = tt_global_hash_find(bat_priv, addr);
@@ -358,19 +361,17 @@ out:
return ret;
}
-static void tt_local_del(struct bat_priv *bat_priv,
- struct tt_local_entry *tt_local_entry,
- const char *message)
+static void tt_local_set_pending(struct bat_priv *bat_priv,
+ struct tt_local_entry *tt_local_entry,
+ uint16_t flags)
{
- bat_dbg(DBG_TT, bat_priv, "Deleting local tt entry (%pM): %s\n",
- tt_local_entry->addr, message);
-
- atomic_dec(&bat_priv->num_local_tt);
-
- hash_remove(bat_priv->tt_local_hash, compare_ltt, choose_orig,
- tt_local_entry->addr);
+ tt_local_event(bat_priv, tt_local_entry->addr,
+ tt_local_entry->flags | flags);
- tt_local_entry_free_ref(tt_local_entry);
+ /* The local client has to be merked as "pending to be removed" but has
+ * to be kept in the table in order to send it in an full tables
+ * response issued before the net ttvn increment (consistency check) */
+ tt_local_entry->flags |= TT_CLIENT_PENDING;
}
void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
@@ -379,14 +380,14 @@ void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
struct tt_local_entry *tt_local_entry = NULL;
tt_local_entry = tt_local_hash_find(bat_priv, addr);
-
if (!tt_local_entry)
goto out;
- tt_local_event(bat_priv, tt_local_entry->addr,
- tt_local_entry->flags | TT_CLIENT_DEL |
- (roaming ? TT_CLIENT_ROAM : NO_FLAGS));
- tt_local_del(bat_priv, tt_local_entry, message);
+ tt_local_set_pending(bat_priv, tt_local_entry, TT_CLIENT_DEL |
+ (roaming ? TT_CLIENT_ROAM : NO_FLAGS));
+
+ bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) pending to be removed: "
+ "%s\n", tt_local_entry->addr, message);
out:
if (tt_local_entry)
tt_local_entry_free_ref(tt_local_entry);
@@ -411,18 +412,19 @@ static void tt_local_purge(struct bat_priv *bat_priv)
if (tt_local_entry->flags & TT_CLIENT_NOPURGE)
continue;
+ /* entry already marked for deletion */
+ if (tt_local_entry->flags & TT_CLIENT_PENDING)
+ continue;
+
if (!is_out_of_time(tt_local_entry->last_seen,
TT_LOCAL_TIMEOUT * 1000))
continue;
- tt_local_event(bat_priv, tt_local_entry->addr,
- tt_local_entry->flags | TT_CLIENT_DEL);
- atomic_dec(&bat_priv->num_local_tt);
- bat_dbg(DBG_TT, bat_priv, "Deleting local "
- "tt entry (%pM): timed out\n",
+ tt_local_set_pending(bat_priv, tt_local_entry,
+ TT_CLIENT_DEL);
+ bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) "
+ "pending to be removed: timed out\n",
tt_local_entry->addr);
- hlist_del_rcu(node);
- tt_local_entry_free_ref(tt_local_entry);
}
spin_unlock_bh(list_lock);
}
@@ -846,6 +848,10 @@ uint16_t tt_local_crc(struct bat_priv *bat_priv)
rcu_read_lock();
hlist_for_each_entry_rcu(tt_local_entry, node,
head, hash_entry) {
+ /* not yet committed clients have not to be taken into
+ * account while computing the CRC */
+ if (tt_local_entry->flags & TT_CLIENT_NEW)
+ continue;
total_one = 0;
for (j = 0; j < ETH_ALEN; j++)
total_one = crc16_byte(total_one,
@@ -935,6 +941,16 @@ unlock:
return tt_req_node;
}
+/* data_ptr is useless here, but has to be kept to respect the prototype */
+static int tt_local_valid_entry(const void *entry_ptr, const void *data_ptr)
+{
+ const struct tt_local_entry *tt_local_entry = entry_ptr;
+
+ if (tt_local_entry->flags & TT_CLIENT_NEW)
+ return 0;
+ return 1;
+}
+
static int tt_global_valid_entry(const void *entry_ptr, const void *data_ptr)
{
const struct tt_global_entry *tt_global_entry = entry_ptr;
@@ -1275,7 +1291,8 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
skb = tt_response_fill_table(tt_len, ttvn,
bat_priv->tt_local_hash,
- primary_if, NULL, NULL);
+ primary_if, tt_local_valid_entry,
+ NULL);
if (!skb)
goto out;
@@ -1400,6 +1417,10 @@ bool is_my_client(struct bat_priv *bat_priv, const uint8_t *addr)
tt_local_entry = tt_local_hash_find(bat_priv, addr);
if (!tt_local_entry)
goto out;
+ /* Check if the client has been logically deleted (but is kept for
+ * consistency purpose) */
+ if (tt_local_entry->flags & TT_CLIENT_PENDING)
+ goto out;
ret = true;
out:
if (tt_local_entry)
@@ -1620,3 +1641,76 @@ void tt_free(struct bat_priv *bat_priv)
kfree(bat_priv->tt_buff);
}
+
+/* This function will reset the specified flags from all the entries in
+ * the given hash table and will increment num_local_tt for each involved
+ * entry */
+static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags)
+{
+ int i;
+ struct hashtable_t *hash = bat_priv->tt_local_hash;
+ struct hlist_head *head;
+ struct hlist_node *node;
+ struct tt_local_entry *tt_local_entry;
+
+ if (!hash)
+ return;
+
+ for (i = 0; i < hash->size; i++) {
+ head = &hash->table[i];
+
+ rcu_read_lock();
+ hlist_for_each_entry_rcu(tt_local_entry, node,
+ head, hash_entry) {
+ tt_local_entry->flags &= ~flags;
+ atomic_inc(&bat_priv->num_local_tt);
+ }
+ rcu_read_unlock();
+ }
+
+}
+
+/* Purge out all the tt local entries marked with TT_CLIENT_PENDING */
+static void tt_local_purge_pending_clients(struct bat_priv *bat_priv)
+{
+ struct hashtable_t *hash = bat_priv->tt_local_hash;
+ struct tt_local_entry *tt_local_entry;
+ struct hlist_node *node, *node_tmp;
+ struct hlist_head *head;
+ spinlock_t *list_lock; /* protects write access to the hash lists */
+ int i;
+
+ if (!hash)
+ return;
+
+ for (i = 0; i < hash->size; i++) {
+ head = &hash->table[i];
+ list_lock = &hash->list_locks[i];
+
+ spin_lock_bh(list_lock);
+ hlist_for_each_entry_safe(tt_local_entry, node, node_tmp,
+ head, hash_entry) {
+ if (!(tt_local_entry->flags & TT_CLIENT_PENDING))
+ continue;
+
+ bat_dbg(DBG_TT, bat_priv, "Deleting local tt entry "
+ "(%pM): pending\n", tt_local_entry->addr);
+
+ atomic_dec(&bat_priv->num_local_tt);
+ hlist_del_rcu(node);
+ tt_local_entry_free_ref(tt_local_entry);
+ }
+ spin_unlock_bh(list_lock);
+ }
+
+}
+
+void tt_commit_changes(struct bat_priv *bat_priv)
+{
+ tt_local_reset_flags(bat_priv, TT_CLIENT_NEW);
+ tt_local_purge_pending_clients(bat_priv);
+
+ /* Increment the TTVN only once per OGM interval */
+ atomic_inc(&bat_priv->ttvn);
+ bat_priv->tt_poss_change = false;
+}
diff --git a/net/batman-adv/translation-table.h b/net/batman-adv/translation-table.h
index 460e583..d4122cb 100644
--- a/net/batman-adv/translation-table.h
+++ b/net/batman-adv/translation-table.h
@@ -61,5 +61,6 @@ void handle_tt_response(struct bat_priv *bat_priv,
struct tt_query_packet *tt_response);
void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
struct orig_node *orig_node);
+void tt_commit_changes(struct bat_priv *bat_priv);
#endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */
--
LinuxNextTracking
11 years, 6 months
[linux-next] LinuxNextTracking branch, master, updated. next-20110716
by batman@open-mesh.org
The following commit has been merged in the master branch:
commit a7f9becb7d27008af0f72f8449c110276b0df37d
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Thu Jul 7 14:24:34 2011 +0200
batman-adv: request the full table if tt_crc doesn't match
In case of tt_crc mismatching for a certain orig_node after applying the
changes, the node must request the full table immediately.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 2cb98be..0f32c81 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -91,6 +91,18 @@ static void update_transtable(struct bat_priv *bat_priv,
* to recompute it to spot any possible inconsistency
* in the global table */
orig_node->tt_crc = tt_global_crc(bat_priv, orig_node);
+
+ /* The ttvn alone is not enough to guarantee consistency
+ * because a single value could repesent different states
+ * (due to the wrap around). Thus a node has to check whether
+ * the resulting table (after applying the changes) is still
+ * consistent or not. E.g. a node could disconnect while its
+ * ttvn is X and reconnect on ttvn = X + TTVN_MAX: in this case
+ * checking the CRC value is mandatory to detect the
+ * inconsistency */
+ if (orig_node->tt_crc != tt_crc)
+ goto request_table;
+
/* Roaming phase is over: tables are in sync again. I can
* unset the flag */
orig_node->tt_poss_change = false;
--
LinuxNextTracking
11 years, 6 months
[linux-next] LinuxNextTracking branch, master, updated. next-20110716
by batman@open-mesh.org
The following commit has been merged in the master branch:
commit 980d55b20a730cbabc74cdc57be9c47713dba57b
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Thu Jul 7 01:40:59 2011 +0200
batman-adv: keep global table consistency in case of roaming
To keep consistency of other originator tables, new clients detected as
roamed, are kept in the global table but are marked as TT_CLIENT_PENDING
They are purged only when the new ttvn is received by the corresponding
originator. Moreover they need to be considered as removed in case of global
transtable lookup.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 7cc67c0..fb6931d 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -230,8 +230,9 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr)
if (tt_global_entry) {
/* This node is probably going to update its tt table */
tt_global_entry->orig_node->tt_poss_change = true;
- _tt_global_del(bat_priv, tt_global_entry,
- "local tt received");
+ /* The global entry has to be marked as PENDING and has to be
+ * kept for consistency purpose */
+ tt_global_entry->flags |= TT_CLIENT_PENDING;
send_roam_adv(bat_priv, tt_global_entry->addr,
tt_global_entry->orig_node);
}
@@ -787,6 +788,11 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv,
if (!atomic_inc_not_zero(&tt_global_entry->orig_node->refcount))
goto free_tt;
+ /* A global client marked as PENDING has already moved from that
+ * originator */
+ if (tt_global_entry->flags & TT_CLIENT_PENDING)
+ goto free_tt;
+
orig_node = tt_global_entry->orig_node;
free_tt:
--
LinuxNextTracking
11 years, 6 months
[linux-next] LinuxNextTracking branch, master, updated. next-20110716
by batman@open-mesh.org
The following commit has been merged in the master branch:
commit c8c991bf2076d711f14ff9063db306fd522ddcd4
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Thu Jul 7 01:40:57 2011 +0200
batman-adv: initialise last_ttvn and tt_crc for the orig_node structure
The last_ttvn and tt_crc fields of the orig_node structure were not
initialised causing an immediate TT_REQ/RES dialogue even if not needed.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 4cc94d4..f3c3f62 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -223,6 +223,8 @@ struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr)
orig_node->bat_priv = bat_priv;
memcpy(orig_node->orig, addr, ETH_ALEN);
orig_node->router = NULL;
+ orig_node->tt_crc = 0;
+ atomic_set(&orig_node->last_ttvn, 0);
orig_node->tt_buff = NULL;
orig_node->tt_buff_len = 0;
atomic_set(&orig_node->tt_size, 0);
--
LinuxNextTracking
11 years, 6 months
Noticed difference in packet.h in master.diff
by postmaster@open-mesh.org
--- batman-adv_master.packet.h 2011-07-09 00:15:01.000000000 +0200
+++ batctl_master.packet.h 2011-07-09 00:15:01.000000000 +0200
@@ -84,9 +84,7 @@
enum tt_client_flags {
TT_CLIENT_DEL = 1 << 0,
TT_CLIENT_ROAM = 1 << 1,
- TT_CLIENT_NOPURGE = 1 << 8,
- TT_CLIENT_NEW = 1 << 9,
- TT_CLIENT_PENDING = 1 << 10
+ TT_CLIENT_NOPURGE = 1 << 8
};
struct batman_packet {
11 years, 7 months