mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
net: Make flowi ports AF dependent.
Create two sets of port member accessors, one set prefixed by fl4_* and the other prefixed by fl6_* This will let us to create AF optimal flow instances. It will work because every context in which we access the ports, we have to be fully aware of which AF the flowi is anyways. Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
08704bcbf0
commit
6281dcc94a
28 changed files with 139 additions and 129 deletions
|
|
@ -471,8 +471,8 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
|
|||
.fl4_src = ip_hdr(skb)->daddr,
|
||||
.fl4_tos = RT_CONN_FLAGS(sk),
|
||||
.flowi_proto = sk->sk_protocol,
|
||||
.fl_ip_sport = dccp_hdr(skb)->dccph_dport,
|
||||
.fl_ip_dport = dccp_hdr(skb)->dccph_sport,
|
||||
.fl4_sport = dccp_hdr(skb)->dccph_dport,
|
||||
.fl4_dport = dccp_hdr(skb)->dccph_sport,
|
||||
};
|
||||
|
||||
security_skb_classify_flow(skb, &fl);
|
||||
|
|
|
|||
|
|
@ -158,8 +158,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
|||
ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
|
||||
ipv6_addr_copy(&fl.fl6_src, &np->saddr);
|
||||
fl.flowi_oif = sk->sk_bound_dev_if;
|
||||
fl.fl_ip_dport = inet->inet_dport;
|
||||
fl.fl_ip_sport = inet->inet_sport;
|
||||
fl.fl6_dport = inet->inet_dport;
|
||||
fl.fl6_sport = inet->inet_sport;
|
||||
security_sk_classify_flow(sk, &fl);
|
||||
|
||||
dst = ip6_dst_lookup_flow(sk, &fl, NULL, false);
|
||||
|
|
@ -253,8 +253,8 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
|
|||
ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
|
||||
fl.fl6_flowlabel = 0;
|
||||
fl.flowi_oif = ireq6->iif;
|
||||
fl.fl_ip_dport = inet_rsk(req)->rmt_port;
|
||||
fl.fl_ip_sport = inet_rsk(req)->loc_port;
|
||||
fl.fl6_dport = inet_rsk(req)->rmt_port;
|
||||
fl.fl6_sport = inet_rsk(req)->loc_port;
|
||||
security_req_classify_flow(req, &fl);
|
||||
|
||||
opt = np->opt;
|
||||
|
|
@ -323,8 +323,8 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
|
|||
|
||||
fl.flowi_proto = IPPROTO_DCCP;
|
||||
fl.flowi_oif = inet6_iif(rxskb);
|
||||
fl.fl_ip_dport = dccp_hdr(skb)->dccph_dport;
|
||||
fl.fl_ip_sport = dccp_hdr(skb)->dccph_sport;
|
||||
fl.fl6_dport = dccp_hdr(skb)->dccph_dport;
|
||||
fl.fl6_sport = dccp_hdr(skb)->dccph_sport;
|
||||
security_skb_classify_flow(rxskb, &fl);
|
||||
|
||||
/* 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,
|
|||
final_p = fl6_update_dst(&fl, opt, &final);
|
||||
ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
|
||||
fl.flowi_oif = sk->sk_bound_dev_if;
|
||||
fl.fl_ip_dport = inet_rsk(req)->rmt_port;
|
||||
fl.fl_ip_sport = inet_rsk(req)->loc_port;
|
||||
fl.fl6_dport = inet_rsk(req)->rmt_port;
|
||||
fl.fl6_sport = inet_rsk(req)->loc_port;
|
||||
security_sk_classify_flow(sk, &fl);
|
||||
|
||||
dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
|
||||
|
|
@ -957,8 +957,8 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
|
|||
ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
|
||||
ipv6_addr_copy(&fl.fl6_src, saddr ? saddr : &np->saddr);
|
||||
fl.flowi_oif = sk->sk_bound_dev_if;
|
||||
fl.fl_ip_dport = usin->sin6_port;
|
||||
fl.fl_ip_sport = inet->inet_sport;
|
||||
fl.fl6_dport = usin->sin6_port;
|
||||
fl.fl6_sport = inet->inet_sport;
|
||||
security_sk_classify_flow(sk, &fl);
|
||||
|
||||
final_p = fl6_update_dst(&fl, np->opt, &final);
|
||||
|
|
|
|||
Loading…
Reference in a new issue