Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0695512a
Commit
0695512a
authored
Feb 28, 2012
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge tag 'batman-adv-for-davem' of
git://git.open-mesh.org/linux-merge
parents
5bd49735
7c64fd98
Changes
39
Show whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
141 additions
and
156 deletions
+141
-156
net/batman-adv/Makefile
net/batman-adv/Makefile
+1
-1
net/batman-adv/bat_algo.h
net/batman-adv/bat_algo.h
+1
-1
net/batman-adv/bat_debugfs.c
net/batman-adv/bat_debugfs.c
+1
-1
net/batman-adv/bat_debugfs.h
net/batman-adv/bat_debugfs.h
+1
-1
net/batman-adv/bat_iv_ogm.c
net/batman-adv/bat_iv_ogm.c
+1
-1
net/batman-adv/bat_sysfs.c
net/batman-adv/bat_sysfs.c
+3
-3
net/batman-adv/bat_sysfs.h
net/batman-adv/bat_sysfs.h
+1
-1
net/batman-adv/bitarray.c
net/batman-adv/bitarray.c
+5
-5
net/batman-adv/bitarray.h
net/batman-adv/bitarray.h
+1
-1
net/batman-adv/gateway_client.c
net/batman-adv/gateway_client.c
+3
-3
net/batman-adv/gateway_client.h
net/batman-adv/gateway_client.h
+1
-1
net/batman-adv/gateway_common.c
net/batman-adv/gateway_common.c
+3
-3
net/batman-adv/gateway_common.h
net/batman-adv/gateway_common.h
+1
-1
net/batman-adv/hard-interface.c
net/batman-adv/hard-interface.c
+16
-16
net/batman-adv/hard-interface.h
net/batman-adv/hard-interface.h
+1
-1
net/batman-adv/hash.c
net/batman-adv/hash.c
+1
-1
net/batman-adv/hash.h
net/batman-adv/hash.h
+1
-1
net/batman-adv/icmp_socket.c
net/batman-adv/icmp_socket.c
+1
-1
net/batman-adv/icmp_socket.h
net/batman-adv/icmp_socket.h
+1
-1
net/batman-adv/main.c
net/batman-adv/main.c
+1
-1
net/batman-adv/main.h
net/batman-adv/main.h
+9
-8
net/batman-adv/originator.c
net/batman-adv/originator.c
+7
-11
net/batman-adv/originator.h
net/batman-adv/originator.h
+1
-1
net/batman-adv/packet.h
net/batman-adv/packet.h
+1
-1
net/batman-adv/ring_buffer.c
net/batman-adv/ring_buffer.c
+1
-1
net/batman-adv/ring_buffer.h
net/batman-adv/ring_buffer.h
+1
-1
net/batman-adv/routing.c
net/batman-adv/routing.c
+6
-7
net/batman-adv/routing.h
net/batman-adv/routing.h
+1
-1
net/batman-adv/send.c
net/batman-adv/send.c
+1
-1
net/batman-adv/send.h
net/batman-adv/send.h
+1
-1
net/batman-adv/soft-interface.c
net/batman-adv/soft-interface.c
+3
-3
net/batman-adv/soft-interface.h
net/batman-adv/soft-interface.h
+1
-1
net/batman-adv/translation-table.c
net/batman-adv/translation-table.c
+54
-65
net/batman-adv/translation-table.h
net/batman-adv/translation-table.h
+1
-1
net/batman-adv/types.h
net/batman-adv/types.h
+1
-1
net/batman-adv/unicast.c
net/batman-adv/unicast.c
+1
-1
net/batman-adv/unicast.h
net/batman-adv/unicast.h
+1
-1
net/batman-adv/vis.c
net/batman-adv/vis.c
+2
-3
net/batman-adv/vis.h
net/batman-adv/vis.h
+3
-2
No files found.
net/batman-adv/Makefile
View file @
0695512a
#
# Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
# Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
#
# Marek Lindner, Simon Wunderlich
#
...
...
net/batman-adv/bat_algo.h
View file @
0695512a
/*
* Copyright (C) 2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2011
-2012
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/bat_debugfs.c
View file @
0695512a
/*
* Copyright (C) 2010-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2010-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/bat_debugfs.h
View file @
0695512a
/*
* Copyright (C) 2010-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2010-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/bat_iv_ogm.c
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
net/batman-adv/bat_sysfs.c
View file @
0695512a
/*
* Copyright (C) 2010-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2010-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/bat_sysfs.h
View file @
0695512a
/*
* Copyright (C) 2010-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2010-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/bitarray.c
View file @
0695512a
/*
* Copyright (C) 2006-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2006-201
2
B.A.T.M.A.N. contributors:
*
* Simon Wunderlich, Marek Lindner
*
...
...
@@ -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
);
...
...
@@ -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
"
);
...
...
net/batman-adv/bitarray.h
View file @
0695512a
/*
* Copyright (C) 2006-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2006-201
2
B.A.T.M.A.N. contributors:
*
* Simon Wunderlich, Marek Lindner
*
...
...
net/batman-adv/gateway_client.c
View file @
0695512a
/*
* Copyright (C) 2009-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2009-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
@@ -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
);
...
...
net/batman-adv/gateway_client.h
View file @
0695512a
/*
* Copyright (C) 2009-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2009-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/gateway_common.c
View file @
0695512a
/*
* Copyright (C) 2009-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2009-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/gateway_common.h
View file @
0695512a
/*
* Copyright (C) 2009-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2009-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/hard-interface.c
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
@@ -353,9 +353,9 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
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
"
,
"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
);
...
...
@@ -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
)
...
...
net/batman-adv/hard-interface.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
net/batman-adv/hash.c
View file @
0695512a
/*
* Copyright (C) 2006-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2006-201
2
B.A.T.M.A.N. contributors:
*
* Simon Wunderlich, Marek Lindner
*
...
...
net/batman-adv/hash.h
View file @
0695512a
/*
* Copyright (C) 2006-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2006-201
2
B.A.T.M.A.N. contributors:
*
* Simon Wunderlich, Marek Lindner
*
...
...
net/batman-adv/icmp_socket.c
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/icmp_socket.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/main.c
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
net/batman-adv/main.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
@@ -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 */
...
...
@@ -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 200
000
/* 200 seconds */
#define TT_LOCAL_TIMEOUT 3600
000
/* in mili
seconds */
#define TT_CLIENT_ROAM_TIMEOUT 600
000
/* 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
...
...
@@ -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 20
000
/* Time in which a client can roam at most
* ROAMING_MAX_COUNT times in miliseconds
*/
#define ROAMING_MAX_COUNT 5
#define NO_FLAGS 0
...
...
net/batman-adv/originator.c
View file @
0695512a
/*
* Copyright (C) 2009-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2009-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
@@ -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
))
{
...
...
@@ -327,19 +326,16 @@ 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
;
}
...
...
@@ -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
);
...
...
net/batman-adv/originator.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
net/batman-adv/packet.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
net/batman-adv/ring_buffer.c
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/ring_buffer.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/routing.c
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
@@ -229,10 +229,9 @@ void bonding_save_primary(const struct orig_node *orig_node,
int
window_protected
(
struct
bat_priv
*
bat_priv
,
int32_t
seq_num_diff
,
unsigned
long
*
last_reset
)
{
if
((
seq_num_diff
<=
-
TQ_LOCAL_WINDOW_SIZE
)
||
(
seq_num_diff
>=
EXPECTED_SEQNO_RANGE
))
{
if
(
time_after
(
jiffies
,
*
last_reset
+
msecs_to_jiffies
(
RESET_PROTECTION_MS
)))
{
if
((
seq_num_diff
<=
-
TQ_LOCAL_WINDOW_SIZE
)
||
(
seq_num_diff
>=
EXPECTED_SEQNO_RANGE
))
{
if
(
has_timed_out
(
*
last_reset
,
RESET_PROTECTION_MS
))
{
*
last_reset
=
jiffies
;
bat_dbg
(
DBG_BATMAN
,
bat_priv
,
...
...
net/batman-adv/routing.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
net/batman-adv/send.c
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
net/batman-adv/send.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
net/batman-adv/soft-interface.c
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
@@ -396,8 +396,8 @@ void softif_neigh_purge(struct bat_priv *bat_priv)
hlist_for_each_entry_safe
(
softif_neigh
,
node_tmp
,
node_tmp2
,
&
softif_neigh_vid
->
softif_neigh_list
,
list
)
{
if
((
!
time_after
(
jiffies
,
softif_neigh
->
last_seen
+
msecs_to_jiffies
(
SOFTIF_NEIGH_TIMEOUT
)
))
&&
if
((
!
has_timed_out
(
softif_neigh
->
last_seen
,
SOFTIF_NEIGH_TIMEOUT
))
&&
(
atomic_read
(
&
bat_priv
->
mesh_state
)
==
MESH_ACTIVE
))
continue
;
...
...
net/batman-adv/soft-interface.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner
*
...
...
net/batman-adv/translation-table.c
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
@@ -210,6 +210,11 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
if
(
compare_eth
(
addr
,
soft_iface
->
dev_addr
))
tt_local_entry
->
common
.
flags
|=
TT_CLIENT_NOPURGE
;
/* 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
->
common
.
flags
|=
TT_CLIENT_NEW
;
hash_added
=
hash_add
(
bat_priv
->
tt_local_hash
,
compare_tt
,
choose_orig
,
&
tt_local_entry
->
common
,
&
tt_local_entry
->
common
.
hash_entry
);
...
...
@@ -222,11 +227,6 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
tt_local_event
(
bat_priv
,
addr
,
tt_local_entry
->
common
.
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
->
common
.
flags
|=
TT_CLIENT_NEW
;
/* remove address from global hash if present */
tt_global_entry
=
tt_global_hash_find
(
bat_priv
,
addr
);
...
...
@@ -355,7 +355,7 @@ int tt_local_seq_print_text(struct seq_file *seq, void *offset)
static
void
tt_local_set_pending
(
struct
bat_priv
*
bat_priv
,
struct
tt_local_entry
*
tt_local_entry
,
uint16_t
flags
)
uint16_t
flags
,
const
char
*
message
)
{
tt_local_event
(
bat_priv
,
tt_local_entry
->
common
.
addr
,
tt_local_entry
->
common
.
flags
|
flags
);
...
...
@@ -364,6 +364,9 @@ static void tt_local_set_pending(struct bat_priv *bat_priv,
* 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
->
common
.
flags
|=
TT_CLIENT_PENDING
;
bat_dbg
(
DBG_TT
,
bat_priv
,
"Local tt entry (%pM) pending to be removed: "
"%s
\n
"
,
tt_local_entry
->
common
.
addr
,
message
);
}
void
tt_local_remove
(
struct
bat_priv
*
bat_priv
,
const
uint8_t
*
addr
,
...
...
@@ -376,10 +379,7 @@ void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
goto
out
;
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
->
common
.
addr
,
message
);
(
roaming
?
TT_CLIENT_ROAM
:
NO_FLAGS
),
message
);
out:
if
(
tt_local_entry
)
tt_local_entry_free_ref
(
tt_local_entry
);
...
...
@@ -413,14 +413,11 @@ static void tt_local_purge(struct bat_priv *bat_priv)
continue
;
if
(
!
has_timed_out
(
tt_local_entry
->
last_seen
,
TT_LOCAL_TIMEOUT
*
1000
))
TT_LOCAL_TIMEOUT
))
continue
;
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
->
common
.
addr
);
TT_CLIENT_DEL
,
"timed out"
);
}
spin_unlock_bh
(
list_lock
);
}
...
...
@@ -606,7 +603,7 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset)
struct
tt_global_entry
,
common
);
seq_printf
(
seq
,
" * %pM (%3u) via %pM (%3u) "
"[%c%c
%c
]
\n
"
,
"[%c%c]
\n
"
,
tt_global_entry
->
common
.
addr
,
tt_global_entry
->
ttvn
,
tt_global_entry
->
orig_node
->
orig
,
...
...
@@ -615,8 +612,6 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset)
last_ttvn
),
(
tt_global_entry
->
common
.
flags
&
TT_CLIENT_ROAM
?
'R'
:
'.'
),
(
tt_global_entry
->
common
.
flags
&
TT_CLIENT_PENDING
?
'X'
:
'.'
),
(
tt_global_entry
->
common
.
flags
&
TT_CLIENT_WIFI
?
'W'
:
'.'
));
}
...
...
@@ -657,11 +652,12 @@ void tt_global_del(struct bat_priv *bat_priv,
struct
tt_local_entry
*
tt_local_entry
=
NULL
;
tt_global_entry
=
tt_global_hash_find
(
bat_priv
,
addr
);
if
(
!
tt_global_entry
)
if
(
!
tt_global_entry
||
tt_global_entry
->
orig_node
!=
orig_node
)
goto
out
;
if
(
tt_global_entry
->
orig_node
==
orig_node
)
{
if
(
roaming
)
{
if
(
!
roaming
)
goto
out_del
;
/* if we are deleting a global entry due to a roam
* event, there are two possibilities:
* 1) the client roamed from node A to node B => we mark
...
...
@@ -677,9 +673,10 @@ void tt_global_del(struct bat_priv *bat_priv,
tt_global_entry
->
roam_at
=
jiffies
;
goto
out
;
}
}
out_del:
_tt_global_del
(
bat_priv
,
tt_global_entry
,
message
);
}
out:
if
(
tt_global_entry
)
tt_global_entry_free_ref
(
tt_global_entry
);
...
...
@@ -751,7 +748,7 @@ static void tt_global_roam_purge(struct bat_priv *bat_priv)
if
(
!
(
tt_global_entry
->
common
.
flags
&
TT_CLIENT_ROAM
))
continue
;
if
(
!
has_timed_out
(
tt_global_entry
->
roam_at
,
TT_CLIENT_ROAM_TIMEOUT
*
1000
))
TT_CLIENT_ROAM_TIMEOUT
))
continue
;
bat_dbg
(
DBG_TT
,
bat_priv
,
"Deleting global "
...
...
@@ -839,11 +836,6 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv,
if
(
!
atomic_inc_not_zero
(
&
tt_global_entry
->
orig_node
->
refcount
))
goto
out
;
/* A global client marked as PENDING has already moved from that
* originator */
if
(
tt_global_entry
->
common
.
flags
&
TT_CLIENT_PENDING
)
goto
out
;
orig_node
=
tt_global_entry
->
orig_node
;
out:
...
...
@@ -970,8 +962,7 @@ static void tt_req_purge(struct bat_priv *bat_priv)
spin_lock_bh
(
&
bat_priv
->
tt_req_list_lock
);
list_for_each_entry_safe
(
node
,
safe
,
&
bat_priv
->
tt_req_list
,
list
)
{
if
(
has_timed_out
(
node
->
issued_at
,
TT_REQUEST_TIMEOUT
*
1000
))
{
if
(
has_timed_out
(
node
->
issued_at
,
TT_REQUEST_TIMEOUT
))
{
list_del
(
&
node
->
list
);
kfree
(
node
);
}
...
...
@@ -990,7 +981,7 @@ static struct tt_req_node *new_tt_req_node(struct bat_priv *bat_priv,
list_for_each_entry
(
tt_req_node_tmp
,
&
bat_priv
->
tt_req_list
,
list
)
{
if
(
compare_eth
(
tt_req_node_tmp
,
orig_node
)
&&
!
has_timed_out
(
tt_req_node_tmp
->
issued_at
,
TT_REQUEST_TIMEOUT
*
1000
))
TT_REQUEST_TIMEOUT
))
goto
unlock
;
}
...
...
@@ -1583,8 +1574,7 @@ static void tt_roam_purge(struct bat_priv *bat_priv)
spin_lock_bh
(
&
bat_priv
->
tt_roam_list_lock
);
list_for_each_entry_safe
(
node
,
safe
,
&
bat_priv
->
tt_roam_list
,
list
)
{
if
(
!
has_timed_out
(
node
->
first_time
,
ROAMING_MAX_TIME
*
1000
))
if
(
!
has_timed_out
(
node
->
first_time
,
ROAMING_MAX_TIME
))
continue
;
list_del
(
&
node
->
list
);
...
...
@@ -1611,8 +1601,7 @@ static bool tt_check_roam_count(struct bat_priv *bat_priv,
if
(
!
compare_eth
(
tt_roam_node
->
addr
,
client
))
continue
;
if
(
has_timed_out
(
tt_roam_node
->
first_time
,
ROAMING_MAX_TIME
*
1000
))
if
(
has_timed_out
(
tt_roam_node
->
first_time
,
ROAMING_MAX_TIME
))
continue
;
if
(
!
atomic_dec_not_zero
(
&
tt_roam_node
->
counter
))
...
...
net/batman-adv/translation-table.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
net/batman-adv/types.h
View file @
0695512a
/*
* Copyright (C) 2007-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2007-201
2
B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
*
...
...
net/batman-adv/unicast.c
View file @
0695512a
/*
* Copyright (C) 2010-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2010-201
2
B.A.T.M.A.N. contributors:
*
* Andreas Langer
*
...
...
net/batman-adv/unicast.h
View file @
0695512a
/*
* Copyright (C) 2010-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2010-201
2
B.A.T.M.A.N. contributors:
*
* Andreas Langer
*
...
...
net/batman-adv/vis.c
View file @
0695512a
/*
* Copyright (C) 2008-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2008-201
2
B.A.T.M.A.N. contributors:
*
* Simon Wunderlich
*
...
...
@@ -714,8 +714,7 @@ static void purge_vis_packets(struct bat_priv *bat_priv)
if
(
info
==
bat_priv
->
my_vis_info
)
continue
;
if
(
time_after
(
jiffies
,
info
->
first_seen
+
VIS_TIMEOUT
*
HZ
))
{
if
(
has_timed_out
(
info
->
first_seen
,
VIS_TIMEOUT
))
{
hlist_del
(
node
);
send_list_del
(
info
);
kref_put
(
&
info
->
refcount
,
free_info
);
...
...
net/batman-adv/vis.h
View file @
0695512a
/*
* Copyright (C) 2008-201
1
B.A.T.M.A.N. contributors:
* Copyright (C) 2008-201
2
B.A.T.M.A.N. contributors:
*
* Simon Wunderlich, Marek Lindner
*
...
...
@@ -22,7 +22,8 @@
#ifndef _NET_BATMAN_ADV_VIS_H_
#define _NET_BATMAN_ADV_VIS_H_
#define VIS_TIMEOUT 200
/* timeout of vis packets in seconds */
#define VIS_TIMEOUT 200000
/* timeout of vis packets
* in miliseconds */
int
vis_seq_print_text
(
struct
seq_file
*
seq
,
void
*
offset
);
void
receive_server_sync_packet
(
struct
bat_priv
*
bat_priv
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment