diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-12 00:43:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-12 18:08:46 -0500 |
commit | 6281dcc94a96bd73017b2baa8fa83925405109ef (patch) | |
tree | 8deee4d66d256d10ea25f66520eb96b1fade1545 /net/dccp | |
parent | 08704bcbf022786532b5f188935ab6619906049f (diff) |
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 <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ipv4.c | 4 | ||||
-rw-r--r-- | net/dccp/ipv6.c | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 09a09911c5ea..d934b2040230 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -471,8 +471,8 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk, | |||
471 | .fl4_src = ip_hdr(skb)->daddr, | 471 | .fl4_src = ip_hdr(skb)->daddr, |
472 | .fl4_tos = RT_CONN_FLAGS(sk), | 472 | .fl4_tos = RT_CONN_FLAGS(sk), |
473 | .flowi_proto = sk->sk_protocol, | 473 | .flowi_proto = sk->sk_protocol, |
474 | .fl_ip_sport = dccp_hdr(skb)->dccph_dport, | 474 | .fl4_sport = dccp_hdr(skb)->dccph_dport, |
475 | .fl_ip_dport = dccp_hdr(skb)->dccph_sport, | 475 | .fl4_dport = dccp_hdr(skb)->dccph_sport, |
476 | }; | 476 | }; |
477 | 477 | ||
478 | security_skb_classify_flow(skb, &fl); | 478 | security_skb_classify_flow(skb, &fl); |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 5209ee7a3dc2..2b351c6da49a 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -158,8 +158,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
158 | ipv6_addr_copy(&fl.fl6_dst, &np->daddr); | 158 | ipv6_addr_copy(&fl.fl6_dst, &np->daddr); |
159 | ipv6_addr_copy(&fl.fl6_src, &np->saddr); | 159 | ipv6_addr_copy(&fl.fl6_src, &np->saddr); |
160 | fl.flowi_oif = sk->sk_bound_dev_if; | 160 | fl.flowi_oif = sk->sk_bound_dev_if; |
161 | fl.fl_ip_dport = inet->inet_dport; | 161 | fl.fl6_dport = inet->inet_dport; |
162 | fl.fl_ip_sport = inet->inet_sport; | 162 | fl.fl6_sport = inet->inet_sport; |
163 | security_sk_classify_flow(sk, &fl); | 163 | security_sk_classify_flow(sk, &fl); |
164 | 164 | ||
165 | dst = ip6_dst_lookup_flow(sk, &fl, NULL, false); | 165 | 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, | |||
253 | ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); | 253 | ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); |
254 | fl.fl6_flowlabel = 0; | 254 | fl.fl6_flowlabel = 0; |
255 | fl.flowi_oif = ireq6->iif; | 255 | fl.flowi_oif = ireq6->iif; |
256 | fl.fl_ip_dport = inet_rsk(req)->rmt_port; | 256 | fl.fl6_dport = inet_rsk(req)->rmt_port; |
257 | fl.fl_ip_sport = inet_rsk(req)->loc_port; | 257 | fl.fl6_sport = inet_rsk(req)->loc_port; |
258 | security_req_classify_flow(req, &fl); | 258 | security_req_classify_flow(req, &fl); |
259 | 259 | ||
260 | opt = np->opt; | 260 | opt = np->opt; |
@@ -323,8 +323,8 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) | |||
323 | 323 | ||
324 | fl.flowi_proto = IPPROTO_DCCP; | 324 | fl.flowi_proto = IPPROTO_DCCP; |
325 | fl.flowi_oif = inet6_iif(rxskb); | 325 | fl.flowi_oif = inet6_iif(rxskb); |
326 | fl.fl_ip_dport = dccp_hdr(skb)->dccph_dport; | 326 | fl.fl6_dport = dccp_hdr(skb)->dccph_dport; |
327 | fl.fl_ip_sport = dccp_hdr(skb)->dccph_sport; | 327 | fl.fl6_sport = dccp_hdr(skb)->dccph_sport; |
328 | security_skb_classify_flow(rxskb, &fl); | 328 | security_skb_classify_flow(rxskb, &fl); |
329 | 329 | ||
330 | /* sk = NULL, but it is safe for now. RST socket required. */ | 330 | /* 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 | final_p = fl6_update_dst(&fl, opt, &final); | 535 | final_p = fl6_update_dst(&fl, opt, &final); |
536 | ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); | 536 | ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); |
537 | fl.flowi_oif = sk->sk_bound_dev_if; | 537 | fl.flowi_oif = sk->sk_bound_dev_if; |
538 | fl.fl_ip_dport = inet_rsk(req)->rmt_port; | 538 | fl.fl6_dport = inet_rsk(req)->rmt_port; |
539 | fl.fl_ip_sport = inet_rsk(req)->loc_port; | 539 | fl.fl6_sport = inet_rsk(req)->loc_port; |
540 | security_sk_classify_flow(sk, &fl); | 540 | security_sk_classify_flow(sk, &fl); |
541 | 541 | ||
542 | dst = ip6_dst_lookup_flow(sk, &fl, final_p, false); | 542 | 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, | |||
957 | ipv6_addr_copy(&fl.fl6_dst, &np->daddr); | 957 | ipv6_addr_copy(&fl.fl6_dst, &np->daddr); |
958 | ipv6_addr_copy(&fl.fl6_src, saddr ? saddr : &np->saddr); | 958 | ipv6_addr_copy(&fl.fl6_src, saddr ? saddr : &np->saddr); |
959 | fl.flowi_oif = sk->sk_bound_dev_if; | 959 | fl.flowi_oif = sk->sk_bound_dev_if; |
960 | fl.fl_ip_dport = usin->sin6_port; | 960 | fl.fl6_dport = usin->sin6_port; |
961 | fl.fl_ip_sport = inet->inet_sport; | 961 | fl.fl6_sport = inet->inet_sport; |
962 | security_sk_classify_flow(sk, &fl); | 962 | security_sk_classify_flow(sk, &fl); |
963 | 963 | ||
964 | final_p = fl6_update_dst(&fl, np->opt, &final); | 964 | final_p = fl6_update_dst(&fl, np->opt, &final); |