Skip to content

Commit

Permalink
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
David S. Miller committed Feb 28, 2012
2 parents 5bd4973 + 7c64fd9 commit 0695512
Show file tree
Hide file tree
Showing 39 changed files with 141 additions and 156 deletions.
2 changes: 1 addition & 1 deletion net/batman-adv/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
# Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
#
# Marek Lindner, Simon Wunderlich
#
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/bat_algo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2011-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/bat_debugfs.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/bat_debugfs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/bat_iv_ogm.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
Expand Down
6 changes: 3 additions & 3 deletions net/batman-adv/bat_sysfs.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down Expand Up @@ -321,11 +321,11 @@ static ssize_t store_gw_mode(struct kobject *kobj, struct attribute *attr,
gw_mode_tmp = GW_MODE_OFF;

if (strncmp(buff, GW_MODE_CLIENT_NAME,
strlen(GW_MODE_CLIENT_NAME)) == 0)
strlen(GW_MODE_CLIENT_NAME)) == 0)
gw_mode_tmp = GW_MODE_CLIENT;

if (strncmp(buff, GW_MODE_SERVER_NAME,
strlen(GW_MODE_SERVER_NAME)) == 0)
strlen(GW_MODE_SERVER_NAME)) == 0)
gw_mode_tmp = GW_MODE_SERVER;

if (gw_mode_tmp < 0) {
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/bat_sysfs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down
10 changes: 5 additions & 5 deletions net/batman-adv/bitarray.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
*
* Simon Wunderlich, Marek Lindner
*
Expand Down Expand Up @@ -154,8 +154,8 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,

/* sequence number is much newer, probably missed a lot of packets */

if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE)
&& (seq_num_diff < EXPECTED_SEQNO_RANGE)) {
if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE) &&
(seq_num_diff < EXPECTED_SEQNO_RANGE)) {
bat_dbg(DBG_BATMAN, bat_priv,
"We missed a lot of packets (%i) !\n",
seq_num_diff - 1);
Expand All @@ -170,8 +170,8 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
* packet should be dropped without calling this function if the
* seqno window is protected. */

if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE)
|| (seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
(seq_num_diff >= EXPECTED_SEQNO_RANGE)) {

bat_dbg(DBG_BATMAN, bat_priv,
"Other host probably restarted!\n");
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/bitarray.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
*
* Simon Wunderlich, Marek Lindner
*
Expand Down
6 changes: 3 additions & 3 deletions net/batman-adv/gateway_client.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down Expand Up @@ -396,7 +396,7 @@ void gw_node_purge(struct bat_priv *bat_priv)
{
struct gw_node *gw_node, *curr_gw;
struct hlist_node *node, *node_tmp;
unsigned long timeout = 2 * PURGE_TIMEOUT * HZ;
unsigned long timeout = msecs_to_jiffies(2 * PURGE_TIMEOUT);
int do_deselect = 0;

curr_gw = gw_get_selected_gw_node(bat_priv);
Expand Down Expand Up @@ -629,7 +629,7 @@ bool gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len)

/* check for bootp port */
if ((ntohs(ethhdr->h_proto) == ETH_P_IP) &&
(ntohs(udphdr->dest) != 67))
(ntohs(udphdr->dest) != 67))
return false;

if ((ntohs(ethhdr->h_proto) == ETH_P_IPV6) &&
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/gateway_client.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down
6 changes: 3 additions & 3 deletions net/batman-adv/gateway_common.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down Expand Up @@ -93,7 +93,7 @@ static bool parse_gw_bandwidth(struct net_device *net_dev, char *buff,
multi = 1024;

if ((strnicmp(tmp_ptr, "kbit", 4) == 0) ||
(multi > 1))
(multi > 1))
*tmp_ptr = '\0';
}

Expand All @@ -118,7 +118,7 @@ static bool parse_gw_bandwidth(struct net_device *net_dev, char *buff,
multi = 1024;

if ((strnicmp(tmp_ptr, "kbit", 4) == 0) ||
(multi > 1))
(multi > 1))
*tmp_ptr = '\0';
}

Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/gateway_common.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down
32 changes: 16 additions & 16 deletions net/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
Expand Down Expand Up @@ -341,23 +341,23 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
ETH_DATA_LEN + BAT_HEADER_LEN)
bat_info(hard_iface->soft_iface,
"The MTU of interface %s is too small (%i) to handle "
"the transport of batman-adv packets. Packets going "
"over this interface will be fragmented on layer2 "
"which could impact the performance. Setting the MTU "
"to %zi would solve the problem.\n",
hard_iface->net_dev->name, hard_iface->net_dev->mtu,
ETH_DATA_LEN + BAT_HEADER_LEN);
"The MTU of interface %s is too small (%i) to handle "
"the transport of batman-adv packets. Packets going "
"over this interface will be fragmented on layer2 "
"which could impact the performance. Setting the MTU "
"to %zi would solve the problem.\n",
hard_iface->net_dev->name, hard_iface->net_dev->mtu,
ETH_DATA_LEN + BAT_HEADER_LEN);

if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
ETH_DATA_LEN + BAT_HEADER_LEN)
bat_info(hard_iface->soft_iface,
"The MTU of interface %s is too small (%i) to handle "
"the transport of batman-adv packets. If you experience"
" problems getting traffic through try increasing the "
"MTU to %zi.\n",
hard_iface->net_dev->name, hard_iface->net_dev->mtu,
ETH_DATA_LEN + BAT_HEADER_LEN);
"The MTU of interface %s is too small (%i) to handle "
"the transport of batman-adv packets. If you "
"experience problems getting traffic through try "
"increasing the MTU to %zi.\n",
hard_iface->net_dev->name, hard_iface->net_dev->mtu,
ETH_DATA_LEN + BAT_HEADER_LEN);

if (hardif_is_iface_up(hard_iface))
hardif_activate_interface(hard_iface);
Expand Down Expand Up @@ -580,8 +580,8 @@ static int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
goto err_free;

/* expect a valid ethernet header here. */
if (unlikely(skb->mac_len != sizeof(struct ethhdr)
|| !skb_mac_header(skb)))
if (unlikely(skb->mac_len != sizeof(struct ethhdr) ||
!skb_mac_header(skb)))
goto err_free;

if (!hard_iface->soft_iface)
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/hard-interface.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/hash.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
*
* Simon Wunderlich, Marek Lindner
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/hash.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
*
* Simon Wunderlich, Marek Lindner
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/icmp_socket.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/icmp_socket.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
Expand Down
17 changes: 9 additions & 8 deletions net/batman-adv/main.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
Expand Down Expand Up @@ -28,7 +28,7 @@
#define DRIVER_DEVICE "batman-adv"

#ifndef SOURCE_VERSION
#define SOURCE_VERSION "2012.0.0"
#define SOURCE_VERSION "2012.1.0"
#endif

/* B.A.T.M.A.N. parameters */
Expand All @@ -41,13 +41,14 @@

/* purge originators after time in seconds if no valid packet comes in
* -> TODO: check influence on TQ_LOCAL_WINDOW_SIZE */
#define PURGE_TIMEOUT 200
#define TT_LOCAL_TIMEOUT 3600 /* in seconds */
#define TT_CLIENT_ROAM_TIMEOUT 600
#define PURGE_TIMEOUT 200000 /* 200 seconds */
#define TT_LOCAL_TIMEOUT 3600000 /* in miliseconds */
#define TT_CLIENT_ROAM_TIMEOUT 600000 /* in miliseconds */
/* 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 */
#define TT_REQUEST_TIMEOUT 3000 /* miliseconds we have to keep
* pending tt_req */

#define TQ_GLOBAL_WINDOW_SIZE 5
#define TQ_LOCAL_BIDRECT_SEND_MINIMUM 1
Expand All @@ -56,8 +57,8 @@

#define TT_OGM_APPEND_MAX 3 /* number of OGMs sent with the last tt diff */

#define ROAMING_MAX_TIME 20 /* Time in which a client can roam at most
* ROAMING_MAX_COUNT times */
#define ROAMING_MAX_TIME 20000 /* Time in which a client can roam at most
* ROAMING_MAX_COUNT times in miliseconds*/
#define ROAMING_MAX_COUNT 5

#define NO_FLAGS 0
Expand Down
18 changes: 7 additions & 11 deletions net/batman-adv/originator.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
Expand Down Expand Up @@ -143,7 +143,7 @@ static void orig_node_free_rcu(struct rcu_head *rcu)

frag_list_free(&orig_node->frag_list);
tt_global_del_orig(orig_node->bat_priv, orig_node,
"originator timed out");
"originator timed out");

kfree(orig_node->tt_buff);
kfree(orig_node->bcast_own);
Expand Down Expand Up @@ -282,8 +282,7 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv,
hlist_for_each_entry_safe(neigh_node, node, node_tmp,
&orig_node->neigh_list, list) {

if ((time_after(jiffies,
neigh_node->last_valid + PURGE_TIMEOUT * HZ)) ||
if ((has_timed_out(neigh_node->last_valid, PURGE_TIMEOUT)) ||
(neigh_node->if_incoming->if_status == IF_INACTIVE) ||
(neigh_node->if_incoming->if_status == IF_NOT_IN_USE) ||
(neigh_node->if_incoming->if_status == IF_TO_BE_REMOVED)) {
Expand Down Expand Up @@ -327,18 +326,15 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
{
struct neigh_node *best_neigh_node;

if (time_after(jiffies,
orig_node->last_valid + 2 * PURGE_TIMEOUT * HZ)) {

if (has_timed_out(orig_node->last_valid, 2 * PURGE_TIMEOUT)) {
bat_dbg(DBG_BATMAN, bat_priv,
"Originator timeout: originator %pM, last_valid %lu\n",
orig_node->orig, (orig_node->last_valid / HZ));
return true;
} else {
if (purge_orig_neighbors(bat_priv, orig_node,
&best_neigh_node)) {
&best_neigh_node))
update_route(bat_priv, orig_node, best_neigh_node);
}
}

return false;
Expand Down Expand Up @@ -372,8 +368,8 @@ static void _purge_orig(struct bat_priv *bat_priv)
continue;
}

if (time_after(jiffies, orig_node->last_frag_packet +
msecs_to_jiffies(FRAG_TIMEOUT)))
if (has_timed_out(orig_node->last_frag_packet,
FRAG_TIMEOUT))
frag_list_free(&orig_node->frag_list);
}
spin_unlock_bh(list_lock);
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/originator.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/packet.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/ring_buffer.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down
2 changes: 1 addition & 1 deletion net/batman-adv/ring_buffer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
Expand Down
Loading

0 comments on commit 0695512

Please sign in to comment.