Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
31e4543d
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
31e4543d
编写于
5月 03, 2011
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ipv4: Make caller provide on-stack flow key to ip_route_output_ports().
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
f1390160
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
48 addition
and
31 deletion
+48
-31
drivers/infiniband/hw/cxgb3/iwch_cm.c
drivers/infiniband/hw/cxgb3/iwch_cm.c
+2
-1
drivers/infiniband/hw/cxgb4/cm.c
drivers/infiniband/hw/cxgb4/cm.c
+2
-1
drivers/net/pptp.c
drivers/net/pptp.c
+4
-2
drivers/scsi/cxgbi/libcxgbi.c
drivers/scsi/cxgbi/libcxgbi.c
+2
-1
include/net/route.h
include/net/route.h
+5
-6
net/ipv4/af_inet.c
net/ipv4/af_inet.c
+2
-1
net/ipv4/igmp.c
net/ipv4/igmp.c
+4
-2
net/ipv4/ip_output.c
net/ipv4/ip_output.c
+2
-1
net/ipv4/ipip.c
net/ipv4/ipip.c
+11
-8
net/ipv4/ipmr.c
net/ipv4/ipmr.c
+3
-2
net/ipv6/ip6_tunnel.c
net/ipv6/ip6_tunnel.c
+3
-2
net/ipv6/sit.c
net/ipv6/sit.c
+4
-2
net/l2tp/l2tp_ip.c
net/l2tp/l2tp_ip.c
+2
-1
net/rxrpc/ar-peer.c
net/rxrpc/ar-peer.c
+2
-1
未找到文件。
drivers/infiniband/hw/cxgb3/iwch_cm.c
浏览文件 @
31e4543d
...
...
@@ -338,8 +338,9 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip,
__be16
peer_port
,
u8
tos
)
{
struct
rtable
*
rt
;
struct
flowi4
fl4
;
rt
=
ip_route_output_ports
(
&
init_net
,
NULL
,
peer_ip
,
local_ip
,
rt
=
ip_route_output_ports
(
&
init_net
,
&
fl4
,
NULL
,
peer_ip
,
local_ip
,
peer_port
,
local_port
,
IPPROTO_TCP
,
tos
,
0
);
if
(
IS_ERR
(
rt
))
...
...
drivers/infiniband/hw/cxgb4/cm.c
浏览文件 @
31e4543d
...
...
@@ -315,8 +315,9 @@ static struct rtable *find_route(struct c4iw_dev *dev, __be32 local_ip,
__be16
peer_port
,
u8
tos
)
{
struct
rtable
*
rt
;
struct
flowi4
fl4
;
rt
=
ip_route_output_ports
(
&
init_net
,
NULL
,
peer_ip
,
local_ip
,
rt
=
ip_route_output_ports
(
&
init_net
,
&
fl4
,
NULL
,
peer_ip
,
local_ip
,
peer_port
,
local_port
,
IPPROTO_TCP
,
tos
,
0
);
if
(
IS_ERR
(
rt
))
...
...
drivers/net/pptp.c
浏览文件 @
31e4543d
...
...
@@ -175,6 +175,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
struct
pptp_opt
*
opt
=
&
po
->
proto
.
pptp
;
struct
pptp_gre_header
*
hdr
;
unsigned
int
header_len
=
sizeof
(
*
hdr
);
struct
flowi4
fl4
;
int
islcp
;
int
len
;
unsigned
char
*
data
;
...
...
@@ -189,7 +190,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
if
(
sk_pppox
(
po
)
->
sk_state
&
PPPOX_DEAD
)
goto
tx_error
;
rt
=
ip_route_output_ports
(
&
init_net
,
NULL
,
rt
=
ip_route_output_ports
(
&
init_net
,
&
fl4
,
NULL
,
opt
->
dst_addr
.
sin_addr
.
s_addr
,
opt
->
src_addr
.
sin_addr
.
s_addr
,
0
,
0
,
IPPROTO_GRE
,
...
...
@@ -434,6 +435,7 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,
struct
pppox_sock
*
po
=
pppox_sk
(
sk
);
struct
pptp_opt
*
opt
=
&
po
->
proto
.
pptp
;
struct
rtable
*
rt
;
struct
flowi4
fl4
;
int
error
=
0
;
if
(
sp
->
sa_protocol
!=
PX_PROTO_PPTP
)
...
...
@@ -463,7 +465,7 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,
po
->
chan
.
private
=
sk
;
po
->
chan
.
ops
=
&
pptp_chan_ops
;
rt
=
ip_route_output_ports
(
&
init_net
,
sk
,
rt
=
ip_route_output_ports
(
&
init_net
,
&
fl4
,
sk
,
opt
->
dst_addr
.
sin_addr
.
s_addr
,
opt
->
src_addr
.
sin_addr
.
s_addr
,
0
,
0
,
...
...
drivers/scsi/cxgbi/libcxgbi.c
浏览文件 @
31e4543d
...
...
@@ -454,8 +454,9 @@ static struct rtable *find_route_ipv4(__be32 saddr, __be32 daddr,
__be16
sport
,
__be16
dport
,
u8
tos
)
{
struct
rtable
*
rt
;
struct
flowi4
fl4
;
rt
=
ip_route_output_ports
(
&
init_net
,
NULL
,
daddr
,
saddr
,
rt
=
ip_route_output_ports
(
&
init_net
,
&
fl4
,
NULL
,
daddr
,
saddr
,
dport
,
sport
,
IPPROTO_TCP
,
tos
,
0
);
if
(
IS_ERR
(
rt
))
return
NULL
;
...
...
include/net/route.h
浏览文件 @
31e4543d
...
...
@@ -137,20 +137,19 @@ static inline struct rtable *ip_route_output(struct net *net, __be32 daddr,
return
ip_route_output_key
(
net
,
&
fl4
);
}
static
inline
struct
rtable
*
ip_route_output_ports
(
struct
net
*
net
,
struct
sock
*
sk
,
static
inline
struct
rtable
*
ip_route_output_ports
(
struct
net
*
net
,
struct
flowi4
*
fl4
,
struct
sock
*
sk
,
__be32
daddr
,
__be32
saddr
,
__be16
dport
,
__be16
sport
,
__u8
proto
,
__u8
tos
,
int
oif
)
{
struct
flowi4
fl4
;
flowi4_init_output
(
&
fl4
,
oif
,
sk
?
sk
->
sk_mark
:
0
,
tos
,
flowi4_init_output
(
fl4
,
oif
,
sk
?
sk
->
sk_mark
:
0
,
tos
,
RT_SCOPE_UNIVERSE
,
proto
,
sk
?
inet_sk_flowi_flags
(
sk
)
:
0
,
daddr
,
saddr
,
dport
,
sport
);
if
(
sk
)
security_sk_classify_flow
(
sk
,
flowi4_to_flowi
(
&
fl4
));
return
ip_route_output_flow
(
net
,
&
fl4
,
sk
);
security_sk_classify_flow
(
sk
,
flowi4_to_flowi
(
fl4
));
return
ip_route_output_flow
(
net
,
fl4
,
sk
);
}
static
inline
struct
rtable
*
ip_route_output_gre
(
struct
net
*
net
,
...
...
net/ipv4/af_inet.c
浏览文件 @
31e4543d
...
...
@@ -1152,6 +1152,7 @@ int inet_sk_rebuild_header(struct sock *sk)
struct
rtable
*
rt
=
(
struct
rtable
*
)
__sk_dst_check
(
sk
,
0
);
__be32
daddr
;
struct
ip_options_rcu
*
inet_opt
;
struct
flowi4
fl4
;
int
err
;
/* Route is OK, nothing to do. */
...
...
@@ -1165,7 +1166,7 @@ int inet_sk_rebuild_header(struct sock *sk)
if
(
inet_opt
&&
inet_opt
->
opt
.
srr
)
daddr
=
inet_opt
->
opt
.
faddr
;
rcu_read_unlock
();
rt
=
ip_route_output_ports
(
sock_net
(
sk
),
sk
,
daddr
,
inet
->
inet_saddr
,
rt
=
ip_route_output_ports
(
sock_net
(
sk
),
&
fl4
,
sk
,
daddr
,
inet
->
inet_saddr
,
inet
->
inet_dport
,
inet
->
inet_sport
,
sk
->
sk_protocol
,
RT_CONN_FLAGS
(
sk
),
sk
->
sk_bound_dev_if
);
...
...
net/ipv4/igmp.c
浏览文件 @
31e4543d
...
...
@@ -309,6 +309,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
struct
iphdr
*
pip
;
struct
igmpv3_report
*
pig
;
struct
net
*
net
=
dev_net
(
dev
);
struct
flowi4
fl4
;
while
(
1
)
{
skb
=
alloc_skb
(
size
+
LL_ALLOCATED_SPACE
(
dev
),
...
...
@@ -321,7 +322,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
}
igmp_skb_size
(
skb
)
=
size
;
rt
=
ip_route_output_ports
(
net
,
NULL
,
IGMPV3_ALL_MCR
,
0
,
rt
=
ip_route_output_ports
(
net
,
&
fl4
,
NULL
,
IGMPV3_ALL_MCR
,
0
,
0
,
0
,
IPPROTO_IGMP
,
0
,
dev
->
ifindex
);
if
(
IS_ERR
(
rt
))
{
...
...
@@ -650,6 +651,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
struct
net_device
*
dev
=
in_dev
->
dev
;
struct
net
*
net
=
dev_net
(
dev
);
__be32
group
=
pmc
?
pmc
->
multiaddr
:
0
;
struct
flowi4
fl4
;
__be32
dst
;
if
(
type
==
IGMPV3_HOST_MEMBERSHIP_REPORT
)
...
...
@@ -659,7 +661,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
else
dst
=
group
;
rt
=
ip_route_output_ports
(
net
,
NULL
,
dst
,
0
,
rt
=
ip_route_output_ports
(
net
,
&
fl4
,
NULL
,
dst
,
0
,
0
,
0
,
IPPROTO_IGMP
,
0
,
dev
->
ifindex
);
if
(
IS_ERR
(
rt
))
...
...
net/ipv4/ip_output.c
浏览文件 @
31e4543d
...
...
@@ -333,6 +333,7 @@ int ip_queue_xmit(struct sk_buff *skb)
/* Make sure we can route this packet. */
rt
=
(
struct
rtable
*
)
__sk_dst_check
(
sk
,
0
);
if
(
rt
==
NULL
)
{
struct
flowi4
fl4
;
__be32
daddr
;
/* Use correct destination address if we have options. */
...
...
@@ -344,7 +345,7 @@ int ip_queue_xmit(struct sk_buff *skb)
* keep trying until route appears or the connection times
* itself out.
*/
rt
=
ip_route_output_ports
(
sock_net
(
sk
),
sk
,
rt
=
ip_route_output_ports
(
sock_net
(
sk
),
&
fl4
,
sk
,
daddr
,
inet
->
inet_saddr
,
inet
->
inet_dport
,
inet
->
inet_sport
,
...
...
net/ipv4/ipip.c
浏览文件 @
31e4543d
...
...
@@ -442,6 +442,7 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
struct
iphdr
*
iph
;
/* Our new IP header */
unsigned
int
max_headroom
;
/* The extra header space needed */
__be32
dst
=
tiph
->
daddr
;
struct
flowi4
fl4
;
int
mtu
;
if
(
skb
->
protocol
!=
htons
(
ETH_P_IP
))
...
...
@@ -460,7 +461,7 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
goto
tx_error_icmp
;
}
rt
=
ip_route_output_ports
(
dev_net
(
dev
),
NULL
,
rt
=
ip_route_output_ports
(
dev_net
(
dev
),
&
fl4
,
NULL
,
dst
,
tiph
->
saddr
,
0
,
0
,
IPPROTO_IPIP
,
RT_TOS
(
tos
),
...
...
@@ -578,13 +579,15 @@ static void ipip_tunnel_bind_dev(struct net_device *dev)
iph
=
&
tunnel
->
parms
.
iph
;
if
(
iph
->
daddr
)
{
struct
rtable
*
rt
=
ip_route_output_ports
(
dev_net
(
dev
),
NULL
,
iph
->
daddr
,
iph
->
saddr
,
0
,
0
,
IPPROTO_IPIP
,
RT_TOS
(
iph
->
tos
),
tunnel
->
parms
.
link
);
struct
rtable
*
rt
;
struct
flowi4
fl4
;
rt
=
ip_route_output_ports
(
dev_net
(
dev
),
&
fl4
,
NULL
,
iph
->
daddr
,
iph
->
saddr
,
0
,
0
,
IPPROTO_IPIP
,
RT_TOS
(
iph
->
tos
),
tunnel
->
parms
.
link
);
if
(
!
IS_ERR
(
rt
))
{
tdev
=
rt
->
dst
.
dev
;
ip_rt_put
(
rt
);
...
...
net/ipv4/ipmr.c
浏览文件 @
31e4543d
...
...
@@ -1595,6 +1595,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
struct
vif_device
*
vif
=
&
mrt
->
vif_table
[
vifi
];
struct
net_device
*
dev
;
struct
rtable
*
rt
;
struct
flowi4
fl4
;
int
encap
=
0
;
if
(
vif
->
dev
==
NULL
)
...
...
@@ -1612,7 +1613,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
#endif
if
(
vif
->
flags
&
VIFF_TUNNEL
)
{
rt
=
ip_route_output_ports
(
net
,
NULL
,
rt
=
ip_route_output_ports
(
net
,
&
fl4
,
NULL
,
vif
->
remote
,
vif
->
local
,
0
,
0
,
IPPROTO_IPIP
,
...
...
@@ -1621,7 +1622,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
goto
out_free
;
encap
=
sizeof
(
struct
iphdr
);
}
else
{
rt
=
ip_route_output_ports
(
net
,
NULL
,
iph
->
daddr
,
0
,
rt
=
ip_route_output_ports
(
net
,
&
fl4
,
NULL
,
iph
->
daddr
,
0
,
0
,
0
,
IPPROTO_IPIP
,
RT_TOS
(
iph
->
tos
),
vif
->
link
);
...
...
net/ipv6/ip6_tunnel.c
浏览文件 @
31e4543d
...
...
@@ -537,6 +537,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
struct
sk_buff
*
skb2
;
const
struct
iphdr
*
eiph
;
struct
rtable
*
rt
;
struct
flowi4
fl4
;
err
=
ip6_tnl_err
(
skb
,
IPPROTO_IPIP
,
opt
,
&
rel_type
,
&
rel_code
,
&
rel_msg
,
&
rel_info
,
offset
);
...
...
@@ -577,7 +578,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
eiph
=
ip_hdr
(
skb2
);
/* Try to guess incoming interface */
rt
=
ip_route_output_ports
(
dev_net
(
skb
->
dev
),
NULL
,
rt
=
ip_route_output_ports
(
dev_net
(
skb
->
dev
),
&
fl4
,
NULL
,
eiph
->
saddr
,
0
,
0
,
0
,
IPPROTO_IPIP
,
RT_TOS
(
eiph
->
tos
),
0
);
...
...
@@ -590,7 +591,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if
(
rt
->
rt_flags
&
RTCF_LOCAL
)
{
ip_rt_put
(
rt
);
rt
=
NULL
;
rt
=
ip_route_output_ports
(
dev_net
(
skb
->
dev
),
NULL
,
rt
=
ip_route_output_ports
(
dev_net
(
skb
->
dev
),
&
fl4
,
NULL
,
eiph
->
daddr
,
eiph
->
saddr
,
0
,
0
,
IPPROTO_IPIP
,
...
...
net/ipv6/sit.c
浏览文件 @
31e4543d
...
...
@@ -674,6 +674,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
struct
iphdr
*
iph
;
/* Our new IP header */
unsigned
int
max_headroom
;
/* The extra header space needed */
__be32
dst
=
tiph
->
daddr
;
struct
flowi4
fl4
;
int
mtu
;
const
struct
in6_addr
*
addr6
;
int
addr_type
;
...
...
@@ -733,7 +734,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
dst
=
addr6
->
s6_addr32
[
3
];
}
rt
=
ip_route_output_ports
(
dev_net
(
dev
),
NULL
,
rt
=
ip_route_output_ports
(
dev_net
(
dev
),
&
fl4
,
NULL
,
dst
,
tiph
->
saddr
,
0
,
0
,
IPPROTO_IPV6
,
RT_TOS
(
tos
),
...
...
@@ -851,12 +852,13 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev)
struct
net_device
*
tdev
=
NULL
;
struct
ip_tunnel
*
tunnel
;
const
struct
iphdr
*
iph
;
struct
flowi4
fl4
;
tunnel
=
netdev_priv
(
dev
);
iph
=
&
tunnel
->
parms
.
iph
;
if
(
iph
->
daddr
)
{
struct
rtable
*
rt
=
ip_route_output_ports
(
dev_net
(
dev
),
NULL
,
struct
rtable
*
rt
=
ip_route_output_ports
(
dev_net
(
dev
),
&
fl4
,
NULL
,
iph
->
daddr
,
iph
->
saddr
,
0
,
0
,
IPPROTO_IPV6
,
...
...
net/l2tp/l2tp_ip.c
浏览文件 @
31e4543d
...
...
@@ -471,6 +471,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
if
(
rt
==
NULL
)
{
struct
ip_options_rcu
*
inet_opt
;
struct
flowi4
fl4
;
rcu_read_lock
();
inet_opt
=
rcu_dereference
(
inet
->
inet_opt
);
...
...
@@ -485,7 +486,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
* keep trying until route appears or the connection times
* itself out.
*/
rt
=
ip_route_output_ports
(
sock_net
(
sk
),
sk
,
rt
=
ip_route_output_ports
(
sock_net
(
sk
),
&
fl4
,
sk
,
daddr
,
inet
->
inet_saddr
,
inet
->
inet_dport
,
inet
->
inet_sport
,
sk
->
sk_protocol
,
RT_CONN_FLAGS
(
sk
),
...
...
net/rxrpc/ar-peer.c
浏览文件 @
31e4543d
...
...
@@ -36,10 +36,11 @@ static void rxrpc_destroy_peer(struct work_struct *work);
static
void
rxrpc_assess_MTU_size
(
struct
rxrpc_peer
*
peer
)
{
struct
rtable
*
rt
;
struct
flowi4
fl4
;
peer
->
if_mtu
=
1500
;
rt
=
ip_route_output_ports
(
&
init_net
,
NULL
,
rt
=
ip_route_output_ports
(
&
init_net
,
&
fl4
,
NULL
,
peer
->
srx
.
transport
.
sin
.
sin_addr
.
s_addr
,
0
,
htons
(
7000
),
htons
(
7001
),
IPPROTO_UDP
,
0
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录