Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
d6c0a4f6
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,发现更多精彩内容 >>
提交
d6c0a4f6
编写于
7月 01, 2012
作者:
D
David Miller
提交者:
David S. Miller
7月 20, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ipv4: Kill 'rt_src' from 'struct rtable'
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
1a00fee4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
21 deletion
+15
-21
include/net/route.h
include/net/route.h
+0
-1
net/ipv4/route.c
net/ipv4/route.c
+15
-19
net/ipv4/xfrm4_policy.c
net/ipv4/xfrm4_policy.c
+0
-1
未找到文件。
include/net/route.h
浏览文件 @
d6c0a4f6
...
@@ -49,7 +49,6 @@ struct rtable {
...
@@ -49,7 +49,6 @@ struct rtable {
__u16
rt_type
;
__u16
rt_type
;
__be32
rt_dst
;
/* Path destination */
__be32
rt_dst
;
/* Path destination */
__be32
rt_src
;
/* Path source */
int
rt_route_iif
;
int
rt_route_iif
;
int
rt_iif
;
int
rt_iif
;
int
rt_oif
;
int
rt_oif
;
...
...
net/ipv4/route.c
浏览文件 @
d6c0a4f6
...
@@ -1272,7 +1272,6 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
...
@@ -1272,7 +1272,6 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
rth
->
rt_flags
=
RTCF_MULTICAST
;
rth
->
rt_flags
=
RTCF_MULTICAST
;
rth
->
rt_type
=
RTN_MULTICAST
;
rth
->
rt_type
=
RTN_MULTICAST
;
rth
->
rt_dst
=
daddr
;
rth
->
rt_dst
=
daddr
;
rth
->
rt_src
=
saddr
;
rth
->
rt_route_iif
=
dev
->
ifindex
;
rth
->
rt_route_iif
=
dev
->
ifindex
;
rth
->
rt_iif
=
dev
->
ifindex
;
rth
->
rt_iif
=
dev
->
ifindex
;
rth
->
rt_oif
=
0
;
rth
->
rt_oif
=
0
;
...
@@ -1393,7 +1392,6 @@ static int __mkroute_input(struct sk_buff *skb,
...
@@ -1393,7 +1392,6 @@ static int __mkroute_input(struct sk_buff *skb,
rth
->
rt_flags
=
flags
;
rth
->
rt_flags
=
flags
;
rth
->
rt_type
=
res
->
type
;
rth
->
rt_type
=
res
->
type
;
rth
->
rt_dst
=
daddr
;
rth
->
rt_dst
=
daddr
;
rth
->
rt_src
=
saddr
;
rth
->
rt_route_iif
=
in_dev
->
dev
->
ifindex
;
rth
->
rt_route_iif
=
in_dev
->
dev
->
ifindex
;
rth
->
rt_iif
=
in_dev
->
dev
->
ifindex
;
rth
->
rt_iif
=
in_dev
->
dev
->
ifindex
;
rth
->
rt_oif
=
0
;
rth
->
rt_oif
=
0
;
...
@@ -1561,7 +1559,6 @@ out: return err;
...
@@ -1561,7 +1559,6 @@ out: return err;
rth
->
rt_flags
=
flags
|
RTCF_LOCAL
;
rth
->
rt_flags
=
flags
|
RTCF_LOCAL
;
rth
->
rt_type
=
res
.
type
;
rth
->
rt_type
=
res
.
type
;
rth
->
rt_dst
=
daddr
;
rth
->
rt_dst
=
daddr
;
rth
->
rt_src
=
saddr
;
rth
->
rt_route_iif
=
dev
->
ifindex
;
rth
->
rt_route_iif
=
dev
->
ifindex
;
rth
->
rt_iif
=
dev
->
ifindex
;
rth
->
rt_iif
=
dev
->
ifindex
;
rth
->
rt_oif
=
0
;
rth
->
rt_oif
=
0
;
...
@@ -1714,7 +1711,6 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
...
@@ -1714,7 +1711,6 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
rth
->
rt_flags
=
flags
;
rth
->
rt_flags
=
flags
;
rth
->
rt_type
=
type
;
rth
->
rt_type
=
type
;
rth
->
rt_dst
=
fl4
->
daddr
;
rth
->
rt_dst
=
fl4
->
daddr
;
rth
->
rt_src
=
fl4
->
saddr
;
rth
->
rt_route_iif
=
0
;
rth
->
rt_route_iif
=
0
;
rth
->
rt_iif
=
orig_oif
?
:
dev_out
->
ifindex
;
rth
->
rt_iif
=
orig_oif
?
:
dev_out
->
ifindex
;
rth
->
rt_oif
=
orig_oif
;
rth
->
rt_oif
=
orig_oif
;
...
@@ -2005,7 +2001,6 @@ struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or
...
@@ -2005,7 +2001,6 @@ struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or
rt
->
rt_flags
=
ort
->
rt_flags
;
rt
->
rt_flags
=
ort
->
rt_flags
;
rt
->
rt_type
=
ort
->
rt_type
;
rt
->
rt_type
=
ort
->
rt_type
;
rt
->
rt_dst
=
ort
->
rt_dst
;
rt
->
rt_dst
=
ort
->
rt_dst
;
rt
->
rt_src
=
ort
->
rt_src
;
rt
->
rt_gateway
=
ort
->
rt_gateway
;
rt
->
rt_gateway
=
ort
->
rt_gateway
;
rt
->
fi
=
ort
->
fi
;
rt
->
fi
=
ort
->
fi
;
if
(
rt
->
fi
)
if
(
rt
->
fi
)
...
@@ -2036,7 +2031,7 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,
...
@@ -2036,7 +2031,7 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,
}
}
EXPORT_SYMBOL_GPL
(
ip_route_output_flow
);
EXPORT_SYMBOL_GPL
(
ip_route_output_flow
);
static
int
rt_fill_info
(
struct
net
*
net
,
__be32
src
,
u8
tos
,
static
int
rt_fill_info
(
struct
net
*
net
,
__be32
src
,
struct
flowi4
*
fl4
,
struct
sk_buff
*
skb
,
u32
pid
,
u32
seq
,
int
event
,
struct
sk_buff
*
skb
,
u32
pid
,
u32
seq
,
int
event
,
int
nowait
,
unsigned
int
flags
)
int
nowait
,
unsigned
int
flags
)
{
{
...
@@ -2055,7 +2050,7 @@ static int rt_fill_info(struct net *net, __be32 src, u8 tos,
...
@@ -2055,7 +2050,7 @@ static int rt_fill_info(struct net *net, __be32 src, u8 tos,
r
->
rtm_family
=
AF_INET
;
r
->
rtm_family
=
AF_INET
;
r
->
rtm_dst_len
=
32
;
r
->
rtm_dst_len
=
32
;
r
->
rtm_src_len
=
0
;
r
->
rtm_src_len
=
0
;
r
->
rtm_tos
=
tos
;
r
->
rtm_tos
=
fl4
->
flowi4_
tos
;
r
->
rtm_table
=
RT_TABLE_MAIN
;
r
->
rtm_table
=
RT_TABLE_MAIN
;
if
(
nla_put_u32
(
skb
,
RTA_TABLE
,
RT_TABLE_MAIN
))
if
(
nla_put_u32
(
skb
,
RTA_TABLE
,
RT_TABLE_MAIN
))
goto
nla_put_failure
;
goto
nla_put_failure
;
...
@@ -2082,11 +2077,11 @@ static int rt_fill_info(struct net *net, __be32 src, u8 tos,
...
@@ -2082,11 +2077,11 @@ static int rt_fill_info(struct net *net, __be32 src, u8 tos,
goto
nla_put_failure
;
goto
nla_put_failure
;
#endif
#endif
if
(
!
rt_is_input_route
(
rt
)
&&
if
(
!
rt_is_input_route
(
rt
)
&&
rt
->
rt_src
!=
src
)
{
fl4
->
saddr
!=
src
)
{
if
(
nla_put_be32
(
skb
,
RTA_PREFSRC
,
rt
->
rt_src
))
if
(
nla_put_be32
(
skb
,
RTA_PREFSRC
,
fl4
->
saddr
))
goto
nla_put_failure
;
goto
nla_put_failure
;
}
}
if
(
rt
->
rt_dst
!=
rt
->
rt_gateway
&&
if
(
fl4
->
daddr
!=
rt
->
rt_gateway
&&
nla_put_be32
(
skb
,
RTA_GATEWAY
,
rt
->
rt_gateway
))
nla_put_be32
(
skb
,
RTA_GATEWAY
,
rt
->
rt_gateway
))
goto
nla_put_failure
;
goto
nla_put_failure
;
...
@@ -2116,7 +2111,7 @@ static int rt_fill_info(struct net *net, __be32 src, u8 tos,
...
@@ -2116,7 +2111,7 @@ static int rt_fill_info(struct net *net, __be32 src, u8 tos,
if
(
ipv4_is_multicast
(
dst
)
&&
!
ipv4_is_local_multicast
(
dst
)
&&
if
(
ipv4_is_multicast
(
dst
)
&&
!
ipv4_is_local_multicast
(
dst
)
&&
IPV4_DEVCONF_ALL
(
net
,
MC_FORWARDING
))
{
IPV4_DEVCONF_ALL
(
net
,
MC_FORWARDING
))
{
int
err
=
ipmr_get_route
(
net
,
skb
,
int
err
=
ipmr_get_route
(
net
,
skb
,
rt
->
rt_src
,
rt
->
rt_dst
,
fl4
->
saddr
,
fl4
->
daddr
,
r
,
nowait
);
r
,
nowait
);
if
(
err
<=
0
)
{
if
(
err
<=
0
)
{
if
(
!
nowait
)
{
if
(
!
nowait
)
{
...
@@ -2151,6 +2146,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
...
@@ -2151,6 +2146,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
struct
rtmsg
*
rtm
;
struct
rtmsg
*
rtm
;
struct
nlattr
*
tb
[
RTA_MAX
+
1
];
struct
nlattr
*
tb
[
RTA_MAX
+
1
];
struct
rtable
*
rt
=
NULL
;
struct
rtable
*
rt
=
NULL
;
struct
flowi4
fl4
;
__be32
dst
=
0
;
__be32
dst
=
0
;
__be32
src
=
0
;
__be32
src
=
0
;
u32
iif
;
u32
iif
;
...
@@ -2185,6 +2181,13 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
...
@@ -2185,6 +2181,13 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
iif
=
tb
[
RTA_IIF
]
?
nla_get_u32
(
tb
[
RTA_IIF
])
:
0
;
iif
=
tb
[
RTA_IIF
]
?
nla_get_u32
(
tb
[
RTA_IIF
])
:
0
;
mark
=
tb
[
RTA_MARK
]
?
nla_get_u32
(
tb
[
RTA_MARK
])
:
0
;
mark
=
tb
[
RTA_MARK
]
?
nla_get_u32
(
tb
[
RTA_MARK
])
:
0
;
memset
(
&
fl4
,
0
,
sizeof
(
fl4
));
fl4
.
daddr
=
dst
;
fl4
.
saddr
=
src
;
fl4
.
flowi4_tos
=
rtm
->
rtm_tos
;
fl4
.
flowi4_oif
=
tb
[
RTA_OIF
]
?
nla_get_u32
(
tb
[
RTA_OIF
])
:
0
;
fl4
.
flowi4_mark
=
mark
;
if
(
iif
)
{
if
(
iif
)
{
struct
net_device
*
dev
;
struct
net_device
*
dev
;
...
@@ -2205,13 +2208,6 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
...
@@ -2205,13 +2208,6 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
if
(
err
==
0
&&
rt
->
dst
.
error
)
if
(
err
==
0
&&
rt
->
dst
.
error
)
err
=
-
rt
->
dst
.
error
;
err
=
-
rt
->
dst
.
error
;
}
else
{
}
else
{
struct
flowi4
fl4
=
{
.
daddr
=
dst
,
.
saddr
=
src
,
.
flowi4_tos
=
rtm
->
rtm_tos
,
.
flowi4_oif
=
tb
[
RTA_OIF
]
?
nla_get_u32
(
tb
[
RTA_OIF
])
:
0
,
.
flowi4_mark
=
mark
,
};
rt
=
ip_route_output_key
(
net
,
&
fl4
);
rt
=
ip_route_output_key
(
net
,
&
fl4
);
err
=
0
;
err
=
0
;
...
@@ -2226,7 +2222,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
...
@@ -2226,7 +2222,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
if
(
rtm
->
rtm_flags
&
RTM_F_NOTIFY
)
if
(
rtm
->
rtm_flags
&
RTM_F_NOTIFY
)
rt
->
rt_flags
|=
RTCF_NOTIFY
;
rt
->
rt_flags
|=
RTCF_NOTIFY
;
err
=
rt_fill_info
(
net
,
src
,
rtm
->
rtm_tos
,
skb
,
err
=
rt_fill_info
(
net
,
src
,
&
fl4
,
skb
,
NETLINK_CB
(
in_skb
).
pid
,
nlh
->
nlmsg_seq
,
NETLINK_CB
(
in_skb
).
pid
,
nlh
->
nlmsg_seq
,
RTM_NEWROUTE
,
0
,
0
);
RTM_NEWROUTE
,
0
,
0
);
if
(
err
<=
0
)
if
(
err
<=
0
)
...
...
net/ipv4/xfrm4_policy.c
浏览文件 @
d6c0a4f6
...
@@ -92,7 +92,6 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
...
@@ -92,7 +92,6 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
xdst
->
u
.
rt
.
rt_flags
=
rt
->
rt_flags
&
(
RTCF_BROADCAST
|
RTCF_MULTICAST
|
xdst
->
u
.
rt
.
rt_flags
=
rt
->
rt_flags
&
(
RTCF_BROADCAST
|
RTCF_MULTICAST
|
RTCF_LOCAL
);
RTCF_LOCAL
);
xdst
->
u
.
rt
.
rt_type
=
rt
->
rt_type
;
xdst
->
u
.
rt
.
rt_type
=
rt
->
rt_type
;
xdst
->
u
.
rt
.
rt_src
=
rt
->
rt_src
;
xdst
->
u
.
rt
.
rt_dst
=
rt
->
rt_dst
;
xdst
->
u
.
rt
.
rt_dst
=
rt
->
rt_dst
;
xdst
->
u
.
rt
.
rt_gateway
=
rt
->
rt_gateway
;
xdst
->
u
.
rt
.
rt_gateway
=
rt
->
rt_gateway
;
xdst
->
u
.
rt
.
rt_pmtu
=
rt
->
rt_pmtu
;
xdst
->
u
.
rt
.
rt_pmtu
=
rt
->
rt_pmtu
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录