Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
e6c10f43
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6c10f43
编写于
2月 18, 2011
作者:
M
Marek Lindner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
batman-adv: rename batman_if struct to hard_iface
Signed-off-by:
N
Marek Lindner
<
lindner_marek@yahoo.de
>
上级
4389e47a
变更
18
展开全部
显示空白变更内容
内联
并排
Showing
18 changed file
with
335 addition
and
330 deletion
+335
-330
net/batman-adv/aggregation.c
net/batman-adv/aggregation.c
+4
-4
net/batman-adv/aggregation.h
net/batman-adv/aggregation.h
+2
-2
net/batman-adv/bat_sysfs.c
net/batman-adv/bat_sysfs.c
+22
-19
net/batman-adv/hard-interface.c
net/batman-adv/hard-interface.c
+177
-176
net/batman-adv/hard-interface.h
net/batman-adv/hard-interface.h
+6
-6
net/batman-adv/main.c
net/batman-adv/main.c
+4
-4
net/batman-adv/originator.c
net/batman-adv/originator.c
+14
-14
net/batman-adv/originator.h
net/batman-adv/originator.h
+3
-3
net/batman-adv/routing.c
net/batman-adv/routing.c
+24
-24
net/batman-adv/routing.h
net/batman-adv/routing.h
+10
-10
net/batman-adv/send.c
net/batman-adv/send.c
+51
-50
net/batman-adv/send.h
net/batman-adv/send.h
+4
-4
net/batman-adv/soft-interface.c
net/batman-adv/soft-interface.c
+1
-1
net/batman-adv/soft-interface.h
net/batman-adv/soft-interface.h
+1
-1
net/batman-adv/types.h
net/batman-adv/types.h
+4
-4
net/batman-adv/unicast.c
net/batman-adv/unicast.c
+4
-4
net/batman-adv/unicast.h
net/batman-adv/unicast.h
+1
-1
net/batman-adv/vis.c
net/batman-adv/vis.c
+3
-3
未找到文件。
net/batman-adv/aggregation.c
浏览文件 @
e6c10f43
...
...
@@ -35,7 +35,7 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
int
packet_len
,
unsigned
long
send_time
,
bool
directlink
,
struct
batman_if
*
if_incoming
,
struct
hard_iface
*
if_incoming
,
struct
forw_packet
*
forw_packet
)
{
struct
batman_packet
*
batman_packet
=
...
...
@@ -99,7 +99,7 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
/* create a new aggregated packet and add this packet to it */
static
void
new_aggregated_packet
(
unsigned
char
*
packet_buff
,
int
packet_len
,
unsigned
long
send_time
,
bool
direct_link
,
struct
batman_if
*
if_incoming
,
struct
hard_iface
*
if_incoming
,
int
own_packet
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
if_incoming
->
soft_iface
);
...
...
@@ -188,7 +188,7 @@ static void aggregate(struct forw_packet *forw_packet_aggr,
void
add_bat_packet_to_list
(
struct
bat_priv
*
bat_priv
,
unsigned
char
*
packet_buff
,
int
packet_len
,
struct
batman_if
*
if_incoming
,
char
own_packet
,
struct
hard_iface
*
if_incoming
,
char
own_packet
,
unsigned
long
send_time
)
{
/**
...
...
@@ -247,7 +247,7 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
/* unpack the aggregated packets and process them one by one */
void
receive_aggr_bat_packet
(
struct
ethhdr
*
ethhdr
,
unsigned
char
*
packet_buff
,
int
packet_len
,
struct
batman_if
*
if_incoming
)
int
packet_len
,
struct
hard_iface
*
if_incoming
)
{
struct
batman_packet
*
batman_packet
;
int
buff_pos
=
0
;
...
...
net/batman-adv/aggregation.h
浏览文件 @
e6c10f43
...
...
@@ -35,9 +35,9 @@ static inline int aggregated_packet(int buff_pos, int packet_len, int num_hna)
void
add_bat_packet_to_list
(
struct
bat_priv
*
bat_priv
,
unsigned
char
*
packet_buff
,
int
packet_len
,
struct
batman_if
*
if_incoming
,
char
own_packet
,
struct
hard_iface
*
if_incoming
,
char
own_packet
,
unsigned
long
send_time
);
void
receive_aggr_bat_packet
(
struct
ethhdr
*
ethhdr
,
unsigned
char
*
packet_buff
,
int
packet_len
,
struct
batman_if
*
if_incoming
);
int
packet_len
,
struct
hard_iface
*
if_incoming
);
#endif
/* _NET_BATMAN_ADV_AGGREGATION_H_ */
net/batman-adv/bat_sysfs.c
浏览文件 @
e6c10f43
...
...
@@ -441,16 +441,16 @@ static ssize_t show_mesh_iface(struct kobject *kobj, struct attribute *attr,
char
*
buff
)
{
struct
net_device
*
net_dev
=
kobj_to_netdev
(
kobj
);
struct
batman_if
*
batman_if
=
get_batman_if
_by_netdev
(
net_dev
);
struct
hard_iface
*
hard_iface
=
hardif_get
_by_netdev
(
net_dev
);
ssize_t
length
;
if
(
!
batman_if
)
if
(
!
hard_iface
)
return
0
;
length
=
sprintf
(
buff
,
"%s
\n
"
,
batman_if
->
if_status
==
IF_NOT_IN_USE
?
"none"
:
batman_if
->
soft_iface
->
name
);
length
=
sprintf
(
buff
,
"%s
\n
"
,
hard_iface
->
if_status
==
IF_NOT_IN_USE
?
"none"
:
hard_iface
->
soft_iface
->
name
);
hardif_free_ref
(
batman_if
);
hardif_free_ref
(
hard_iface
);
return
length
;
}
...
...
@@ -459,11 +459,11 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
char
*
buff
,
size_t
count
)
{
struct
net_device
*
net_dev
=
kobj_to_netdev
(
kobj
);
struct
batman_if
*
batman_if
=
get_batman_if
_by_netdev
(
net_dev
);
struct
hard_iface
*
hard_iface
=
hardif_get
_by_netdev
(
net_dev
);
int
status_tmp
=
-
1
;
int
ret
=
count
;
if
(
!
batman_if
)
if
(
!
hard_iface
)
return
count
;
if
(
buff
[
count
-
1
]
==
'\n'
)
...
...
@@ -472,7 +472,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
if
(
strlen
(
buff
)
>=
IFNAMSIZ
)
{
pr_err
(
"Invalid parameter for 'mesh_iface' setting received: "
"interface name too long '%s'
\n
"
,
buff
);
hardif_free_ref
(
batman_if
);
hardif_free_ref
(
hard_iface
);
return
-
EINVAL
;
}
...
...
@@ -481,28 +481,31 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
else
status_tmp
=
IF_I_WANT_YOU
;
if
((
batman_if
->
if_status
==
status_tmp
)
||
((
batman_if
->
soft_iface
)
&&
(
strncmp
(
batman_if
->
soft_iface
->
name
,
buff
,
IFNAMSIZ
)
==
0
)))
if
(
hard_iface
->
if_status
==
status_tmp
)
goto
out
;
if
((
hard_iface
->
soft_iface
)
&&
(
strncmp
(
hard_iface
->
soft_iface
->
name
,
buff
,
IFNAMSIZ
)
==
0
))
goto
out
;
if
(
status_tmp
==
IF_NOT_IN_USE
)
{
rtnl_lock
();
hardif_disable_interface
(
batman_if
);
hardif_disable_interface
(
hard_iface
);
rtnl_unlock
();
goto
out
;
}
/* if the interface already is in use */
if
(
batman_if
->
if_status
!=
IF_NOT_IN_USE
)
{
if
(
hard_iface
->
if_status
!=
IF_NOT_IN_USE
)
{
rtnl_lock
();
hardif_disable_interface
(
batman_if
);
hardif_disable_interface
(
hard_iface
);
rtnl_unlock
();
}
ret
=
hardif_enable_interface
(
batman_if
,
buff
);
ret
=
hardif_enable_interface
(
hard_iface
,
buff
);
out:
hardif_free_ref
(
batman_if
);
hardif_free_ref
(
hard_iface
);
return
ret
;
}
...
...
@@ -510,13 +513,13 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr,
char
*
buff
)
{
struct
net_device
*
net_dev
=
kobj_to_netdev
(
kobj
);
struct
batman_if
*
batman_if
=
get_batman_if
_by_netdev
(
net_dev
);
struct
hard_iface
*
hard_iface
=
hardif_get
_by_netdev
(
net_dev
);
ssize_t
length
;
if
(
!
batman_if
)
if
(
!
hard_iface
)
return
0
;
switch
(
batman_if
->
if_status
)
{
switch
(
hard_iface
->
if_status
)
{
case
IF_TO_BE_REMOVED
:
length
=
sprintf
(
buff
,
"disabling
\n
"
);
break
;
...
...
@@ -535,7 +538,7 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr,
break
;
}
hardif_free_ref
(
batman_if
);
hardif_free_ref
(
hard_iface
);
return
length
;
}
...
...
net/batman-adv/hard-interface.c
浏览文件 @
e6c10f43
此差异已折叠。
点击以展开。
net/batman-adv/hard-interface.h
浏览文件 @
e6c10f43
...
...
@@ -31,18 +31,18 @@
extern
struct
notifier_block
hard_if_notifier
;
struct
batman_if
*
get_batman_if
_by_netdev
(
struct
net_device
*
net_dev
);
int
hardif_enable_interface
(
struct
batman_if
*
batman_if
,
char
*
iface_name
);
void
hardif_disable_interface
(
struct
batman_if
*
batman_if
);
struct
hard_iface
*
hardif_get
_by_netdev
(
struct
net_device
*
net_dev
);
int
hardif_enable_interface
(
struct
hard_iface
*
hard_iface
,
char
*
iface_name
);
void
hardif_disable_interface
(
struct
hard_iface
*
hard_iface
);
void
hardif_remove_interfaces
(
void
);
int
hardif_min_mtu
(
struct
net_device
*
soft_iface
);
void
update_min_mtu
(
struct
net_device
*
soft_iface
);
void
hardif_free_rcu
(
struct
rcu_head
*
rcu
);
static
inline
void
hardif_free_ref
(
struct
batman_if
*
batman_if
)
static
inline
void
hardif_free_ref
(
struct
hard_iface
*
hard_iface
)
{
if
(
atomic_dec_and_test
(
&
batman_if
->
refcount
))
call_rcu
(
&
batman_if
->
rcu
,
hardif_free_rcu
);
if
(
atomic_dec_and_test
(
&
hard_iface
->
refcount
))
call_rcu
(
&
hard_iface
->
rcu
,
hardif_free_rcu
);
}
#endif
/* _NET_BATMAN_ADV_HARD_INTERFACE_H_ */
net/batman-adv/main.c
浏览文件 @
e6c10f43
...
...
@@ -153,14 +153,14 @@ void dec_module_count(void)
int
is_my_mac
(
uint8_t
*
addr
)
{
struct
batman_if
*
batman_if
;
struct
hard_iface
*
hard_iface
;
rcu_read_lock
();
list_for_each_entry_rcu
(
batman_if
,
&
hardif_list
,
list
)
{
if
(
batman_if
->
if_status
!=
IF_ACTIVE
)
list_for_each_entry_rcu
(
hard_iface
,
&
hardif_list
,
list
)
{
if
(
hard_iface
->
if_status
!=
IF_ACTIVE
)
continue
;
if
(
compare_eth
(
batman_if
->
net_dev
->
dev_addr
,
addr
))
{
if
(
compare_eth
(
hard_iface
->
net_dev
->
dev_addr
,
addr
))
{
rcu_read_unlock
();
return
1
;
}
...
...
net/batman-adv/originator.c
浏览文件 @
e6c10f43
...
...
@@ -73,7 +73,7 @@ void neigh_node_free_ref(struct neigh_node *neigh_node)
struct
neigh_node
*
create_neighbor
(
struct
orig_node
*
orig_node
,
struct
orig_node
*
orig_neigh_node
,
uint8_t
*
neigh
,
struct
batman_if
*
if_incoming
)
struct
hard_iface
*
if_incoming
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
if_incoming
->
soft_iface
);
struct
neigh_node
*
neigh_node
;
...
...
@@ -487,9 +487,9 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
return
0
;
}
int
orig_hash_add_if
(
struct
batman_if
*
batman_if
,
int
max_if_num
)
int
orig_hash_add_if
(
struct
hard_iface
*
hard_iface
,
int
max_if_num
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
batman_if
->
soft_iface
);
struct
bat_priv
*
bat_priv
=
netdev_priv
(
hard_iface
->
soft_iface
);
struct
hashtable_t
*
hash
=
bat_priv
->
orig_hash
;
struct
hlist_node
*
node
;
struct
hlist_head
*
head
;
...
...
@@ -572,13 +572,13 @@ static int orig_node_del_if(struct orig_node *orig_node,
return
0
;
}
int
orig_hash_del_if
(
struct
batman_if
*
batman_if
,
int
max_if_num
)
int
orig_hash_del_if
(
struct
hard_iface
*
hard_iface
,
int
max_if_num
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
batman_if
->
soft_iface
);
struct
bat_priv
*
bat_priv
=
netdev_priv
(
hard_iface
->
soft_iface
);
struct
hashtable_t
*
hash
=
bat_priv
->
orig_hash
;
struct
hlist_node
*
node
;
struct
hlist_head
*
head
;
struct
batman_if
*
batman_if
_tmp
;
struct
hard_iface
*
hard_iface
_tmp
;
struct
orig_node
*
orig_node
;
int
i
,
ret
;
...
...
@@ -591,7 +591,7 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num)
hlist_for_each_entry_rcu
(
orig_node
,
node
,
head
,
hash_entry
)
{
spin_lock_bh
(
&
orig_node
->
ogm_cnt_lock
);
ret
=
orig_node_del_if
(
orig_node
,
max_if_num
,
batman_if
->
if_num
);
hard_iface
->
if_num
);
spin_unlock_bh
(
&
orig_node
->
ogm_cnt_lock
);
if
(
ret
==
-
1
)
...
...
@@ -602,22 +602,22 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num)
/* renumber remaining batman interfaces _inside_ of orig_hash_lock */
rcu_read_lock
();
list_for_each_entry_rcu
(
batman_if
_tmp
,
&
hardif_list
,
list
)
{
if
(
batman_if
_tmp
->
if_status
==
IF_NOT_IN_USE
)
list_for_each_entry_rcu
(
hard_iface
_tmp
,
&
hardif_list
,
list
)
{
if
(
hard_iface
_tmp
->
if_status
==
IF_NOT_IN_USE
)
continue
;
if
(
batman_if
==
batman_if
_tmp
)
if
(
hard_iface
==
hard_iface
_tmp
)
continue
;
if
(
batman_if
->
soft_iface
!=
batman_if
_tmp
->
soft_iface
)
if
(
hard_iface
->
soft_iface
!=
hard_iface
_tmp
->
soft_iface
)
continue
;
if
(
batman_if_tmp
->
if_num
>
batman_if
->
if_num
)
batman_if
_tmp
->
if_num
--
;
if
(
hard_iface_tmp
->
if_num
>
hard_iface
->
if_num
)
hard_iface
_tmp
->
if_num
--
;
}
rcu_read_unlock
();
batman_if
->
if_num
=
-
1
;
hard_iface
->
if_num
=
-
1
;
return
0
;
err:
...
...
net/batman-adv/originator.h
浏览文件 @
e6c10f43
...
...
@@ -32,11 +32,11 @@ struct orig_node *get_orig_node(struct bat_priv *bat_priv, uint8_t *addr);
struct
neigh_node
*
create_neighbor
(
struct
orig_node
*
orig_node
,
struct
orig_node
*
orig_neigh_node
,
uint8_t
*
neigh
,
struct
batman_if
*
if_incoming
);
struct
hard_iface
*
if_incoming
);
void
neigh_node_free_ref
(
struct
neigh_node
*
neigh_node
);
int
orig_seq_print_text
(
struct
seq_file
*
seq
,
void
*
offset
);
int
orig_hash_add_if
(
struct
batman_if
*
batman_if
,
int
max_if_num
);
int
orig_hash_del_if
(
struct
batman_if
*
batman_if
,
int
max_if_num
);
int
orig_hash_add_if
(
struct
hard_iface
*
hard_iface
,
int
max_if_num
);
int
orig_hash_del_if
(
struct
hard_iface
*
hard_iface
,
int
max_if_num
);
/* returns 1 if they are the same originator */
...
...
net/batman-adv/routing.c
浏览文件 @
e6c10f43
...
...
@@ -35,9 +35,9 @@
#include "gateway_client.h"
#include "unicast.h"
void
slide_own_bcast_window
(
struct
batman_if
*
batman_if
)
void
slide_own_bcast_window
(
struct
hard_iface
*
hard_iface
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
batman_if
->
soft_iface
);
struct
bat_priv
*
bat_priv
=
netdev_priv
(
hard_iface
->
soft_iface
);
struct
hashtable_t
*
hash
=
bat_priv
->
orig_hash
;
struct
hlist_node
*
node
;
struct
hlist_head
*
head
;
...
...
@@ -52,11 +52,11 @@ void slide_own_bcast_window(struct batman_if *batman_if)
rcu_read_lock
();
hlist_for_each_entry_rcu
(
orig_node
,
node
,
head
,
hash_entry
)
{
spin_lock_bh
(
&
orig_node
->
ogm_cnt_lock
);
word_index
=
batman_if
->
if_num
*
NUM_WORDS
;
word_index
=
hard_iface
->
if_num
*
NUM_WORDS
;
word
=
&
(
orig_node
->
bcast_own
[
word_index
]);
bit_get_packet
(
bat_priv
,
word
,
1
,
0
);
orig_node
->
bcast_own_sum
[
batman_if
->
if_num
]
=
orig_node
->
bcast_own_sum
[
hard_iface
->
if_num
]
=
bit_packet_count
(
word
);
spin_unlock_bh
(
&
orig_node
->
ogm_cnt_lock
);
}
...
...
@@ -143,7 +143,7 @@ void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node,
static
int
is_bidirectional_neigh
(
struct
orig_node
*
orig_node
,
struct
orig_node
*
orig_neigh_node
,
struct
batman_packet
*
batman_packet
,
struct
batman_if
*
if_incoming
)
struct
hard_iface
*
if_incoming
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
if_incoming
->
soft_iface
);
struct
neigh_node
*
neigh_node
=
NULL
,
*
tmp_neigh_node
;
...
...
@@ -368,7 +368,7 @@ static void update_orig(struct bat_priv *bat_priv,
struct
orig_node
*
orig_node
,
struct
ethhdr
*
ethhdr
,
struct
batman_packet
*
batman_packet
,
struct
batman_if
*
if_incoming
,
struct
hard_iface
*
if_incoming
,
unsigned
char
*
hna_buff
,
int
hna_buff_len
,
char
is_duplicate
)
{
...
...
@@ -533,7 +533,7 @@ static int window_protected(struct bat_priv *bat_priv,
*/
static
char
count_real_packets
(
struct
ethhdr
*
ethhdr
,
struct
batman_packet
*
batman_packet
,
struct
batman_if
*
if_incoming
)
struct
hard_iface
*
if_incoming
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
if_incoming
->
soft_iface
);
struct
orig_node
*
orig_node
;
...
...
@@ -598,10 +598,10 @@ static char count_real_packets(struct ethhdr *ethhdr,
void
receive_bat_packet
(
struct
ethhdr
*
ethhdr
,
struct
batman_packet
*
batman_packet
,
unsigned
char
*
hna_buff
,
int
hna_buff_len
,
struct
batman_if
*
if_incoming
)
struct
hard_iface
*
if_incoming
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
if_incoming
->
soft_iface
);
struct
batman_if
*
batman_if
;
struct
hard_iface
*
hard_iface
;
struct
orig_node
*
orig_neigh_node
,
*
orig_node
;
char
has_directlink_flag
;
char
is_my_addr
=
0
,
is_my_orig
=
0
,
is_my_oldorig
=
0
;
...
...
@@ -643,23 +643,23 @@ void receive_bat_packet(struct ethhdr *ethhdr,
has_directlink_flag
);
rcu_read_lock
();
list_for_each_entry_rcu
(
batman_if
,
&
hardif_list
,
list
)
{
if
(
batman_if
->
if_status
!=
IF_ACTIVE
)
list_for_each_entry_rcu
(
hard_iface
,
&
hardif_list
,
list
)
{
if
(
hard_iface
->
if_status
!=
IF_ACTIVE
)
continue
;
if
(
batman_if
->
soft_iface
!=
if_incoming
->
soft_iface
)
if
(
hard_iface
->
soft_iface
!=
if_incoming
->
soft_iface
)
continue
;
if
(
compare_eth
(
ethhdr
->
h_source
,
batman_if
->
net_dev
->
dev_addr
))
hard_iface
->
net_dev
->
dev_addr
))
is_my_addr
=
1
;
if
(
compare_eth
(
batman_packet
->
orig
,
batman_if
->
net_dev
->
dev_addr
))
hard_iface
->
net_dev
->
dev_addr
))
is_my_orig
=
1
;
if
(
compare_eth
(
batman_packet
->
prev_sender
,
batman_if
->
net_dev
->
dev_addr
))
hard_iface
->
net_dev
->
dev_addr
))
is_my_oldorig
=
1
;
if
(
compare_eth
(
ethhdr
->
h_source
,
broadcast_addr
))
...
...
@@ -828,7 +828,7 @@ void receive_bat_packet(struct ethhdr *ethhdr,
orig_node_free_ref
(
orig_node
);
}
int
recv_bat_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
batman_if
)
int
recv_bat_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
hard_iface
)
{
struct
ethhdr
*
ethhdr
;
...
...
@@ -859,7 +859,7 @@ int recv_bat_packet(struct sk_buff *skb, struct batman_if *batman_if)
receive_aggr_bat_packet
(
ethhdr
,
skb
->
data
,
skb_headlen
(
skb
),
batman_if
);
hard_iface
);
kfree_skb
(
skb
);
return
NET_RX_SUCCESS
;
...
...
@@ -997,7 +997,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
}
int
recv_icmp_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
)
int
recv_icmp_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
recv_if
->
soft_iface
);
struct
icmp_packet_rr
*
icmp_packet
;
...
...
@@ -1097,7 +1097,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if)
* refcount.*/
struct
neigh_node
*
find_router
(
struct
bat_priv
*
bat_priv
,
struct
orig_node
*
orig_node
,
struct
batman_if
*
recv_if
)
struct
hard_iface
*
recv_if
)
{
struct
orig_node
*
primary_orig_node
;
struct
orig_node
*
router_orig
;
...
...
@@ -1263,7 +1263,7 @@ static int check_unicast_packet(struct sk_buff *skb, int hdr_size)
return
0
;
}
int
route_unicast_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
,
int
route_unicast_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
,
int
hdr_size
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
recv_if
->
soft_iface
);
...
...
@@ -1349,7 +1349,7 @@ int route_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if,
return
ret
;
}
int
recv_unicast_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
)
int
recv_unicast_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
)
{
struct
unicast_packet
*
unicast_packet
;
int
hdr_size
=
sizeof
(
struct
unicast_packet
);
...
...
@@ -1368,7 +1368,7 @@ int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if)
return
route_unicast_packet
(
skb
,
recv_if
,
hdr_size
);
}
int
recv_ucast_frag_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
)
int
recv_ucast_frag_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
recv_if
->
soft_iface
);
struct
unicast_frag_packet
*
unicast_packet
;
...
...
@@ -1402,7 +1402,7 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if)
}
int
recv_bcast_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
)
int
recv_bcast_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
recv_if
->
soft_iface
);
struct
orig_node
*
orig_node
=
NULL
;
...
...
@@ -1487,7 +1487,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if)
return
ret
;
}
int
recv_vis_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
)
int
recv_vis_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
)
{
struct
vis_packet
*
vis_packet
;
struct
ethhdr
*
ethhdr
;
...
...
net/batman-adv/routing.h
浏览文件 @
e6c10f43
...
...
@@ -22,25 +22,25 @@
#ifndef _NET_BATMAN_ADV_ROUTING_H_
#define _NET_BATMAN_ADV_ROUTING_H_
void
slide_own_bcast_window
(
struct
batman_if
*
batman_if
);
void
slide_own_bcast_window
(
struct
hard_iface
*
hard_iface
);
void
receive_bat_packet
(
struct
ethhdr
*
ethhdr
,
struct
batman_packet
*
batman_packet
,
unsigned
char
*
hna_buff
,
int
hna_buff_len
,
struct
batman_if
*
if_incoming
);
struct
hard_iface
*
if_incoming
);
void
update_routes
(
struct
bat_priv
*
bat_priv
,
struct
orig_node
*
orig_node
,
struct
neigh_node
*
neigh_node
,
unsigned
char
*
hna_buff
,
int
hna_buff_len
);
int
route_unicast_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
,
int
route_unicast_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
,
int
hdr_size
);
int
recv_icmp_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
);
int
recv_unicast_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
);
int
recv_ucast_frag_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
);
int
recv_bcast_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
);
int
recv_vis_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
);
int
recv_bat_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
);
int
recv_icmp_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
);
int
recv_unicast_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
);
int
recv_ucast_frag_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
);
int
recv_bcast_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
);
int
recv_vis_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
);
int
recv_bat_packet
(
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
);
struct
neigh_node
*
find_router
(
struct
bat_priv
*
bat_priv
,
struct
orig_node
*
orig_node
,
struct
batman_if
*
recv_if
);
struct
hard_iface
*
recv_if
);
void
bonding_candidate_del
(
struct
orig_node
*
orig_node
,
struct
neigh_node
*
neigh_node
);
...
...
net/batman-adv/send.c
浏览文件 @
e6c10f43
...
...
@@ -56,20 +56,20 @@ static unsigned long forward_send_time(void)
/* send out an already prepared packet to the given address via the
* specified batman interface */
int
send_skb_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
batman_if
,
struct
hard_iface
*
hard_iface
,
uint8_t
*
dst_addr
)
{
struct
ethhdr
*
ethhdr
;
if
(
batman_if
->
if_status
!=
IF_ACTIVE
)
if
(
hard_iface
->
if_status
!=
IF_ACTIVE
)
goto
send_skb_err
;
if
(
unlikely
(
!
batman_if
->
net_dev
))
if
(
unlikely
(
!
hard_iface
->
net_dev
))
goto
send_skb_err
;
if
(
!
(
batman_if
->
net_dev
->
flags
&
IFF_UP
))
{
if
(
!
(
hard_iface
->
net_dev
->
flags
&
IFF_UP
))
{
pr_warning
(
"Interface %s is not up - can't send packet via "
"that interface!
\n
"
,
batman_if
->
net_dev
->
name
);
"that interface!
\n
"
,
hard_iface
->
net_dev
->
name
);
goto
send_skb_err
;
}
...
...
@@ -80,7 +80,7 @@ int send_skb_packet(struct sk_buff *skb,
skb_reset_mac_header
(
skb
);
ethhdr
=
(
struct
ethhdr
*
)
skb_mac_header
(
skb
);
memcpy
(
ethhdr
->
h_source
,
batman_if
->
net_dev
->
dev_addr
,
ETH_ALEN
);
memcpy
(
ethhdr
->
h_source
,
hard_iface
->
net_dev
->
dev_addr
,
ETH_ALEN
);
memcpy
(
ethhdr
->
h_dest
,
dst_addr
,
ETH_ALEN
);
ethhdr
->
h_proto
=
__constant_htons
(
ETH_P_BATMAN
);
...
...
@@ -88,7 +88,7 @@ int send_skb_packet(struct sk_buff *skb,
skb
->
priority
=
TC_PRIO_CONTROL
;
skb
->
protocol
=
__constant_htons
(
ETH_P_BATMAN
);
skb
->
dev
=
batman_if
->
net_dev
;
skb
->
dev
=
hard_iface
->
net_dev
;
/* dev_queue_xmit() returns a negative result on error. However on
* congestion and traffic shaping, it drops and returns NET_XMIT_DROP
...
...
@@ -102,16 +102,16 @@ int send_skb_packet(struct sk_buff *skb,
/* Send a packet to a given interface */
static
void
send_packet_to_if
(
struct
forw_packet
*
forw_packet
,
struct
batman_if
*
batman_if
)
struct
hard_iface
*
hard_iface
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
batman_if
->
soft_iface
);
struct
bat_priv
*
bat_priv
=
netdev_priv
(
hard_iface
->
soft_iface
);
char
*
fwd_str
;
uint8_t
packet_num
;
int16_t
buff_pos
;
struct
batman_packet
*
batman_packet
;
struct
sk_buff
*
skb
;
if
(
batman_if
->
if_status
!=
IF_ACTIVE
)
if
(
hard_iface
->
if_status
!=
IF_ACTIVE
)
return
;
packet_num
=
0
;
...
...
@@ -126,7 +126,7 @@ static void send_packet_to_if(struct forw_packet *forw_packet,
/* we might have aggregated direct link packets with an
* ordinary base packet */
if
((
forw_packet
->
direct_link_flags
&
(
1
<<
packet_num
))
&&
(
forw_packet
->
if_incoming
==
batman_if
))
(
forw_packet
->
if_incoming
==
hard_iface
))
batman_packet
->
flags
|=
DIRECTLINK
;
else
batman_packet
->
flags
&=
~
DIRECTLINK
;
...
...
@@ -142,7 +142,8 @@ static void send_packet_to_if(struct forw_packet *forw_packet,
batman_packet
->
tq
,
batman_packet
->
ttl
,
(
batman_packet
->
flags
&
DIRECTLINK
?
"on"
:
"off"
),
batman_if
->
net_dev
->
name
,
batman_if
->
net_dev
->
dev_addr
);
hard_iface
->
net_dev
->
name
,
hard_iface
->
net_dev
->
dev_addr
);
buff_pos
+=
sizeof
(
struct
batman_packet
)
+
(
batman_packet
->
num_hna
*
ETH_ALEN
);
...
...
@@ -154,13 +155,13 @@ static void send_packet_to_if(struct forw_packet *forw_packet,
/* create clone because function is called more than once */
skb
=
skb_clone
(
forw_packet
->
skb
,
GFP_ATOMIC
);
if
(
skb
)
send_skb_packet
(
skb
,
batman_if
,
broadcast_addr
);
send_skb_packet
(
skb
,
hard_iface
,
broadcast_addr
);
}
/* send a batman packet */
static
void
send_packet
(
struct
forw_packet
*
forw_packet
)
{
struct
batman_if
*
batman_if
;
struct
hard_iface
*
hard_iface
;
struct
net_device
*
soft_iface
;
struct
bat_priv
*
bat_priv
;
struct
batman_packet
*
batman_packet
=
...
...
@@ -204,17 +205,17 @@ static void send_packet(struct forw_packet *forw_packet)
/* broadcast on every interface */
rcu_read_lock
();
list_for_each_entry_rcu
(
batman_if
,
&
hardif_list
,
list
)
{
if
(
batman_if
->
soft_iface
!=
soft_iface
)
list_for_each_entry_rcu
(
hard_iface
,
&
hardif_list
,
list
)
{
if
(
hard_iface
->
soft_iface
!=
soft_iface
)
continue
;
send_packet_to_if
(
forw_packet
,
batman_if
);
send_packet_to_if
(
forw_packet
,
hard_iface
);
}
rcu_read_unlock
();
}
static
void
rebuild_batman_packet
(
struct
bat_priv
*
bat_priv
,
struct
batman_if
*
batman_if
)
struct
hard_iface
*
hard_iface
)
{
int
new_len
;
unsigned
char
*
new_buff
;
...
...
@@ -226,7 +227,7 @@ static void rebuild_batman_packet(struct bat_priv *bat_priv,
/* keep old buffer if kmalloc should fail */
if
(
new_buff
)
{
memcpy
(
new_buff
,
batman_if
->
packet_buff
,
memcpy
(
new_buff
,
hard_iface
->
packet_buff
,
sizeof
(
struct
batman_packet
));
batman_packet
=
(
struct
batman_packet
*
)
new_buff
;
...
...
@@ -234,21 +235,21 @@ static void rebuild_batman_packet(struct bat_priv *bat_priv,
new_buff
+
sizeof
(
struct
batman_packet
),
new_len
-
sizeof
(
struct
batman_packet
));
kfree
(
batman_if
->
packet_buff
);
batman_if
->
packet_buff
=
new_buff
;
batman_if
->
packet_len
=
new_len
;
kfree
(
hard_iface
->
packet_buff
);
hard_iface
->
packet_buff
=
new_buff
;
hard_iface
->
packet_len
=
new_len
;
}
}
void
schedule_own_packet
(
struct
batman_if
*
batman_if
)
void
schedule_own_packet
(
struct
hard_iface
*
hard_iface
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
batman_if
->
soft_iface
);
struct
bat_priv
*
bat_priv
=
netdev_priv
(
hard_iface
->
soft_iface
);
unsigned
long
send_time
;
struct
batman_packet
*
batman_packet
;
int
vis_server
;
if
((
batman_if
->
if_status
==
IF_NOT_IN_USE
)
||
(
batman_if
->
if_status
==
IF_TO_BE_REMOVED
))
if
((
hard_iface
->
if_status
==
IF_NOT_IN_USE
)
||
(
hard_iface
->
if_status
==
IF_TO_BE_REMOVED
))
return
;
vis_server
=
atomic_read
(
&
bat_priv
->
vis_mode
);
...
...
@@ -260,51 +261,51 @@ void schedule_own_packet(struct batman_if *batman_if)
* outdated packets (especially uninitialized mac addresses) in the
* packet queue
*/
if
(
batman_if
->
if_status
==
IF_TO_BE_ACTIVATED
)
batman_if
->
if_status
=
IF_ACTIVE
;
if
(
hard_iface
->
if_status
==
IF_TO_BE_ACTIVATED
)
hard_iface
->
if_status
=
IF_ACTIVE
;
/* if local hna has changed and interface is a primary interface */
if
((
atomic_read
(
&
bat_priv
->
hna_local_changed
))
&&
(
batman_if
==
bat_priv
->
primary_if
))
rebuild_batman_packet
(
bat_priv
,
batman_if
);
(
hard_iface
==
bat_priv
->
primary_if
))
rebuild_batman_packet
(
bat_priv
,
hard_iface
);
/**
* NOTE: packet_buff might just have been re-allocated in
* rebuild_batman_packet()
*/
batman_packet
=
(
struct
batman_packet
*
)
batman_if
->
packet_buff
;
batman_packet
=
(
struct
batman_packet
*
)
hard_iface
->
packet_buff
;
/* change sequence number to network order */
batman_packet
->
seqno
=
htonl
((
uint32_t
)
atomic_read
(
&
batman_if
->
seqno
));
htonl
((
uint32_t
)
atomic_read
(
&
hard_iface
->
seqno
));
if
(
vis_server
==
VIS_TYPE_SERVER_SYNC
)
batman_packet
->
flags
|=
VIS_SERVER
;
else
batman_packet
->
flags
&=
~
VIS_SERVER
;
if
((
batman_if
==
bat_priv
->
primary_if
)
&&
if
((
hard_iface
==
bat_priv
->
primary_if
)
&&
(
atomic_read
(
&
bat_priv
->
gw_mode
)
==
GW_MODE_SERVER
))
batman_packet
->
gw_flags
=
(
uint8_t
)
atomic_read
(
&
bat_priv
->
gw_bandwidth
);
else
batman_packet
->
gw_flags
=
0
;
atomic_inc
(
&
batman_if
->
seqno
);
atomic_inc
(
&
hard_iface
->
seqno
);
slide_own_bcast_window
(
batman_if
);
slide_own_bcast_window
(
hard_iface
);
send_time
=
own_send_time
(
bat_priv
);
add_bat_packet_to_list
(
bat_priv
,
batman_if
->
packet_buff
,
batman_if
->
packet_len
,
batman_if
,
1
,
send_time
);
hard_iface
->
packet_buff
,
hard_iface
->
packet_len
,
hard_iface
,
1
,
send_time
);
}
void
schedule_forward_packet
(
struct
orig_node
*
orig_node
,
struct
ethhdr
*
ethhdr
,
struct
batman_packet
*
batman_packet
,
uint8_t
directlink
,
int
hna_buff_len
,
struct
batman_if
*
if_incoming
)
struct
hard_iface
*
if_incoming
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
if_incoming
->
soft_iface
);
unsigned
char
in_tq
,
in_ttl
,
tq_avg
=
0
;
...
...
@@ -443,7 +444,7 @@ int add_bcast_packet_to_list(struct bat_priv *bat_priv, struct sk_buff *skb)
static
void
send_outstanding_bcast_packet
(
struct
work_struct
*
work
)
{
struct
batman_if
*
batman_if
;
struct
hard_iface
*
hard_iface
;
struct
delayed_work
*
delayed_work
=
container_of
(
work
,
struct
delayed_work
,
work
);
struct
forw_packet
*
forw_packet
=
...
...
@@ -461,14 +462,14 @@ static void send_outstanding_bcast_packet(struct work_struct *work)
/* rebroadcast packet */
rcu_read_lock
();
list_for_each_entry_rcu
(
batman_if
,
&
hardif_list
,
list
)
{
if
(
batman_if
->
soft_iface
!=
soft_iface
)
list_for_each_entry_rcu
(
hard_iface
,
&
hardif_list
,
list
)
{
if
(
hard_iface
->
soft_iface
!=
soft_iface
)
continue
;
/* send a copy of the saved skb */
skb1
=
skb_clone
(
forw_packet
->
skb
,
GFP_ATOMIC
);
if
(
skb1
)
send_skb_packet
(
skb1
,
batman_if
,
broadcast_addr
);
send_skb_packet
(
skb1
,
hard_iface
,
broadcast_addr
);
}
rcu_read_unlock
();
...
...
@@ -521,15 +522,15 @@ void send_outstanding_bat_packet(struct work_struct *work)
}
void
purge_outstanding_packets
(
struct
bat_priv
*
bat_priv
,
struct
batman_if
*
batman_if
)
struct
hard_iface
*
hard_iface
)
{
struct
forw_packet
*
forw_packet
;
struct
hlist_node
*
tmp_node
,
*
safe_tmp_node
;
if
(
batman_if
)
if
(
hard_iface
)
bat_dbg
(
DBG_BATMAN
,
bat_priv
,
"purge_outstanding_packets(): %s
\n
"
,
batman_if
->
net_dev
->
name
);
hard_iface
->
net_dev
->
name
);
else
bat_dbg
(
DBG_BATMAN
,
bat_priv
,
"purge_outstanding_packets()
\n
"
);
...
...
@@ -543,8 +544,8 @@ void purge_outstanding_packets(struct bat_priv *bat_priv,
* if purge_outstanding_packets() was called with an argmument
* we delete only packets belonging to the given interface
*/
if
((
batman_if
)
&&
(
forw_packet
->
if_incoming
!=
batman_if
))
if
((
hard_iface
)
&&
(
forw_packet
->
if_incoming
!=
hard_iface
))
continue
;
spin_unlock_bh
(
&
bat_priv
->
forw_bcast_list_lock
);
...
...
@@ -567,8 +568,8 @@ void purge_outstanding_packets(struct bat_priv *bat_priv,
* if purge_outstanding_packets() was called with an argmument
* we delete only packets belonging to the given interface
*/
if
((
batman_if
)
&&
(
forw_packet
->
if_incoming
!=
batman_if
))
if
((
hard_iface
)
&&
(
forw_packet
->
if_incoming
!=
hard_iface
))
continue
;
spin_unlock_bh
(
&
bat_priv
->
forw_bat_list_lock
);
...
...
net/batman-adv/send.h
浏览文件 @
e6c10f43
...
...
@@ -23,17 +23,17 @@
#define _NET_BATMAN_ADV_SEND_H_
int
send_skb_packet
(
struct
sk_buff
*
skb
,
struct
batman_if
*
batman_if
,
struct
hard_iface
*
hard_iface
,
uint8_t
*
dst_addr
);
void
schedule_own_packet
(
struct
batman_if
*
batman_if
);
void
schedule_own_packet
(
struct
hard_iface
*
hard_iface
);
void
schedule_forward_packet
(
struct
orig_node
*
orig_node
,
struct
ethhdr
*
ethhdr
,
struct
batman_packet
*
batman_packet
,
uint8_t
directlink
,
int
hna_buff_len
,
struct
batman_if
*
if_outgoing
);
struct
hard_iface
*
if_outgoing
);
int
add_bcast_packet_to_list
(
struct
bat_priv
*
bat_priv
,
struct
sk_buff
*
skb
);
void
send_outstanding_bat_packet
(
struct
work_struct
*
work
);
void
purge_outstanding_packets
(
struct
bat_priv
*
bat_priv
,
struct
batman_if
*
batman_if
);
struct
hard_iface
*
hard_iface
);
#endif
/* _NET_BATMAN_ADV_SEND_H_ */
net/batman-adv/soft-interface.c
浏览文件 @
e6c10f43
...
...
@@ -414,7 +414,7 @@ int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
}
void
interface_rx
(
struct
net_device
*
soft_iface
,
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
,
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
,
int
hdr_size
)
{
struct
bat_priv
*
bat_priv
=
netdev_priv
(
soft_iface
);
...
...
net/batman-adv/soft-interface.h
浏览文件 @
e6c10f43
...
...
@@ -27,7 +27,7 @@ int softif_neigh_seq_print_text(struct seq_file *seq, void *offset);
void
softif_neigh_purge
(
struct
bat_priv
*
bat_priv
);
int
interface_tx
(
struct
sk_buff
*
skb
,
struct
net_device
*
soft_iface
);
void
interface_rx
(
struct
net_device
*
soft_iface
,
struct
sk_buff
*
skb
,
struct
batman_if
*
recv_if
,
struct
sk_buff
*
skb
,
struct
hard_iface
*
recv_if
,
int
hdr_size
);
struct
net_device
*
softif_create
(
char
*
name
);
void
softif_destroy
(
struct
net_device
*
soft_iface
);
...
...
net/batman-adv/types.h
浏览文件 @
e6c10f43
...
...
@@ -33,7 +33,7 @@
sizeof(struct bcast_packet))))
struct
batman_if
{
struct
hard_iface
{
struct
list_head
list
;
int16_t
if_num
;
char
if_status
;
...
...
@@ -124,7 +124,7 @@ struct neigh_node {
atomic_t
refcount
;
struct
rcu_head
rcu
;
struct
orig_node
*
orig_node
;
struct
batman_if
*
if_incoming
;
struct
hard_iface
*
if_incoming
;
};
...
...
@@ -148,7 +148,7 @@ struct bat_priv {
struct
hlist_head
softif_neigh_list
;
struct
softif_neigh
*
softif_neigh
;
struct
debug_log
*
debug_log
;
struct
batman_if
*
primary_if
;
struct
hard_iface
*
primary_if
;
struct
kobject
*
mesh_obj
;
struct
dentry
*
debug_dir
;
struct
hlist_head
forw_bat_list
;
...
...
@@ -217,7 +217,7 @@ struct forw_packet {
uint32_t
direct_link_flags
;
uint8_t
num_packets
;
struct
delayed_work
delayed_work
;
struct
batman_if
*
if_incoming
;
struct
hard_iface
*
if_incoming
;
};
/* While scanning for vis-entries of a particular vis-originator
...
...
net/batman-adv/unicast.c
浏览文件 @
e6c10f43
...
...
@@ -213,7 +213,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
}
int
frag_send_skb
(
struct
sk_buff
*
skb
,
struct
bat_priv
*
bat_priv
,
struct
batman_if
*
batman_if
,
uint8_t
dstaddr
[])
struct
hard_iface
*
hard_iface
,
uint8_t
dstaddr
[])
{
struct
unicast_packet
tmp_uc
,
*
unicast_packet
;
struct
sk_buff
*
frag_skb
;
...
...
@@ -258,12 +258,12 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
frag1
->
flags
=
UNI_FRAG_HEAD
|
large_tail
;
frag2
->
flags
=
large_tail
;
seqno
=
atomic_add_return
(
2
,
&
batman_if
->
frag_seqno
);
seqno
=
atomic_add_return
(
2
,
&
hard_iface
->
frag_seqno
);
frag1
->
seqno
=
htons
(
seqno
-
1
);
frag2
->
seqno
=
htons
(
seqno
);
send_skb_packet
(
skb
,
batman_if
,
dstaddr
);
send_skb_packet
(
frag_skb
,
batman_if
,
dstaddr
);
send_skb_packet
(
skb
,
hard_iface
,
dstaddr
);
send_skb_packet
(
frag_skb
,
hard_iface
,
dstaddr
);
return
NET_RX_SUCCESS
;
drop_frag:
...
...
net/batman-adv/unicast.h
浏览文件 @
e6c10f43
...
...
@@ -32,7 +32,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
void
frag_list_free
(
struct
list_head
*
head
);
int
unicast_send_skb
(
struct
sk_buff
*
skb
,
struct
bat_priv
*
bat_priv
);
int
frag_send_skb
(
struct
sk_buff
*
skb
,
struct
bat_priv
*
bat_priv
,
struct
batman_if
*
batman_if
,
uint8_t
dstaddr
[]);
struct
hard_iface
*
hard_iface
,
uint8_t
dstaddr
[]);
static
inline
int
frag_can_reassemble
(
struct
sk_buff
*
skb
,
int
mtu
)
{
...
...
net/batman-adv/vis.c
浏览文件 @
e6c10f43
...
...
@@ -730,7 +730,7 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
struct
orig_node
*
orig_node
;
struct
vis_packet
*
packet
;
struct
sk_buff
*
skb
;
struct
batman_if
*
batman_if
;
struct
hard_iface
*
hard_iface
;
uint8_t
dstaddr
[
ETH_ALEN
];
int
i
;
...
...
@@ -755,12 +755,12 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
continue
;
memcpy
(
packet
->
target_orig
,
orig_node
->
orig
,
ETH_ALEN
);
batman_if
=
orig_node
->
router
->
if_incoming
;
hard_iface
=
orig_node
->
router
->
if_incoming
;
memcpy
(
dstaddr
,
orig_node
->
router
->
addr
,
ETH_ALEN
);
skb
=
skb_clone
(
info
->
skb_packet
,
GFP_ATOMIC
);
if
(
skb
)
send_skb_packet
(
skb
,
batman_if
,
dstaddr
);
send_skb_packet
(
skb
,
hard_iface
,
dstaddr
);
}
rcu_read_unlock
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录