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
nexedi
linux
Commits
1958b856
Commit
1958b856
authored
Mar 12, 2011
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: Put fl6_* macros to struct flowi6 and use them again.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
4c9483b2
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
58 additions
and
61 deletions
+58
-61
include/net/flow.h
include/net/flow.h
+7
-10
net/dccp/ipv6.c
net/dccp/ipv6.c
+10
-10
net/ipv6/af_inet6.c
net/ipv6/af_inet6.c
+2
-2
net/ipv6/datagram.c
net/ipv6/datagram.c
+3
-3
net/ipv6/icmp.c
net/ipv6/icmp.c
+5
-5
net/ipv6/inet6_connection_sock.c
net/ipv6/inet6_connection_sock.c
+4
-4
net/ipv6/mip6.c
net/ipv6/mip6.c
+1
-1
net/ipv6/netfilter/ip6t_REJECT.c
net/ipv6/netfilter/ip6t_REJECT.c
+2
-2
net/ipv6/raw.c
net/ipv6/raw.c
+3
-3
net/ipv6/syncookies.c
net/ipv6/syncookies.c
+2
-2
net/ipv6/tcp_ipv6.c
net/ipv6/tcp_ipv6.c
+8
-8
net/ipv6/udp.c
net/ipv6/udp.c
+5
-5
net/ipv6/xfrm6_policy.c
net/ipv6/xfrm6_policy.c
+6
-6
No files found.
include/net/flow.h
View file @
1958b856
...
@@ -84,6 +84,13 @@ struct flowi6 {
...
@@ -84,6 +84,13 @@ struct flowi6 {
struct
in6_addr
saddr
;
struct
in6_addr
saddr
;
__be32
flowlabel
;
__be32
flowlabel
;
union
flowi_uli
uli
;
union
flowi_uli
uli
;
#define fl6_sport uli.ports.sport
#define fl6_dport uli.ports.dport
#define fl6_icmp_type uli.icmpt.type
#define fl6_icmp_code uli.icmpt.code
#define fl6_ipsec_spi uli.spi
#define fl6_mh_type uli.mht.type
#define fl6_gre_key uli.gre_key
};
};
struct
flowidn
{
struct
flowidn
{
...
@@ -112,16 +119,6 @@ struct flowi {
...
@@ -112,16 +119,6 @@ struct flowi {
#define fld_dst u.dn.daddr
#define fld_dst u.dn.daddr
#define fld_src u.dn.saddr
#define fld_src u.dn.saddr
#define fl6_dst u.ip6.daddr
#define fl6_src u.ip6.saddr
#define fl6_flowlabel u.ip6.flowlabel
#define fl6_sport u.ip6.uli.ports.sport
#define fl6_dport u.ip6.uli.ports.dport
#define fl6_icmp_type u.ip6.uli.icmpt.type
#define fl6_icmp_code u.ip6.uli.icmpt.code
#define fl6_ipsec_spi u.ip6.uli.spi
#define fl6_mh_type u.ip6.uli.mht.type
#define fl6_gre_key u.ip6.uli.gre_key
}
__attribute__
((
__aligned__
(
BITS_PER_LONG
/
8
)));
}
__attribute__
((
__aligned__
(
BITS_PER_LONG
/
8
)));
static
inline
struct
flowi
*
flowi4_to_flowi
(
struct
flowi4
*
fl4
)
static
inline
struct
flowi
*
flowi4_to_flowi
(
struct
flowi4
*
fl4
)
...
...
net/dccp/ipv6.c
View file @
1958b856
...
@@ -158,8 +158,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
...
@@ -158,8 +158,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
ipv6_addr_copy
(
&
fl6
.
daddr
,
&
np
->
daddr
);
ipv6_addr_copy
(
&
fl6
.
daddr
,
&
np
->
daddr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
np
->
saddr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
np
->
saddr
);
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
uli
.
ports
.
dport
=
inet
->
inet_dport
;
fl6
.
fl6_
dport
=
inet
->
inet_dport
;
fl6
.
uli
.
ports
.
sport
=
inet
->
inet_sport
;
fl6
.
fl6_
sport
=
inet
->
inet_sport
;
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
&
fl6
));
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
&
fl6
));
dst
=
ip6_dst_lookup_flow
(
sk
,
&
fl6
,
NULL
,
false
);
dst
=
ip6_dst_lookup_flow
(
sk
,
&
fl6
,
NULL
,
false
);
...
@@ -253,8 +253,8 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
...
@@ -253,8 +253,8 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
ireq6
->
loc_addr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
ireq6
->
loc_addr
);
fl6
.
flowlabel
=
0
;
fl6
.
flowlabel
=
0
;
fl6
.
flowi6_oif
=
ireq6
->
iif
;
fl6
.
flowi6_oif
=
ireq6
->
iif
;
fl6
.
uli
.
ports
.
dport
=
inet_rsk
(
req
)
->
rmt_port
;
fl6
.
fl6_
dport
=
inet_rsk
(
req
)
->
rmt_port
;
fl6
.
uli
.
ports
.
sport
=
inet_rsk
(
req
)
->
loc_port
;
fl6
.
fl6_
sport
=
inet_rsk
(
req
)
->
loc_port
;
security_req_classify_flow
(
req
,
flowi6_to_flowi
(
&
fl6
));
security_req_classify_flow
(
req
,
flowi6_to_flowi
(
&
fl6
));
opt
=
np
->
opt
;
opt
=
np
->
opt
;
...
@@ -323,8 +323,8 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
...
@@ -323,8 +323,8 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
fl6
.
flowi6_proto
=
IPPROTO_DCCP
;
fl6
.
flowi6_proto
=
IPPROTO_DCCP
;
fl6
.
flowi6_oif
=
inet6_iif
(
rxskb
);
fl6
.
flowi6_oif
=
inet6_iif
(
rxskb
);
fl6
.
uli
.
ports
.
dport
=
dccp_hdr
(
skb
)
->
dccph_dport
;
fl6
.
fl6_
dport
=
dccp_hdr
(
skb
)
->
dccph_dport
;
fl6
.
uli
.
ports
.
sport
=
dccp_hdr
(
skb
)
->
dccph_sport
;
fl6
.
fl6_
sport
=
dccp_hdr
(
skb
)
->
dccph_sport
;
security_skb_classify_flow
(
rxskb
,
flowi6_to_flowi
(
&
fl6
));
security_skb_classify_flow
(
rxskb
,
flowi6_to_flowi
(
&
fl6
));
/* sk = NULL, but it is safe for now. RST socket required. */
/* sk = NULL, but it is safe for now. RST socket required. */
...
@@ -535,8 +535,8 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
...
@@ -535,8 +535,8 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
final_p
=
fl6_update_dst
(
&
fl6
,
opt
,
&
final
);
final_p
=
fl6_update_dst
(
&
fl6
,
opt
,
&
final
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
ireq6
->
loc_addr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
ireq6
->
loc_addr
);
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
uli
.
ports
.
dport
=
inet_rsk
(
req
)
->
rmt_port
;
fl6
.
fl6_
dport
=
inet_rsk
(
req
)
->
rmt_port
;
fl6
.
uli
.
ports
.
sport
=
inet_rsk
(
req
)
->
loc_port
;
fl6
.
fl6_
sport
=
inet_rsk
(
req
)
->
loc_port
;
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
&
fl6
));
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
&
fl6
));
dst
=
ip6_dst_lookup_flow
(
sk
,
&
fl6
,
final_p
,
false
);
dst
=
ip6_dst_lookup_flow
(
sk
,
&
fl6
,
final_p
,
false
);
...
@@ -957,8 +957,8 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
...
@@ -957,8 +957,8 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
ipv6_addr_copy
(
&
fl6
.
daddr
,
&
np
->
daddr
);
ipv6_addr_copy
(
&
fl6
.
daddr
,
&
np
->
daddr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
saddr
?
saddr
:
&
np
->
saddr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
saddr
?
saddr
:
&
np
->
saddr
);
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
uli
.
ports
.
dport
=
usin
->
sin6_port
;
fl6
.
fl6_
dport
=
usin
->
sin6_port
;
fl6
.
uli
.
ports
.
sport
=
inet
->
inet_sport
;
fl6
.
fl6_
sport
=
inet
->
inet_sport
;
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
&
fl6
));
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
&
fl6
));
final_p
=
fl6_update_dst
(
&
fl6
,
np
->
opt
,
&
final
);
final_p
=
fl6_update_dst
(
&
fl6
,
np
->
opt
,
&
final
);
...
...
net/ipv6/af_inet6.c
View file @
1958b856
...
@@ -661,8 +661,8 @@ int inet6_sk_rebuild_header(struct sock *sk)
...
@@ -661,8 +661,8 @@ int inet6_sk_rebuild_header(struct sock *sk)
fl6
.
flowlabel
=
np
->
flow_label
;
fl6
.
flowlabel
=
np
->
flow_label
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
uli
.
ports
.
dport
=
inet
->
inet_dport
;
fl6
.
fl6_
dport
=
inet
->
inet_dport
;
fl6
.
uli
.
ports
.
sport
=
inet
->
inet_sport
;
fl6
.
fl6_
sport
=
inet
->
inet_sport
;
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
&
fl6
));
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
&
fl6
));
final_p
=
fl6_update_dst
(
&
fl6
,
np
->
opt
,
&
final
);
final_p
=
fl6_update_dst
(
&
fl6
,
np
->
opt
,
&
final
);
...
...
net/ipv6/datagram.c
View file @
1958b856
...
@@ -151,8 +151,8 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
...
@@ -151,8 +151,8 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
np
->
saddr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
np
->
saddr
);
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
uli
.
ports
.
dport
=
inet
->
inet_dport
;
fl6
.
fl6_
dport
=
inet
->
inet_dport
;
fl6
.
uli
.
ports
.
sport
=
inet
->
inet_sport
;
fl6
.
fl6_
sport
=
inet
->
inet_sport
;
if
(
!
fl6
.
flowi6_oif
&&
(
addr_type
&
IPV6_ADDR_MULTICAST
))
if
(
!
fl6
.
flowi6_oif
&&
(
addr_type
&
IPV6_ADDR_MULTICAST
))
fl6
.
flowi6_oif
=
np
->
mcast_oif
;
fl6
.
flowi6_oif
=
np
->
mcast_oif
;
...
@@ -261,7 +261,7 @@ void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info)
...
@@ -261,7 +261,7 @@ void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info)
serr
->
ee
.
ee_info
=
info
;
serr
->
ee
.
ee_info
=
info
;
serr
->
ee
.
ee_data
=
0
;
serr
->
ee
.
ee_data
=
0
;
serr
->
addr_offset
=
(
u8
*
)
&
iph
->
daddr
-
skb_network_header
(
skb
);
serr
->
addr_offset
=
(
u8
*
)
&
iph
->
daddr
-
skb_network_header
(
skb
);
serr
->
port
=
fl6
->
uli
.
ports
.
dport
;
serr
->
port
=
fl6
->
fl6_
dport
;
__skb_pull
(
skb
,
skb_tail_pointer
(
skb
)
-
skb
->
data
);
__skb_pull
(
skb
,
skb_tail_pointer
(
skb
)
-
skb
->
data
);
skb_reset_transport_header
(
skb
);
skb_reset_transport_header
(
skb
);
...
...
net/ipv6/icmp.c
View file @
1958b856
...
@@ -448,8 +448,8 @@ void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
...
@@ -448,8 +448,8 @@ void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
if
(
saddr
)
if
(
saddr
)
ipv6_addr_copy
(
&
fl6
.
saddr
,
saddr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
saddr
);
fl6
.
flowi6_oif
=
iif
;
fl6
.
flowi6_oif
=
iif
;
fl6
.
uli
.
icmpt
.
type
=
type
;
fl6
.
fl6_icmp_
type
=
type
;
fl6
.
uli
.
icmpt
.
code
=
code
;
fl6
.
fl6_icmp_
code
=
code
;
security_skb_classify_flow
(
skb
,
flowi6_to_flowi
(
&
fl6
));
security_skb_classify_flow
(
skb
,
flowi6_to_flowi
(
&
fl6
));
sk
=
icmpv6_xmit_lock
(
net
);
sk
=
icmpv6_xmit_lock
(
net
);
...
@@ -544,7 +544,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
...
@@ -544,7 +544,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
if
(
saddr
)
if
(
saddr
)
ipv6_addr_copy
(
&
fl6
.
saddr
,
saddr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
saddr
);
fl6
.
flowi6_oif
=
skb
->
dev
->
ifindex
;
fl6
.
flowi6_oif
=
skb
->
dev
->
ifindex
;
fl6
.
uli
.
icmpt
.
type
=
ICMPV6_ECHO_REPLY
;
fl6
.
fl6_icmp_
type
=
ICMPV6_ECHO_REPLY
;
security_skb_classify_flow
(
skb
,
flowi6_to_flowi
(
&
fl6
));
security_skb_classify_flow
(
skb
,
flowi6_to_flowi
(
&
fl6
));
sk
=
icmpv6_xmit_lock
(
net
);
sk
=
icmpv6_xmit_lock
(
net
);
...
@@ -794,8 +794,8 @@ void icmpv6_flow_init(struct sock *sk, struct flowi6 *fl6,
...
@@ -794,8 +794,8 @@ void icmpv6_flow_init(struct sock *sk, struct flowi6 *fl6,
ipv6_addr_copy
(
&
fl6
->
saddr
,
saddr
);
ipv6_addr_copy
(
&
fl6
->
saddr
,
saddr
);
ipv6_addr_copy
(
&
fl6
->
daddr
,
daddr
);
ipv6_addr_copy
(
&
fl6
->
daddr
,
daddr
);
fl6
->
flowi6_proto
=
IPPROTO_ICMPV6
;
fl6
->
flowi6_proto
=
IPPROTO_ICMPV6
;
fl6
->
uli
.
icmpt
.
type
=
type
;
fl6
->
fl6_icmp_
type
=
type
;
fl6
->
uli
.
icmpt
.
code
=
0
;
fl6
->
fl6_icmp_
code
=
0
;
fl6
->
flowi6_oif
=
oif
;
fl6
->
flowi6_oif
=
oif
;
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
fl6
));
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
fl6
));
}
}
...
...
net/ipv6/inet6_connection_sock.c
View file @
1958b856
...
@@ -70,8 +70,8 @@ struct dst_entry *inet6_csk_route_req(struct sock *sk,
...
@@ -70,8 +70,8 @@ struct dst_entry *inet6_csk_route_req(struct sock *sk,
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
treq
->
loc_addr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
treq
->
loc_addr
);
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
uli
.
ports
.
dport
=
inet_rsk
(
req
)
->
rmt_port
;
fl6
.
fl6_
dport
=
inet_rsk
(
req
)
->
rmt_port
;
fl6
.
uli
.
ports
.
sport
=
inet_rsk
(
req
)
->
loc_port
;
fl6
.
fl6_
sport
=
inet_rsk
(
req
)
->
loc_port
;
security_req_classify_flow
(
req
,
flowi6_to_flowi
(
&
fl6
));
security_req_classify_flow
(
req
,
flowi6_to_flowi
(
&
fl6
));
dst
=
ip6_dst_lookup_flow
(
sk
,
&
fl6
,
final_p
,
false
);
dst
=
ip6_dst_lookup_flow
(
sk
,
&
fl6
,
final_p
,
false
);
...
@@ -220,8 +220,8 @@ int inet6_csk_xmit(struct sk_buff *skb)
...
@@ -220,8 +220,8 @@ int inet6_csk_xmit(struct sk_buff *skb)
IP6_ECN_flow_xmit
(
sk
,
fl6
.
flowlabel
);
IP6_ECN_flow_xmit
(
sk
,
fl6
.
flowlabel
);
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
uli
.
ports
.
sport
=
inet
->
inet_sport
;
fl6
.
fl6_
sport
=
inet
->
inet_sport
;
fl6
.
uli
.
ports
.
dport
=
inet
->
inet_dport
;
fl6
.
fl6_
dport
=
inet
->
inet_dport
;
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
&
fl6
));
security_sk_classify_flow
(
sk
,
flowi6_to_flowi
(
&
fl6
));
final_p
=
fl6_update_dst
(
&
fl6
,
np
->
opt
,
&
final
);
final_p
=
fl6_update_dst
(
&
fl6
,
np
->
opt
,
&
final
);
...
...
net/ipv6/mip6.c
View file @
1958b856
...
@@ -216,7 +216,7 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb,
...
@@ -216,7 +216,7 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb,
int
err
=
0
;
int
err
=
0
;
if
(
unlikely
(
fl6
->
flowi6_proto
==
IPPROTO_MH
&&
if
(
unlikely
(
fl6
->
flowi6_proto
==
IPPROTO_MH
&&
fl6
->
uli
.
mht
.
type
<=
IP6_MH_TYPE_MAX
))
fl6
->
fl6_mh_
type
<=
IP6_MH_TYPE_MAX
))
goto
out
;
goto
out
;
if
(
likely
(
opt
->
dsthao
))
{
if
(
likely
(
opt
->
dsthao
))
{
...
...
net/ipv6/netfilter/ip6t_REJECT.c
View file @
1958b856
...
@@ -93,8 +93,8 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
...
@@ -93,8 +93,8 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
fl6
.
flowi6_proto
=
IPPROTO_TCP
;
fl6
.
flowi6_proto
=
IPPROTO_TCP
;
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
oip6h
->
daddr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
oip6h
->
daddr
);
ipv6_addr_copy
(
&
fl6
.
daddr
,
&
oip6h
->
saddr
);
ipv6_addr_copy
(
&
fl6
.
daddr
,
&
oip6h
->
saddr
);
fl6
.
uli
.
ports
.
sport
=
otcph
.
dest
;
fl6
.
fl6_
sport
=
otcph
.
dest
;
fl6
.
uli
.
ports
.
dport
=
otcph
.
source
;
fl6
.
fl6_
dport
=
otcph
.
source
;
security_skb_classify_flow
(
oldskb
,
flowi6_to_flowi
(
&
fl6
));
security_skb_classify_flow
(
oldskb
,
flowi6_to_flowi
(
&
fl6
));
dst
=
ip6_route_output
(
net
,
NULL
,
&
fl6
);
dst
=
ip6_route_output
(
net
,
NULL
,
&
fl6
);
if
(
dst
==
NULL
||
dst
->
error
)
{
if
(
dst
==
NULL
||
dst
->
error
)
{
...
...
net/ipv6/raw.c
View file @
1958b856
...
@@ -693,8 +693,8 @@ static int rawv6_probe_proto_opt(struct flowi6 *fl6, struct msghdr *msg)
...
@@ -693,8 +693,8 @@ static int rawv6_probe_proto_opt(struct flowi6 *fl6, struct msghdr *msg)
code
=
iov
->
iov_base
;
code
=
iov
->
iov_base
;
if
(
type
&&
code
)
{
if
(
type
&&
code
)
{
if
(
get_user
(
fl6
->
uli
.
icmpt
.
type
,
type
)
||
if
(
get_user
(
fl6
->
fl6_icmp_
type
,
type
)
||
get_user
(
fl6
->
uli
.
icmpt
.
code
,
code
))
get_user
(
fl6
->
fl6_icmp_
code
,
code
))
return
-
EFAULT
;
return
-
EFAULT
;
probed
=
1
;
probed
=
1
;
}
}
...
@@ -705,7 +705,7 @@ static int rawv6_probe_proto_opt(struct flowi6 *fl6, struct msghdr *msg)
...
@@ -705,7 +705,7 @@ static int rawv6_probe_proto_opt(struct flowi6 *fl6, struct msghdr *msg)
/* check if type field is readable or not. */
/* check if type field is readable or not. */
if
(
iov
->
iov_len
>
2
-
len
)
{
if
(
iov
->
iov_len
>
2
-
len
)
{
u8
__user
*
p
=
iov
->
iov_base
;
u8
__user
*
p
=
iov
->
iov_base
;
if
(
get_user
(
fl6
->
uli
.
mht
.
type
,
&
p
[
2
-
len
]))
if
(
get_user
(
fl6
->
fl6_mh_
type
,
&
p
[
2
-
len
]))
return
-
EFAULT
;
return
-
EFAULT
;
probed
=
1
;
probed
=
1
;
}
else
}
else
...
...
net/ipv6/syncookies.c
View file @
1958b856
...
@@ -240,8 +240,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
...
@@ -240,8 +240,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
ireq6
->
loc_addr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
ireq6
->
loc_addr
);
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
uli
.
ports
.
dport
=
inet_rsk
(
req
)
->
rmt_port
;
fl6
.
fl6_
dport
=
inet_rsk
(
req
)
->
rmt_port
;
fl6
.
uli
.
ports
.
sport
=
inet_sk
(
sk
)
->
inet_sport
;
fl6
.
fl6_
sport
=
inet_sk
(
sk
)
->
inet_sport
;
security_req_classify_flow
(
req
,
flowi6_to_flowi
(
&
fl6
));
security_req_classify_flow
(
req
,
flowi6_to_flowi
(
&
fl6
));
dst
=
ip6_dst_lookup_flow
(
sk
,
&
fl6
,
final_p
,
false
);
dst
=
ip6_dst_lookup_flow
(
sk
,
&
fl6
,
final_p
,
false
);
...
...
net/ipv6/tcp_ipv6.c
View file @
1958b856
...
@@ -248,8 +248,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
...
@@ -248,8 +248,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
(
saddr
?
saddr
:
&
np
->
saddr
));
(
saddr
?
saddr
:
&
np
->
saddr
));
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
uli
.
ports
.
dport
=
usin
->
sin6_port
;
fl6
.
fl6_
dport
=
usin
->
sin6_port
;
fl6
.
uli
.
ports
.
sport
=
inet
->
inet_sport
;
fl6
.
fl6_
sport
=
inet
->
inet_sport
;
final_p
=
fl6_update_dst
(
&
fl6
,
np
->
opt
,
&
final
);
final_p
=
fl6_update_dst
(
&
fl6
,
np
->
opt
,
&
final
);
...
@@ -401,8 +401,8 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
...
@@ -401,8 +401,8 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
np
->
saddr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
np
->
saddr
);
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_oif
=
sk
->
sk_bound_dev_if
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
uli
.
ports
.
dport
=
inet
->
inet_dport
;
fl6
.
fl6_
dport
=
inet
->
inet_dport
;
fl6
.
uli
.
ports
.
sport
=
inet
->
inet_sport
;
fl6
.
fl6_
sport
=
inet
->
inet_sport
;
security_skb_classify_flow
(
skb
,
flowi6_to_flowi
(
&
fl6
));
security_skb_classify_flow
(
skb
,
flowi6_to_flowi
(
&
fl6
));
dst
=
ip6_dst_lookup_flow
(
sk
,
&
fl6
,
NULL
,
false
);
dst
=
ip6_dst_lookup_flow
(
sk
,
&
fl6
,
NULL
,
false
);
...
@@ -493,8 +493,8 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
...
@@ -493,8 +493,8 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
fl6
.
flowlabel
=
0
;
fl6
.
flowlabel
=
0
;
fl6
.
flowi6_oif
=
treq
->
iif
;
fl6
.
flowi6_oif
=
treq
->
iif
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
flowi6_mark
=
sk
->
sk_mark
;
fl6
.
uli
.
ports
.
dport
=
inet_rsk
(
req
)
->
rmt_port
;
fl6
.
fl6_
dport
=
inet_rsk
(
req
)
->
rmt_port
;
fl6
.
uli
.
ports
.
sport
=
inet_rsk
(
req
)
->
loc_port
;
fl6
.
fl6_
sport
=
inet_rsk
(
req
)
->
loc_port
;
security_req_classify_flow
(
req
,
flowi6_to_flowi
(
&
fl6
));
security_req_classify_flow
(
req
,
flowi6_to_flowi
(
&
fl6
));
opt
=
np
->
opt
;
opt
=
np
->
opt
;
...
@@ -1057,8 +1057,8 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,
...
@@ -1057,8 +1057,8 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,
fl6
.
flowi6_proto
=
IPPROTO_TCP
;
fl6
.
flowi6_proto
=
IPPROTO_TCP
;
fl6
.
flowi6_oif
=
inet6_iif
(
skb
);
fl6
.
flowi6_oif
=
inet6_iif
(
skb
);
fl6
.
uli
.
ports
.
dport
=
t1
->
dest
;
fl6
.
fl6_
dport
=
t1
->
dest
;
fl6
.
uli
.
ports
.
sport
=
t1
->
source
;
fl6
.
fl6_
sport
=
t1
->
source
;
security_skb_classify_flow
(
skb
,
flowi6_to_flowi
(
&
fl6
));
security_skb_classify_flow
(
skb
,
flowi6_to_flowi
(
&
fl6
));
/* Pass a socket to ip6_dst_lookup either it is for RST
/* Pass a socket to ip6_dst_lookup either it is for RST
...
...
net/ipv6/udp.c
View file @
1958b856
...
@@ -899,8 +899,8 @@ static int udp_v6_push_pending_frames(struct sock *sk)
...
@@ -899,8 +899,8 @@ static int udp_v6_push_pending_frames(struct sock *sk)
* Create a UDP header
* Create a UDP header
*/
*/
uh
=
udp_hdr
(
skb
);
uh
=
udp_hdr
(
skb
);
uh
->
source
=
fl6
->
uli
.
ports
.
sport
;
uh
->
source
=
fl6
->
fl6_
sport
;
uh
->
dest
=
fl6
->
uli
.
ports
.
dport
;
uh
->
dest
=
fl6
->
fl6_
dport
;
uh
->
len
=
htons
(
up
->
len
);
uh
->
len
=
htons
(
up
->
len
);
uh
->
check
=
0
;
uh
->
check
=
0
;
...
@@ -1036,7 +1036,7 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
...
@@ -1036,7 +1036,7 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
if
(
sin6
->
sin6_port
==
0
)
if
(
sin6
->
sin6_port
==
0
)
return
-
EINVAL
;
return
-
EINVAL
;
fl6
.
uli
.
ports
.
dport
=
sin6
->
sin6_port
;
fl6
.
fl6_
dport
=
sin6
->
sin6_port
;
daddr
=
&
sin6
->
sin6_addr
;
daddr
=
&
sin6
->
sin6_addr
;
if
(
np
->
sndflow
)
{
if
(
np
->
sndflow
)
{
...
@@ -1065,7 +1065,7 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
...
@@ -1065,7 +1065,7 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
if
(
sk
->
sk_state
!=
TCP_ESTABLISHED
)
if
(
sk
->
sk_state
!=
TCP_ESTABLISHED
)
return
-
EDESTADDRREQ
;
return
-
EDESTADDRREQ
;
fl6
.
uli
.
ports
.
dport
=
inet
->
inet_dport
;
fl6
.
fl6_
dport
=
inet
->
inet_dport
;
daddr
=
&
np
->
daddr
;
daddr
=
&
np
->
daddr
;
fl6
.
flowlabel
=
np
->
flow_label
;
fl6
.
flowlabel
=
np
->
flow_label
;
connected
=
1
;
connected
=
1
;
...
@@ -1112,7 +1112,7 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
...
@@ -1112,7 +1112,7 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
fl6
.
daddr
.
s6_addr
[
15
]
=
0x1
;
/* :: means loopback (BSD'ism) */
fl6
.
daddr
.
s6_addr
[
15
]
=
0x1
;
/* :: means loopback (BSD'ism) */
if
(
ipv6_addr_any
(
&
fl6
.
saddr
)
&&
!
ipv6_addr_any
(
&
np
->
saddr
))
if
(
ipv6_addr_any
(
&
fl6
.
saddr
)
&&
!
ipv6_addr_any
(
&
np
->
saddr
))
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
np
->
saddr
);
ipv6_addr_copy
(
&
fl6
.
saddr
,
&
np
->
saddr
);
fl6
.
uli
.
ports
.
sport
=
inet
->
inet_sport
;
fl6
.
fl6_
sport
=
inet
->
inet_sport
;
final_p
=
fl6_update_dst
(
&
fl6
,
opt
,
&
final
);
final_p
=
fl6_update_dst
(
&
fl6
,
opt
,
&
final
);
if
(
final_p
)
if
(
final_p
)
...
...
net/ipv6/xfrm6_policy.c
View file @
1958b856
...
@@ -160,8 +160,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
...
@@ -160,8 +160,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
pskb_may_pull
(
skb
,
nh
+
offset
+
4
-
skb
->
data
)))
{
pskb_may_pull
(
skb
,
nh
+
offset
+
4
-
skb
->
data
)))
{
__be16
*
ports
=
(
__be16
*
)
exthdr
;
__be16
*
ports
=
(
__be16
*
)
exthdr
;
fl6
->
uli
.
ports
.
sport
=
ports
[
!!
reverse
];
fl6
->
fl6_
sport
=
ports
[
!!
reverse
];
fl6
->
uli
.
ports
.
dport
=
ports
[
!
reverse
];
fl6
->
fl6_
dport
=
ports
[
!
reverse
];
}
}
fl6
->
flowi6_proto
=
nexthdr
;
fl6
->
flowi6_proto
=
nexthdr
;
return
;
return
;
...
@@ -170,8 +170,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
...
@@ -170,8 +170,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
if
(
!
onlyproto
&&
pskb_may_pull
(
skb
,
nh
+
offset
+
2
-
skb
->
data
))
{
if
(
!
onlyproto
&&
pskb_may_pull
(
skb
,
nh
+
offset
+
2
-
skb
->
data
))
{
u8
*
icmp
=
(
u8
*
)
exthdr
;
u8
*
icmp
=
(
u8
*
)
exthdr
;
fl6
->
uli
.
icmpt
.
type
=
icmp
[
0
];
fl6
->
fl6_icmp_
type
=
icmp
[
0
];
fl6
->
uli
.
icmpt
.
code
=
icmp
[
1
];
fl6
->
fl6_icmp_
code
=
icmp
[
1
];
}
}
fl6
->
flowi6_proto
=
nexthdr
;
fl6
->
flowi6_proto
=
nexthdr
;
return
;
return
;
...
@@ -182,7 +182,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
...
@@ -182,7 +182,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
struct
ip6_mh
*
mh
;
struct
ip6_mh
*
mh
;
mh
=
(
struct
ip6_mh
*
)
exthdr
;
mh
=
(
struct
ip6_mh
*
)
exthdr
;
fl6
->
uli
.
mht
.
type
=
mh
->
ip6mh_type
;
fl6
->
fl6_mh_
type
=
mh
->
ip6mh_type
;
}
}
fl6
->
flowi6_proto
=
nexthdr
;
fl6
->
flowi6_proto
=
nexthdr
;
return
;
return
;
...
@@ -193,7 +193,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
...
@@ -193,7 +193,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
case
IPPROTO_ESP
:
case
IPPROTO_ESP
:
case
IPPROTO_COMP
:
case
IPPROTO_COMP
:
default:
default:
fl6
->
uli
.
spi
=
0
;
fl6
->
fl6_ipsec_
spi
=
0
;
fl6
->
flowi6_proto
=
nexthdr
;
fl6
->
flowi6_proto
=
nexthdr
;
return
;
return
;
}
}
...
...
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