Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
41347dcd
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
41347dcd
编写于
6月 28, 2012
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ipv4: Kill rt->rt_spec_dst, no longer used.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
35ebf65e
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
12 addition
and
39 deletion
+12
-39
include/net/ip_fib.h
include/net/ip_fib.h
+1
-1
include/net/route.h
include/net/route.h
+0
-1
net/ipv4/fib_frontend.c
net/ipv4/fib_frontend.c
+2
-7
net/ipv4/route.c
net/ipv4/route.c
+9
-29
net/ipv4/xfrm4_policy.c
net/ipv4/xfrm4_policy.c
+0
-1
未找到文件。
include/net/ip_fib.h
浏览文件 @
41347dcd
...
...
@@ -233,7 +233,7 @@ extern void ip_fib_init(void);
extern
__be32
fib_compute_spec_dst
(
struct
sk_buff
*
skb
);
extern
int
fib_validate_source
(
struct
sk_buff
*
skb
,
__be32
src
,
__be32
dst
,
u8
tos
,
int
oif
,
struct
net_device
*
dev
,
__be32
*
spec_dst
,
u32
*
itag
);
u32
*
itag
);
extern
void
fib_select_default
(
struct
fib_result
*
res
);
/* Exported by fib_semantics.c */
...
...
include/net/route.h
浏览文件 @
41347dcd
...
...
@@ -65,7 +65,6 @@ struct rtable {
__be32
rt_gateway
;
/* Miscellaneous cached information */
__be32
rt_spec_dst
;
/* RFC1122 specific destination */
u32
rt_peer_genid
;
unsigned
long
_peer
;
/* long-living peer info */
struct
fib_info
*
fi
;
/* for client ref to shared metrics */
...
...
net/ipv4/fib_frontend.c
浏览文件 @
41347dcd
...
...
@@ -218,8 +218,7 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb)
* called with rcu_read_lock()
*/
int
fib_validate_source
(
struct
sk_buff
*
skb
,
__be32
src
,
__be32
dst
,
u8
tos
,
int
oif
,
struct
net_device
*
dev
,
__be32
*
spec_dst
,
u32
*
itag
)
int
oif
,
struct
net_device
*
dev
,
u32
*
itag
)
{
struct
in_device
*
in_dev
;
struct
flowi4
fl4
;
...
...
@@ -258,7 +257,6 @@ int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, u8 tos,
if
(
res
.
type
!=
RTN_LOCAL
||
!
accept_local
)
goto
e_inval
;
}
*
spec_dst
=
FIB_RES_PREFSRC
(
net
,
res
);
fib_combine_itag
(
itag
,
&
res
);
dev_match
=
false
;
...
...
@@ -287,17 +285,14 @@ int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, u8 tos,
ret
=
0
;
if
(
fib_lookup
(
net
,
&
fl4
,
&
res
)
==
0
)
{
if
(
res
.
type
==
RTN_UNICAST
)
{
*
spec_dst
=
FIB_RES_PREFSRC
(
net
,
res
);
if
(
res
.
type
==
RTN_UNICAST
)
ret
=
FIB_RES_NH
(
res
).
nh_scope
>=
RT_SCOPE_HOST
;
}
}
return
ret
;
last_resort:
if
(
rpf
)
goto
e_rpf
;
*
spec_dst
=
inet_select_addr
(
dev
,
0
,
RT_SCOPE_UNIVERSE
);
*
itag
=
0
;
return
0
;
...
...
net/ipv4/route.c
浏览文件 @
41347dcd
...
...
@@ -440,7 +440,7 @@ static int rt_cache_seq_show(struct seq_file *seq, void *v)
r
->
rt_key_tos
,
-
1
,
HHUptod
,
r
->
rt_spec_dst
,
&
len
);
0
,
&
len
);
seq_printf
(
seq
,
"%*s
\n
"
,
127
-
len
,
""
);
}
...
...
@@ -1978,7 +1978,6 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
{
unsigned
int
hash
;
struct
rtable
*
rth
;
__be32
spec_dst
;
struct
in_device
*
in_dev
=
__in_dev_get_rcu
(
dev
);
u32
itag
=
0
;
int
err
;
...
...
@@ -1999,10 +1998,8 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if
(
ipv4_is_zeronet
(
saddr
))
{
if
(
!
ipv4_is_local_multicast
(
daddr
))
goto
e_inval
;
spec_dst
=
inet_select_addr
(
dev
,
0
,
RT_SCOPE_LINK
);
}
else
{
err
=
fib_validate_source
(
skb
,
saddr
,
0
,
tos
,
0
,
dev
,
&
spec_dst
,
&
itag
);
err
=
fib_validate_source
(
skb
,
saddr
,
0
,
tos
,
0
,
dev
,
&
itag
);
if
(
err
<
0
)
goto
e_err
;
}
...
...
@@ -2029,7 +2026,6 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
rth
->
rt_oif
=
0
;
rth
->
rt_mark
=
skb
->
mark
;
rth
->
rt_gateway
=
daddr
;
rth
->
rt_spec_dst
=
spec_dst
;
rth
->
rt_peer_genid
=
0
;
rt_init_peer
(
rth
,
dev_net
(
dev
)
->
ipv4
.
peers
);
rth
->
fi
=
NULL
;
...
...
@@ -2093,7 +2089,6 @@ static int __mkroute_input(struct sk_buff *skb,
int
err
;
struct
in_device
*
out_dev
;
unsigned
int
flags
=
0
;
__be32
spec_dst
;
u32
itag
;
/* get a working reference to the output device */
...
...
@@ -2105,7 +2100,7 @@ static int __mkroute_input(struct sk_buff *skb,
err
=
fib_validate_source
(
skb
,
saddr
,
daddr
,
tos
,
FIB_RES_OIF
(
*
res
),
in_dev
->
dev
,
&
spec_dst
,
&
itag
);
in_dev
->
dev
,
&
itag
);
if
(
err
<
0
)
{
ip_handle_martian_source
(
in_dev
->
dev
,
in_dev
,
skb
,
daddr
,
saddr
);
...
...
@@ -2157,7 +2152,6 @@ static int __mkroute_input(struct sk_buff *skb,
rth
->
rt_oif
=
0
;
rth
->
rt_mark
=
skb
->
mark
;
rth
->
rt_gateway
=
daddr
;
rth
->
rt_spec_dst
=
spec_dst
;
rth
->
rt_peer_genid
=
0
;
rt_init_peer
(
rth
,
&
res
->
table
->
tb_peers
);
rth
->
fi
=
NULL
;
...
...
@@ -2223,7 +2217,6 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
u32
itag
=
0
;
struct
rtable
*
rth
;
unsigned
int
hash
;
__be32
spec_dst
;
int
err
=
-
EINVAL
;
struct
net
*
net
=
dev_net
(
dev
);
...
...
@@ -2281,12 +2274,11 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if
(
res
.
type
==
RTN_LOCAL
)
{
err
=
fib_validate_source
(
skb
,
saddr
,
daddr
,
tos
,
net
->
loopback_dev
->
ifindex
,
dev
,
&
spec_dst
,
&
itag
);
dev
,
&
itag
);
if
(
err
<
0
)
goto
martian_source_keep_err
;
if
(
err
)
flags
|=
RTCF_DIRECTSRC
;
spec_dst
=
daddr
;
goto
local_input
;
}
...
...
@@ -2302,11 +2294,8 @@ out: return err;
if
(
skb
->
protocol
!=
htons
(
ETH_P_IP
))
goto
e_inval
;
if
(
ipv4_is_zeronet
(
saddr
))
spec_dst
=
inet_select_addr
(
dev
,
0
,
RT_SCOPE_LINK
);
else
{
err
=
fib_validate_source
(
skb
,
saddr
,
0
,
tos
,
0
,
dev
,
&
spec_dst
,
&
itag
);
if
(
!
ipv4_is_zeronet
(
saddr
))
{
err
=
fib_validate_source
(
skb
,
saddr
,
0
,
tos
,
0
,
dev
,
&
itag
);
if
(
err
<
0
)
goto
martian_source_keep_err
;
if
(
err
)
...
...
@@ -2344,7 +2333,6 @@ out: return err;
rth
->
rt_oif
=
0
;
rth
->
rt_mark
=
skb
->
mark
;
rth
->
rt_gateway
=
daddr
;
rth
->
rt_spec_dst
=
spec_dst
;
rth
->
rt_peer_genid
=
0
;
rt_init_peer
(
rth
,
net
->
ipv4
.
peers
);
rth
->
fi
=
NULL
;
...
...
@@ -2362,7 +2350,6 @@ out: return err;
no_route:
RT_CACHE_STAT_INC
(
in_no_route
);
spec_dst
=
inet_select_addr
(
dev
,
0
,
RT_SCOPE_UNIVERSE
);
res
.
type
=
RTN_UNREACHABLE
;
if
(
err
==
-
ESRCH
)
err
=
-
ENETUNREACH
;
...
...
@@ -2545,7 +2532,6 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
rth
->
rt_oif
=
orig_oif
;
rth
->
rt_mark
=
fl4
->
flowi4_mark
;
rth
->
rt_gateway
=
fl4
->
daddr
;
rth
->
rt_spec_dst
=
fl4
->
saddr
;
rth
->
rt_peer_genid
=
0
;
rt_init_peer
(
rth
,
(
res
->
table
?
&
res
->
table
->
tb_peers
:
...
...
@@ -2554,12 +2540,9 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
RT_CACHE_STAT_INC
(
out_slow_tot
);
if
(
flags
&
RTCF_LOCAL
)
{
if
(
flags
&
RTCF_LOCAL
)
rth
->
dst
.
input
=
ip_local_deliver
;
rth
->
rt_spec_dst
=
fl4
->
daddr
;
}
if
(
flags
&
(
RTCF_BROADCAST
|
RTCF_MULTICAST
))
{
rth
->
rt_spec_dst
=
fl4
->
saddr
;
if
(
flags
&
RTCF_LOCAL
&&
!
(
dev_out
->
flags
&
IFF_LOOPBACK
))
{
rth
->
dst
.
output
=
ip_mc_output
;
...
...
@@ -2890,7 +2873,6 @@ struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or
rt
->
rt_dst
=
ort
->
rt_dst
;
rt
->
rt_src
=
ort
->
rt_src
;
rt
->
rt_gateway
=
ort
->
rt_gateway
;
rt
->
rt_spec_dst
=
ort
->
rt_spec_dst
;
rt_transfer_peer
(
rt
,
ort
);
rt
->
fi
=
ort
->
fi
;
if
(
rt
->
fi
)
...
...
@@ -2965,10 +2947,8 @@ static int rt_fill_info(struct net *net,
nla_put_u32
(
skb
,
RTA_FLOW
,
rt
->
dst
.
tclassid
))
goto
nla_put_failure
;
#endif
if
(
rt_is_input_route
(
rt
))
{
if
(
nla_put_be32
(
skb
,
RTA_PREFSRC
,
rt
->
rt_spec_dst
))
goto
nla_put_failure
;
}
else
if
(
rt
->
rt_src
!=
rt
->
rt_key_src
)
{
if
(
!
rt_is_input_route
(
rt
)
&&
rt
->
rt_src
!=
rt
->
rt_key_src
)
{
if
(
nla_put_be32
(
skb
,
RTA_PREFSRC
,
rt
->
rt_src
))
goto
nla_put_failure
;
}
...
...
net/ipv4/xfrm4_policy.c
浏览文件 @
41347dcd
...
...
@@ -100,7 +100,6 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
xdst
->
u
.
rt
.
rt_src
=
rt
->
rt_src
;
xdst
->
u
.
rt
.
rt_dst
=
rt
->
rt_dst
;
xdst
->
u
.
rt
.
rt_gateway
=
rt
->
rt_gateway
;
xdst
->
u
.
rt
.
rt_spec_dst
=
rt
->
rt_spec_dst
;
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录