The branch, pu/linux3 has been created
at 5b0b3570d2f2405ef9fc88a2bda8d3bb20cd9860 (commit)
- Shortlog ------------------------------------------------------------
commit 5b0b3570d2f2405ef9fc88a2bda8d3bb20cd9860
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat Jul 23 13:16:42 2011 +0200
batmand: Fix build of batgat module with linux 3.0
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
-----------------------------------------------------------------------
--
batmand
The following commit has been merged in the master branch:
commit 610d2adce549dd9b4c6e343d95828cc60cb5bd89
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Tue Jul 26 00:39:08 2011 +0200
batctl: detect clients connected through a 802.11 device
Clients connected through a 802.11 device are now marked with the
TT_CLIENT_WIFI flag. This flag is also advertised with the tt
announcement.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/packet.h b/packet.h
index b76b4be..8802eab 100644
--- a/packet.h
+++ b/packet.h
@@ -84,6 +84,7 @@ enum tt_query_flags {
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
--
batctl
The following commit has been merged in the master branch:
commit 5089a61c24725848d293c8b47cb6081f9af24f53
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Tue Jun 7 00:10:13 2011 +0200
batctl: added ap_isolation support
This patch introduces the possibility of enabling/disabling the
ap_isolation feature in batman-adv
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/main.c b/main.c
index e0cccbd..a1e6f4d 100644
--- a/main.c
+++ b/main.c
@@ -58,6 +58,7 @@ void print_usage(void) {
printf(" \taggregation|ag [0|1] \tdisplay or modify the packet aggregation setting\n");
printf(" \tbonding|b [0|1] \tdisplay or modify the bonding mode setting\n");
printf(" \tfragmentation|f [0|1] \tdisplay or modify the fragmentation mode setting\n");
+ printf(" \tap_isolation|ap [0|1] \tdisplay or modify the ap isolation mode setting\n");
printf("\n");
printf(" \tping|p <destination> \tping another batman adv host via layer 2\n");
printf(" \ttraceroute|tr <destination> \ttraceroute another batman adv host via layer 2\n");
@@ -188,6 +189,11 @@ int main(int argc, char **argv)
ret = handle_sys_setting(mesh_iface, argc - 1, argv + 1,
SYS_FRAG, fragmentation_usage, sysfs_param_enable);
+ } else if ((strcmp(argv[1], "ap_isolation") == 0) || (strcmp(argv[1], "ap") == 0)) {
+
+ ret = handle_sys_setting(mesh_iface, argc - 1, argv + 1,
+ SYS_AP_ISOLA, ap_isolation_usage, sysfs_param_enable);
+
} else if ((strcmp(argv[1], "bisect") == 0)) {
ret = bisect(argc - 1, argv + 1);
diff --git a/man/batctl.8 b/man/batctl.8
index 7ee389a..b0c6fc6 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -152,6 +152,9 @@ If no parameter is given the current bonding mode setting is displayed. Otherwis
.IP "\fBfragmentation\fP|\fBf\fP [\fB1\fP|\fB0\fP]"
If no parameter is given the current fragmentation mode setting is displayed. Otherwise the parameter is used to enable or disable fragmentation.
.br
+.IP "\fBap_isolation\fP|\fBap\fP [\fB1\fP|\fB0\fP]"
+If no parameter is given the current ap isolation setting is displayed. Otherwise the parameter is used to enable or disable ap isolation.
+.br
.IP "\fBping\fP|\fBp\fP [\fB\-c count\fP][\fB\-i interval\fP][\fB\-t time\fP][\fB\-R\fP] \fBMAC_address\fP|\fBbat\-host_name\fP"
Layer 2 ping of a MAC address or bat\-host name. batctl will try to
find the bat\-host name if the given parameter was not a MAC
diff --git a/sys.c b/sys.c
index dbf5383..4f2b2c5 100644
--- a/sys.c
+++ b/sys.c
@@ -270,6 +270,13 @@ void fragmentation_usage(void)
printf(" \t -h print this help\n");
}
+void ap_isolation_usage(void)
+{
+ printf("Usage: batctl [options] ap_isolation [0|1]\n");
+ printf("options:\n");
+ printf(" \t -h print this help\n");
+}
+
int handle_sys_setting(char *mesh_iface, int argc, char **argv,
char *file_path, void setting_usage(void),
const char *sysfs_param[])
diff --git a/sys.h b/sys.h
index 2c47550..2df846c 100644
--- a/sys.h
+++ b/sys.h
@@ -34,6 +34,7 @@
#define SYS_MESH_IFACE_FMT SYS_IFACE_PATH"/%s/batman_adv/mesh_iface"
#define SYS_IFACE_STATUS_FMT SYS_IFACE_PATH"/%s/batman_adv/iface_status"
#define SYS_FRAG "fragmentation"
+#define SYS_AP_ISOLA "ap_isolation"
enum gw_modes {
GW_MODE_OFF,
@@ -47,6 +48,7 @@ extern const char *sysfs_param_server[];
void aggregation_usage(void);
void bonding_usage(void);
void fragmentation_usage(void);
+void ap_isolation_usage(void);
void gw_mode_usage(void);
void vis_mode_usage(void);
void orig_interval_usage(void);
--
batctl
The following commit has been merged in the master branch:
commit d1d08772b19fe9113e041afa2b7f3270d60a806c
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sat Jul 9 17:52:13 2011 +0200
batman-adv: correct several typ0s in the comments
Several typos have been corrected and some sentences have been rephrased
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/bitarray.c b/bitarray.c
index c1f4bfc..0be9ff3 100644
--- a/bitarray.c
+++ b/bitarray.c
@@ -97,12 +97,12 @@ static void bit_shift(unsigned long *seq_bits, int32_t n)
(seq_bits[i - word_num - 1] >>
(WORD_BIT_SIZE-word_offset));
/* and the upper part of the right half and shift it left to
- * it's position */
+ * its position */
/* for our example that would be: word[0] = 9800 + 0076 =
* 9876 */
}
- /* now for our last word, i==word_num, we only have the it's "left"
- * half. that's the 1000 word in our example.*/
+ /* now for our last word, i==word_num, we only have its "left" half.
+ * that's the 1000 word in our example.*/
seq_bits[i] = (seq_bits[i - word_num] << word_offset);
diff --git a/gateway_client.c b/gateway_client.c
index 056180e..619fb73 100644
--- a/gateway_client.c
+++ b/gateway_client.c
@@ -532,14 +532,14 @@ static bool is_type_dhcprequest(struct sk_buff *skb, int header_len)
pkt_len -= header_len + DHCP_OPTIONS_OFFSET + 1;
/* Access the dhcp option lists. Each entry is made up by:
- * - octect 1: option type
- * - octect 2: option data len (only if type != 255 and 0)
- * - octect 3: option data */
+ * - octet 1: option type
+ * - octet 2: option data len (only if type != 255 and 0)
+ * - octet 3: option data */
while (*p != 255 && !ret) {
- /* p now points to the first octect: option type */
+ /* p now points to the first octet: option type */
if (*p == 53) {
/* type 53 is the message type option.
- * Jump the len octect and go to the data octect */
+ * Jump the len octet and go to the data octet */
if (pkt_len < 2)
goto out;
p += 2;
diff --git a/hard-interface.c b/hard-interface.c
index db7aacf..0d73e1e 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -249,7 +249,7 @@ static void hardif_activate_interface(struct hard_iface *hard_iface)
/**
* the first active interface becomes our primary interface or
- * the next active interface after the old primay interface was removed
+ * the next active interface after the old primary interface was removed
*/
primary_if = primary_if_get_selected(bat_priv);
if (!primary_if)
@@ -573,7 +573,7 @@ out:
return NOTIFY_DONE;
}
-/* receive a packet with the batman ethertype coming on a hard
+/* incoming packets with the batman ethertype received on any active hard
* interface */
static int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *ptype,
diff --git a/main.h b/main.h
index 9ee8023..7abadae 100644
--- a/main.h
+++ b/main.h
@@ -44,7 +44,7 @@
#define PURGE_TIMEOUT 200
#define TT_LOCAL_TIMEOUT 3600 /* in seconds */
#define TT_CLIENT_ROAM_TIMEOUT 600
-/* sliding packet range of received originator messages in squence numbers
+/* sliding packet range of received originator messages in sequence numbers
* (should be a multiple of our word size) */
#define TQ_LOCAL_WINDOW_SIZE 64
#define TT_REQUEST_TIMEOUT 3 /* seconds we have to keep pending tt_req */
@@ -133,7 +133,7 @@ enum dbg_level {
#include <linux/mutex.h> /* mutex */
#include <linux/module.h> /* needed by all modules */
#include <linux/netdevice.h> /* netdevice */
-#include <linux/etherdevice.h> /* ethernet address classifaction */
+#include <linux/etherdevice.h> /* ethernet address classification */
#include <linux/if_ether.h> /* ethernet header */
#include <linux/poll.h> /* poll_table */
#include <linux/kthread.h> /* kernel threads */
diff --git a/routing.c b/routing.c
index 0f32c81..ec23f9f 100644
--- a/routing.c
+++ b/routing.c
@@ -75,10 +75,9 @@ static void update_transtable(struct bat_priv *bat_priv,
/* the ttvn increased by one -> we can apply the attached changes */
if (ttvn - orig_ttvn == 1) {
- /* the OGM could not contain the changes because they were too
- * many to fit in one frame or because they have already been
- * sent TT_OGM_APPEND_MAX times. In this case send a tt
- * request */
+ /* the OGM could not contain the changes due to their size or
+ * because they have already been sent TT_OGM_APPEND_MAX times.
+ * In this case send a tt request */
if (!tt_num_changes) {
full_table = false;
goto request_table;
@@ -87,13 +86,13 @@ static void update_transtable(struct bat_priv *bat_priv,
tt_update_changes(bat_priv, orig_node, tt_num_changes, ttvn,
(struct tt_change *)tt_buff);
- /* Even if we received the crc into the OGM, we prefer
- * to recompute it to spot any possible inconsistency
+ /* Even if we received the precomputed crc with the OGM, we
+ * prefer 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
+ * because a single value could represent 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
@@ -228,7 +227,7 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
if (!neigh_node)
goto out;
- /* if orig_node is direct neighbour update neigh_node last_valid */
+ /* if orig_node is direct neighbor update neigh_node last_valid */
if (orig_node == orig_neigh_node)
neigh_node->last_valid = jiffies;
@@ -473,7 +472,7 @@ static void update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
if (router && (router->tq_avg > neigh_node->tq_avg))
goto update_tt;
- /* if the TQ is the same and the link not more symetric we
+ /* if the TQ is the same and the link not more symmetric we
* won't consider it either */
if (router && (neigh_node->tq_avg == router->tq_avg)) {
orig_node_tmp = router->orig_node;
@@ -1243,7 +1242,7 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
}
break;
case TT_RESPONSE:
- /* packet needs to be linearised to access the TT changes */
+ /* packet needs to be linearized to access the TT changes */
if (skb_linearize(skb) < 0)
goto out;
diff --git a/send.c b/send.c
index 58d1447..57ae809 100644
--- a/send.c
+++ b/send.c
@@ -135,7 +135,7 @@ static void send_packet_to_if(struct forw_packet *forw_packet,
"Forwarding"));
bat_dbg(DBG_BATMAN, bat_priv,
"%s %spacket (originator %pM, seqno %d, TQ %d, TTL %d,"
- " IDF %s, hvn %d) on interface %s [%pM]\n",
+ " IDF %s, ttvn %d) on interface %s [%pM]\n",
fwd_str, (packet_num > 0 ? "aggregated " : ""),
batman_packet->orig, ntohl(batman_packet->seqno),
batman_packet->tq, batman_packet->ttl,
@@ -313,7 +313,7 @@ void schedule_own_packet(struct hard_iface *hard_iface)
prepare_packet_buffer(bat_priv, hard_iface);
}
- /* if the changes have been sent enough times */
+ /* if the changes have been sent often enough */
if (!atomic_dec_not_zero(&bat_priv->tt_ogm_append_cnt))
reset_packet_buffer(bat_priv, hard_iface);
}
@@ -454,7 +454,7 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv,
}
/* add a broadcast packet to the queue and setup timers. broadcast packets
- * are sent multiple times to increase probability for beeing received.
+ * are sent multiple times to increase probability for being received.
*
* This function returns NETDEV_TX_OK on success and NETDEV_TX_BUSY on
* errors.
@@ -612,7 +612,7 @@ void purge_outstanding_packets(struct bat_priv *bat_priv,
&bat_priv->forw_bcast_list, list) {
/**
- * if purge_outstanding_packets() was called with an argmument
+ * if purge_outstanding_packets() was called with an argument
* we delete only packets belonging to the given interface
*/
if ((hard_iface) &&
@@ -641,7 +641,7 @@ void purge_outstanding_packets(struct bat_priv *bat_priv,
&bat_priv->forw_bat_list, list) {
/**
- * if purge_outstanding_packets() was called with an argmument
+ * if purge_outstanding_packets() was called with an argument
* we delete only packets belonging to the given interface
*/
if ((hard_iface) &&
diff --git a/soft-interface.c b/soft-interface.c
index 3e2f91f..6ba35a2 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -532,7 +532,7 @@ static int interface_set_mac_addr(struct net_device *dev, void *p)
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
- /* only modify transtable if it has been initialised before */
+ /* only modify transtable if it has been initialized before */
if (atomic_read(&bat_priv->mesh_state) == MESH_ACTIVE) {
tt_local_remove(bat_priv, dev->dev_addr,
"mac address changed", false);
diff --git a/translation-table.c b/translation-table.c
index fb6931d..6004cd8 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -369,8 +369,8 @@ static void tt_local_set_pending(struct bat_priv *bat_priv,
tt_local_event(bat_priv, tt_local_entry->addr,
tt_local_entry->flags | flags);
- /* 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
+ /* The local client has to be marked as "pending to be removed" but has
+ * to be kept in the table in order to send it in a full table
* response issued before the net ttvn increment (consistency check) */
tt_local_entry->flags |= TT_CLIENT_PENDING;
}
@@ -1137,12 +1137,12 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
orig_ttvn = (uint8_t)atomic_read(&req_dst_orig_node->last_ttvn);
req_ttvn = tt_request->ttvn;
- /* I have not the requested data */
+ /* I don't have the requested data */
if (orig_ttvn != req_ttvn ||
tt_request->tt_data != req_dst_orig_node->tt_crc)
goto out;
- /* If it has explicitly been requested the full table */
+ /* If the full table has been explicitly requested */
if (tt_request->flags & TT_FULL_TABLE ||
!req_dst_orig_node->tt_buff)
full_table = true;
diff --git a/translation-table.h b/translation-table.h
index d4122cb..e6b564d 100644
--- a/translation-table.h
+++ b/translation-table.h
@@ -49,7 +49,7 @@ uint16_t tt_local_crc(struct bat_priv *bat_priv);
uint16_t tt_global_crc(struct bat_priv *bat_priv, struct orig_node *orig_node);
void tt_free(struct bat_priv *bat_priv);
int send_tt_request(struct bat_priv *bat_priv,
- struct orig_node *dst_orig_node, uint8_t hvn,
+ struct orig_node *dst_orig_node, uint8_t ttvn,
uint16_t tt_crc, bool full_table);
bool send_tt_response(struct bat_priv *bat_priv,
struct tt_query_packet *tt_request);
diff --git a/types.h b/types.h
index 25bd1db..bd0ced8 100644
--- a/types.h
+++ b/types.h
@@ -57,7 +57,7 @@ struct hard_iface {
* @batman_seqno_reset: time when the batman seqno window was reset
* @gw_flags: flags related to gateway class
* @flags: for now only VIS_SERVER flag
- * @last_real_seqno: last and best known squence number
+ * @last_real_seqno: last and best known sequence number
* @last_ttl: ttl of last received packet
* @last_bcast_seqno: last broadcast sequence number received by this host
*
@@ -156,7 +156,7 @@ struct bat_priv {
atomic_t bcast_seqno;
atomic_t bcast_queue_left;
atomic_t batman_queue_left;
- atomic_t ttvn; /* tranlation table version number */
+ atomic_t ttvn; /* translation table version number */
atomic_t tt_ogm_append_cnt;
atomic_t tt_local_changes; /* changes registered in a OGM interval */
/* The tt_poss_change flag is used to detect an ongoing roaming phase.
diff --git a/unicast.h b/unicast.h
index 62f54b9..8fd5535 100644
--- a/unicast.h
+++ b/unicast.h
@@ -24,7 +24,7 @@
#include "packet.h"
-#define FRAG_TIMEOUT 10000 /* purge frag list entrys after time in ms */
+#define FRAG_TIMEOUT 10000 /* purge frag list entries after time in ms */
#define FRAG_BUFFER_SIZE 6 /* number of list elements in buffer */
int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
diff --git a/vis.c b/vis.c
index 8b75cc5..fb9b19f 100644
--- a/vis.c
+++ b/vis.c
@@ -131,7 +131,7 @@ static void vis_data_insert_interface(const uint8_t *interface,
return;
}
- /* its a new address, add it to the list */
+ /* it's a new address, add it to the list */
entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
if (!entry)
return;
--
batman-adv
The following commit has been merged in the master branch:
commit fae2d08ef8dfd61365157899cb0e194509aa8b97
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sun Jul 10 00:36:36 2011 +0200
batman-adv: hash_add() has to discriminate on the return value
hash_add() returns 0 on success while returns -1 either on error and on
entry already present. The caller could use such information to select
its behaviour. For this reason it is useful that hash_add() returns -1
in case on error and returns 1 in case of entry already present.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/hash.h b/hash.h
index dd5c9fd..d20aa71 100644
--- a/hash.h
+++ b/hash.h
@@ -76,19 +76,30 @@ static inline void hash_delete(struct hashtable_t *hash,
hash_destroy(hash);
}
-/* adds data to the hashtable. returns 0 on success, -1 on error */
+/**
+ * hash_add - adds data to the hashtable
+ * @hash: storage hash table
+ * @compare: callback to determine if 2 hash elements are identical
+ * @choose: callback calculating the hash index
+ * @data: data passed to the aforementioned callbacks as argument
+ * @data_node: to be added element
+ *
+ * Returns 0 on success, 1 if the element already is in the hash
+ * and -1 on error.
+ */
+
static inline int hash_add(struct hashtable_t *hash,
hashdata_compare_cb compare,
hashdata_choose_cb choose,
const void *data, struct hlist_node *data_node)
{
- int index;
+ int index, ret = -1;
struct hlist_head *head;
struct hlist_node *node;
spinlock_t *list_lock; /* spinlock to protect write access */
if (!hash)
- goto err;
+ goto out;
index = choose(data, hash->size);
head = &hash->table[index];
@@ -99,6 +110,7 @@ static inline int hash_add(struct hashtable_t *hash,
if (!compare(node, data))
continue;
+ ret = 1;
goto err_unlock;
}
rcu_read_unlock();
@@ -108,12 +120,13 @@ static inline int hash_add(struct hashtable_t *hash,
hlist_add_head_rcu(data_node, head);
spin_unlock_bh(list_lock);
- return 0;
+ ret = 0;
+ goto out;
err_unlock:
rcu_read_unlock();
-err:
- return -1;
+out:
+ return ret;
}
/* removes data from hash, if found. returns pointer do data on success, so you
diff --git a/originator.c b/originator.c
index f3c3f62..d448018 100644
--- a/originator.c
+++ b/originator.c
@@ -252,7 +252,7 @@ struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr)
hash_added = hash_add(bat_priv->orig_hash, compare_orig,
choose_orig, orig_node, &orig_node->hash_entry);
- if (hash_added < 0)
+ if (hash_added != 0)
goto free_bcast_own_sum;
return orig_node;
diff --git a/vis.c b/vis.c
index 8a1b985..8b75cc5 100644
--- a/vis.c
+++ b/vis.c
@@ -465,7 +465,7 @@ static struct vis_info *add_packet(struct bat_priv *bat_priv,
/* try to add it */
hash_added = hash_add(bat_priv->vis_hash, vis_info_cmp, vis_info_choose,
info, &info->hash_entry);
- if (hash_added < 0) {
+ if (hash_added != 0) {
/* did not work (for some reason) */
kref_put(&info->refcount, free_info);
info = NULL;
@@ -920,7 +920,7 @@ int vis_init(struct bat_priv *bat_priv)
hash_added = hash_add(bat_priv->vis_hash, vis_info_cmp, vis_info_choose,
bat_priv->my_vis_info,
&bat_priv->my_vis_info->hash_entry);
- if (hash_added < 0) {
+ if (hash_added != 0) {
pr_err("Can't add own vis packet into hash\n");
/* not in hash, need to remove it manually. */
kref_put(&bat_priv->my_vis_info->refcount, free_info);
--
batman-adv