Commit 4c9483b2fb5d2548c3cc1fe03cdd4484ceeb5d1c

Authored by David S. Miller
1 parent 9cce96df5b

ipv6: Convert to use flowi6 where applicable.

Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 35 changed files with 632 additions and 630 deletions Side-by-side Diff

drivers/infiniband/core/addr.c
... ... @@ -231,28 +231,28 @@
231 231 struct sockaddr_in6 *dst_in,
232 232 struct rdma_dev_addr *addr)
233 233 {
234   - struct flowi fl;
  234 + struct flowi6 fl6;
235 235 struct neighbour *neigh;
236 236 struct dst_entry *dst;
237 237 int ret;
238 238  
239   - memset(&fl, 0, sizeof fl);
240   - ipv6_addr_copy(&fl.fl6_dst, &dst_in->sin6_addr);
241   - ipv6_addr_copy(&fl.fl6_src, &src_in->sin6_addr);
242   - fl.flowi_oif = addr->bound_dev_if;
  239 + memset(&fl6, 0, sizeof fl6);
  240 + ipv6_addr_copy(&fl6.daddr, &dst_in->sin6_addr);
  241 + ipv6_addr_copy(&fl6.saddr, &src_in->sin6_addr);
  242 + fl6.flowi6_oif = addr->bound_dev_if;
243 243  
244   - dst = ip6_route_output(&init_net, NULL, &fl);
  244 + dst = ip6_route_output(&init_net, NULL, &fl6);
245 245 if ((ret = dst->error))
246 246 goto put;
247 247  
248   - if (ipv6_addr_any(&fl.fl6_src)) {
  248 + if (ipv6_addr_any(&fl6.saddr)) {
249 249 ret = ipv6_dev_get_saddr(&init_net, ip6_dst_idev(dst)->dev,
250   - &fl.fl6_dst, 0, &fl.fl6_src);
  250 + &fl6.daddr, 0, &fl6.saddr);
251 251 if (ret)
252 252 goto put;
253 253  
254 254 src_in->sin6_family = AF_INET6;
255   - ipv6_addr_copy(&src_in->sin6_addr, &fl.fl6_src);
  255 + ipv6_addr_copy(&src_in->sin6_addr, &fl6.saddr);
256 256 }
257 257  
258 258 if (dst->dev->flags & IFF_LOOPBACK) {
... ... @@ -3424,14 +3424,14 @@
3424 3424 struct dst_entry **dst)
3425 3425 {
3426 3426 #if defined(CONFIG_IPV6) || (defined(CONFIG_IPV6_MODULE) && defined(MODULE))
3427   - struct flowi fl;
  3427 + struct flowi6 fl6;
3428 3428  
3429   - memset(&fl, 0, sizeof(fl));
3430   - ipv6_addr_copy(&fl.fl6_dst, &dst_addr->sin6_addr);
3431   - if (ipv6_addr_type(&fl.fl6_dst) & IPV6_ADDR_LINKLOCAL)
3432   - fl.flowi_oif = dst_addr->sin6_scope_id;
  3429 + memset(&fl6, 0, sizeof(fl6));
  3430 + ipv6_addr_copy(&fl6.daddr, &dst_addr->sin6_addr);
  3431 + if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL)
  3432 + fl6.flowi6_oif = dst_addr->sin6_scope_id;
3433 3433  
3434   - *dst = ip6_route_output(&init_net, NULL, &fl);
  3434 + *dst = ip6_route_output(&init_net, NULL, &fl6);
3435 3435 if (*dst)
3436 3436 return 0;
3437 3437 #endif
include/linux/icmpv6.h
... ... @@ -183,10 +183,10 @@
183 183 extern void icmpv6_param_prob(struct sk_buff *skb,
184 184 u8 code, int pos);
185 185  
186   -struct flowi;
  186 +struct flowi6;
187 187 struct in6_addr;
188 188 extern void icmpv6_flow_init(struct sock *sk,
189   - struct flowi *fl,
  189 + struct flowi6 *fl6,
190 190 u8 type,
191 191 const struct in6_addr *saddr,
192 192 const struct in6_addr *daddr,
include/net/ip6_fib.h
... ... @@ -183,7 +183,7 @@
183 183  
184 184 typedef struct rt6_info *(*pol_lookup_t)(struct net *,
185 185 struct fib6_table *,
186   - struct flowi *, int);
  186 + struct flowi6 *, int);
187 187  
188 188 /*
189 189 * exported functions
... ... @@ -192,7 +192,7 @@
192 192 extern struct fib6_table *fib6_get_table(struct net *net, u32 id);
193 193 extern struct fib6_table *fib6_new_table(struct net *net, u32 id);
194 194 extern struct dst_entry *fib6_rule_lookup(struct net *net,
195   - struct flowi *fl, int flags,
  195 + struct flowi6 *fl6, int flags,
196 196 pol_lookup_t lookup);
197 197  
198 198 extern struct fib6_node *fib6_lookup(struct fib6_node *root,
include/net/ip6_route.h
... ... @@ -71,7 +71,7 @@
71 71  
72 72 extern struct dst_entry * ip6_route_output(struct net *net,
73 73 struct sock *sk,
74   - struct flowi *fl);
  74 + struct flowi6 *fl6);
75 75  
76 76 extern int ip6_route_init(void);
77 77 extern void ip6_route_cleanup(void);
... ... @@ -492,7 +492,7 @@
492 492 */
493 493 extern int ip6_xmit(struct sock *sk,
494 494 struct sk_buff *skb,
495   - struct flowi *fl,
  495 + struct flowi6 *fl6,
496 496 struct ipv6_txoptions *opt);
497 497  
498 498 extern int ip6_nd_hdr(struct sock *sk,
... ... @@ -512,7 +512,7 @@
512 512 int hlimit,
513 513 int tclass,
514 514 struct ipv6_txoptions *opt,
515   - struct flowi *fl,
  515 + struct flowi6 *fl6,
516 516 struct rt6_info *rt,
517 517 unsigned int flags,
518 518 int dontfrag);
519 519  
520 520  
... ... @@ -523,13 +523,13 @@
523 523  
524 524 extern int ip6_dst_lookup(struct sock *sk,
525 525 struct dst_entry **dst,
526   - struct flowi *fl);
  526 + struct flowi6 *fl6);
527 527 extern struct dst_entry * ip6_dst_lookup_flow(struct sock *sk,
528   - struct flowi *fl,
  528 + struct flowi6 *fl6,
529 529 const struct in6_addr *final_dst,
530 530 bool can_sleep);
531 531 extern struct dst_entry * ip6_sk_dst_lookup_flow(struct sock *sk,
532   - struct flowi *fl,
  532 + struct flowi6 *fl6,
533 533 const struct in6_addr *final_dst,
534 534 bool can_sleep);
535 535 extern struct dst_entry * ip6_blackhole_route(struct net *net,
... ... @@ -566,7 +566,7 @@
566 566  
567 567 extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type);
568 568  
569   -extern struct in6_addr *fl6_update_dst(struct flowi *fl,
  569 +extern struct in6_addr *fl6_update_dst(struct flowi6 *fl6,
570 570 const struct ipv6_txoptions *opt,
571 571 struct in6_addr *orig);
572 572  
... ... @@ -600,8 +600,8 @@
600 600 extern int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len);
601 601 extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port,
602 602 u32 info, u8 *payload);
603   -extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info);
604   -extern void ipv6_local_rxpmtu(struct sock *sk, struct flowi *fl, u32 mtu);
  603 +extern void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info);
  604 +extern void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu);
605 605  
606 606 extern int inet6_release(struct socket *sock);
607 607 extern int inet6_bind(struct socket *sock, struct sockaddr *uaddr,
include/net/transp_v6.h
... ... @@ -14,7 +14,7 @@
14 14 extern struct proto udplitev6_prot;
15 15 extern struct proto tcpv6_prot;
16 16  
17   -struct flowi;
  17 +struct flowi6;
18 18  
19 19 /* extention headers */
20 20 extern int ipv6_exthdrs_init(void);
... ... @@ -42,7 +42,7 @@
42 42  
43 43 extern int datagram_send_ctl(struct net *net,
44 44 struct msghdr *msg,
45   - struct flowi *fl,
  45 + struct flowi6 *fl6,
46 46 struct ipv6_txoptions *opt,
47 47 int *hlimit, int *tclass,
48 48 int *dontfrag);
... ... @@ -147,22 +147,22 @@
147 147 dst = __sk_dst_check(sk, np->dst_cookie);
148 148 if (dst == NULL) {
149 149 struct inet_sock *inet = inet_sk(sk);
150   - struct flowi fl;
  150 + struct flowi6 fl6;
151 151  
152 152 /* BUGGG_FUTURE: Again, it is not clear how
153 153 to handle rthdr case. Ignore this complexity
154 154 for now.
155 155 */
156   - memset(&fl, 0, sizeof(fl));
157   - fl.flowi_proto = IPPROTO_DCCP;
158   - ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
159   - ipv6_addr_copy(&fl.fl6_src, &np->saddr);
160   - fl.flowi_oif = sk->sk_bound_dev_if;
161   - fl.fl6_dport = inet->inet_dport;
162   - fl.fl6_sport = inet->inet_sport;
163   - security_sk_classify_flow(sk, &fl);
  156 + memset(&fl6, 0, sizeof(fl6));
  157 + fl6.flowi6_proto = IPPROTO_DCCP;
  158 + ipv6_addr_copy(&fl6.daddr, &np->daddr);
  159 + ipv6_addr_copy(&fl6.saddr, &np->saddr);
  160 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  161 + fl6.uli.ports.dport = inet->inet_dport;
  162 + fl6.uli.ports.sport = inet->inet_sport;
  163 + security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
164 164  
165   - dst = ip6_dst_lookup_flow(sk, &fl, NULL, false);
  165 + dst = ip6_dst_lookup_flow(sk, &fl6, NULL, false);
166 166 if (IS_ERR(dst)) {
167 167 sk->sk_err_soft = -PTR_ERR(dst);
168 168 goto out;
169 169  
170 170  
171 171  
... ... @@ -243,25 +243,25 @@
243 243 struct sk_buff *skb;
244 244 struct ipv6_txoptions *opt = NULL;
245 245 struct in6_addr *final_p, final;
246   - struct flowi fl;
  246 + struct flowi6 fl6;
247 247 int err = -1;
248 248 struct dst_entry *dst;
249 249  
250   - memset(&fl, 0, sizeof(fl));
251   - fl.flowi_proto = IPPROTO_DCCP;
252   - ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
253   - ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
254   - fl.fl6_flowlabel = 0;
255   - fl.flowi_oif = ireq6->iif;
256   - fl.fl6_dport = inet_rsk(req)->rmt_port;
257   - fl.fl6_sport = inet_rsk(req)->loc_port;
258   - security_req_classify_flow(req, &fl);
  250 + memset(&fl6, 0, sizeof(fl6));
  251 + fl6.flowi6_proto = IPPROTO_DCCP;
  252 + ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr);
  253 + ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr);
  254 + fl6.flowlabel = 0;
  255 + fl6.flowi6_oif = ireq6->iif;
  256 + fl6.uli.ports.dport = inet_rsk(req)->rmt_port;
  257 + fl6.uli.ports.sport = inet_rsk(req)->loc_port;
  258 + security_req_classify_flow(req, flowi6_to_flowi(&fl6));
259 259  
260 260 opt = np->opt;
261 261  
262   - final_p = fl6_update_dst(&fl, opt, &final);
  262 + final_p = fl6_update_dst(&fl6, opt, &final);
263 263  
264   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
  264 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
265 265 if (IS_ERR(dst)) {
266 266 err = PTR_ERR(dst);
267 267 dst = NULL;
... ... @@ -275,8 +275,8 @@
275 275 dh->dccph_checksum = dccp_v6_csum_finish(skb,
276 276 &ireq6->loc_addr,
277 277 &ireq6->rmt_addr);
278   - ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
279   - err = ip6_xmit(sk, skb, &fl, opt);
  278 + ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr);
  279 + err = ip6_xmit(sk, skb, &fl6, opt);
280 280 err = net_xmit_eval(err);
281 281 }
282 282  
... ... @@ -298,7 +298,7 @@
298 298 {
299 299 struct ipv6hdr *rxip6h;
300 300 struct sk_buff *skb;
301   - struct flowi fl;
  301 + struct flowi6 fl6;
302 302 struct net *net = dev_net(skb_dst(rxskb)->dev);
303 303 struct sock *ctl_sk = net->dccp.v6_ctl_sk;
304 304 struct dst_entry *dst;
305 305  
306 306  
307 307  
... ... @@ -317,21 +317,21 @@
317 317 dccp_hdr(skb)->dccph_checksum = dccp_v6_csum_finish(skb, &rxip6h->saddr,
318 318 &rxip6h->daddr);
319 319  
320   - memset(&fl, 0, sizeof(fl));
321   - ipv6_addr_copy(&fl.fl6_dst, &rxip6h->saddr);
322   - ipv6_addr_copy(&fl.fl6_src, &rxip6h->daddr);
  320 + memset(&fl6, 0, sizeof(fl6));
  321 + ipv6_addr_copy(&fl6.daddr, &rxip6h->saddr);
  322 + ipv6_addr_copy(&fl6.saddr, &rxip6h->daddr);
323 323  
324   - fl.flowi_proto = IPPROTO_DCCP;
325   - fl.flowi_oif = inet6_iif(rxskb);
326   - fl.fl6_dport = dccp_hdr(skb)->dccph_dport;
327   - fl.fl6_sport = dccp_hdr(skb)->dccph_sport;
328   - security_skb_classify_flow(rxskb, &fl);
  324 + fl6.flowi6_proto = IPPROTO_DCCP;
  325 + fl6.flowi6_oif = inet6_iif(rxskb);
  326 + fl6.uli.ports.dport = dccp_hdr(skb)->dccph_dport;
  327 + fl6.uli.ports.sport = dccp_hdr(skb)->dccph_sport;
  328 + security_skb_classify_flow(rxskb, flowi6_to_flowi(&fl6));
329 329  
330 330 /* sk = NULL, but it is safe for now. RST socket required. */
331   - dst = ip6_dst_lookup_flow(ctl_sk, &fl, NULL, false);
  331 + dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL, false);
332 332 if (!IS_ERR(dst)) {
333 333 skb_dst_set(skb, dst);
334   - ip6_xmit(ctl_sk, skb, &fl, NULL);
  334 + ip6_xmit(ctl_sk, skb, &fl6, NULL);
335 335 DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS);
336 336 DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS);
337 337 return;
338 338  
339 339  
... ... @@ -527,19 +527,19 @@
527 527  
528 528 if (dst == NULL) {
529 529 struct in6_addr *final_p, final;
530   - struct flowi fl;
  530 + struct flowi6 fl6;
531 531  
532   - memset(&fl, 0, sizeof(fl));
533   - fl.flowi_proto = IPPROTO_DCCP;
534   - ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
535   - final_p = fl6_update_dst(&fl, opt, &final);
536   - ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
537   - fl.flowi_oif = sk->sk_bound_dev_if;
538   - fl.fl6_dport = inet_rsk(req)->rmt_port;
539   - fl.fl6_sport = inet_rsk(req)->loc_port;
540   - security_sk_classify_flow(sk, &fl);
  532 + memset(&fl6, 0, sizeof(fl6));
  533 + fl6.flowi6_proto = IPPROTO_DCCP;
  534 + ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr);
  535 + final_p = fl6_update_dst(&fl6, opt, &final);
  536 + ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr);
  537 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  538 + fl6.uli.ports.dport = inet_rsk(req)->rmt_port;
  539 + fl6.uli.ports.sport = inet_rsk(req)->loc_port;
  540 + security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
541 541  
542   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
  542 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
543 543 if (IS_ERR(dst))
544 544 goto out;
545 545 }
... ... @@ -859,7 +859,7 @@
859 859 struct ipv6_pinfo *np = inet6_sk(sk);
860 860 struct dccp_sock *dp = dccp_sk(sk);
861 861 struct in6_addr *saddr = NULL, *final_p, final;
862   - struct flowi fl;
  862 + struct flowi6 fl6;
863 863 struct dst_entry *dst;
864 864 int addr_type;
865 865 int err;
866 866  
867 867  
... ... @@ -872,14 +872,14 @@
872 872 if (usin->sin6_family != AF_INET6)
873 873 return -EAFNOSUPPORT;
874 874  
875   - memset(&fl, 0, sizeof(fl));
  875 + memset(&fl6, 0, sizeof(fl6));
876 876  
877 877 if (np->sndflow) {
878   - fl.fl6_flowlabel = usin->sin6_flowinfo & IPV6_FLOWINFO_MASK;
879   - IP6_ECN_flow_init(fl.fl6_flowlabel);
880   - if (fl.fl6_flowlabel & IPV6_FLOWLABEL_MASK) {
  878 + fl6.flowlabel = usin->sin6_flowinfo & IPV6_FLOWINFO_MASK;
  879 + IP6_ECN_flow_init(fl6.flowlabel);
  880 + if (fl6.flowlabel & IPV6_FLOWLABEL_MASK) {
881 881 struct ip6_flowlabel *flowlabel;
882   - flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
  882 + flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
883 883 if (flowlabel == NULL)
884 884 return -EINVAL;
885 885 ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
... ... @@ -916,7 +916,7 @@
916 916 }
917 917  
918 918 ipv6_addr_copy(&np->daddr, &usin->sin6_addr);
919   - np->flow_label = fl.fl6_flowlabel;
  919 + np->flow_label = fl6.flowlabel;
920 920  
921 921 /*
922 922 * DCCP over IPv4
923 923  
924 924  
925 925  
... ... @@ -953,24 +953,24 @@
953 953 if (!ipv6_addr_any(&np->rcv_saddr))
954 954 saddr = &np->rcv_saddr;
955 955  
956   - fl.flowi_proto = IPPROTO_DCCP;
957   - ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
958   - ipv6_addr_copy(&fl.fl6_src, saddr ? saddr : &np->saddr);
959   - fl.flowi_oif = sk->sk_bound_dev_if;
960   - fl.fl6_dport = usin->sin6_port;
961   - fl.fl6_sport = inet->inet_sport;
962   - security_sk_classify_flow(sk, &fl);
  956 + fl6.flowi6_proto = IPPROTO_DCCP;
  957 + ipv6_addr_copy(&fl6.daddr, &np->daddr);
  958 + ipv6_addr_copy(&fl6.saddr, saddr ? saddr : &np->saddr);
  959 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  960 + fl6.uli.ports.dport = usin->sin6_port;
  961 + fl6.uli.ports.sport = inet->inet_sport;
  962 + security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
963 963  
964   - final_p = fl6_update_dst(&fl, np->opt, &final);
  964 + final_p = fl6_update_dst(&fl6, np->opt, &final);
965 965  
966   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, true);
  966 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, true);
967 967 if (IS_ERR(dst)) {
968 968 err = PTR_ERR(dst);
969 969 goto failure;
970 970 }
971 971  
972 972 if (saddr == NULL) {
973   - saddr = &fl.fl6_src;
  973 + saddr = &fl6.saddr;
974 974 ipv6_addr_copy(&np->rcv_saddr, saddr);
975 975 }
976 976  
... ... @@ -652,22 +652,22 @@
652 652 if (dst == NULL) {
653 653 struct inet_sock *inet = inet_sk(sk);
654 654 struct in6_addr *final_p, final;
655   - struct flowi fl;
  655 + struct flowi6 fl6;
656 656  
657   - memset(&fl, 0, sizeof(fl));
658   - fl.flowi_proto = sk->sk_protocol;
659   - ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
660   - ipv6_addr_copy(&fl.fl6_src, &np->saddr);
661   - fl.fl6_flowlabel = np->flow_label;
662   - fl.flowi_oif = sk->sk_bound_dev_if;
663   - fl.flowi_mark = sk->sk_mark;
664   - fl.fl6_dport = inet->inet_dport;
665   - fl.fl6_sport = inet->inet_sport;
666   - security_sk_classify_flow(sk, &fl);
  657 + memset(&fl6, 0, sizeof(fl6));
  658 + fl6.flowi6_proto = sk->sk_protocol;
  659 + ipv6_addr_copy(&fl6.daddr, &np->daddr);
  660 + ipv6_addr_copy(&fl6.saddr, &np->saddr);
  661 + fl6.flowlabel = np->flow_label;
  662 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  663 + fl6.flowi6_mark = sk->sk_mark;
  664 + fl6.uli.ports.dport = inet->inet_dport;
  665 + fl6.uli.ports.sport = inet->inet_sport;
  666 + security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
667 667  
668   - final_p = fl6_update_dst(&fl, np->opt, &final);
  668 + final_p = fl6_update_dst(&fl6, np->opt, &final);
669 669  
670   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
  670 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
671 671 if (IS_ERR(dst)) {
672 672 sk->sk_route_caps = 0;
673 673 sk->sk_err_soft = -PTR_ERR(dst);
... ... @@ -40,7 +40,7 @@
40 40 struct ipv6_pinfo *np = inet6_sk(sk);
41 41 struct in6_addr *daddr, *final_p, final;
42 42 struct dst_entry *dst;
43   - struct flowi fl;
  43 + struct flowi6 fl6;
44 44 struct ip6_flowlabel *flowlabel = NULL;
45 45 struct ipv6_txoptions *opt;
46 46 int addr_type;
47 47  
... ... @@ -59,11 +59,11 @@
59 59 if (usin->sin6_family != AF_INET6)
60 60 return -EAFNOSUPPORT;
61 61  
62   - memset(&fl, 0, sizeof(fl));
  62 + memset(&fl6, 0, sizeof(fl6));
63 63 if (np->sndflow) {
64   - fl.fl6_flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK;
65   - if (fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) {
66   - flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
  64 + fl6.flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK;
  65 + if (fl6.flowlabel&IPV6_FLOWLABEL_MASK) {
  66 + flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
67 67 if (flowlabel == NULL)
68 68 return -EINVAL;
69 69 ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
... ... @@ -137,7 +137,7 @@
137 137 }
138 138  
139 139 ipv6_addr_copy(&np->daddr, daddr);
140   - np->flow_label = fl.fl6_flowlabel;
  140 + np->flow_label = fl6.flowlabel;
141 141  
142 142 inet->inet_dport = usin->sin6_port;
143 143  
144 144  
145 145  
146 146  
147 147  
... ... @@ -146,23 +146,23 @@
146 146 * destination cache for it.
147 147 */
148 148  
149   - fl.flowi_proto = sk->sk_protocol;
150   - ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
151   - ipv6_addr_copy(&fl.fl6_src, &np->saddr);
152   - fl.flowi_oif = sk->sk_bound_dev_if;
153   - fl.flowi_mark = sk->sk_mark;
154   - fl.fl6_dport = inet->inet_dport;
155   - fl.fl6_sport = inet->inet_sport;
  149 + fl6.flowi6_proto = sk->sk_protocol;
  150 + ipv6_addr_copy(&fl6.daddr, &np->daddr);
  151 + ipv6_addr_copy(&fl6.saddr, &np->saddr);
  152 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  153 + fl6.flowi6_mark = sk->sk_mark;
  154 + fl6.uli.ports.dport = inet->inet_dport;
  155 + fl6.uli.ports.sport = inet->inet_sport;
156 156  
157   - if (!fl.flowi_oif && (addr_type&IPV6_ADDR_MULTICAST))
158   - fl.flowi_oif = np->mcast_oif;
  157 + if (!fl6.flowi6_oif && (addr_type&IPV6_ADDR_MULTICAST))
  158 + fl6.flowi6_oif = np->mcast_oif;
159 159  
160   - security_sk_classify_flow(sk, &fl);
  160 + security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
161 161  
162 162 opt = flowlabel ? flowlabel->opt : np->opt;
163   - final_p = fl6_update_dst(&fl, opt, &final);
  163 + final_p = fl6_update_dst(&fl6, opt, &final);
164 164  
165   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, true);
  165 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, true);
166 166 err = 0;
167 167 if (IS_ERR(dst)) {
168 168 err = PTR_ERR(dst);
169 169  
170 170  
171 171  
... ... @@ -172,20 +172,20 @@
172 172 /* source address lookup done in ip6_dst_lookup */
173 173  
174 174 if (ipv6_addr_any(&np->saddr))
175   - ipv6_addr_copy(&np->saddr, &fl.fl6_src);
  175 + ipv6_addr_copy(&np->saddr, &fl6.saddr);
176 176  
177 177 if (ipv6_addr_any(&np->rcv_saddr)) {
178   - ipv6_addr_copy(&np->rcv_saddr, &fl.fl6_src);
  178 + ipv6_addr_copy(&np->rcv_saddr, &fl6.saddr);
179 179 inet->inet_rcv_saddr = LOOPBACK4_IPV6;
180 180 if (sk->sk_prot->rehash)
181 181 sk->sk_prot->rehash(sk);
182 182 }
183 183  
184 184 ip6_dst_store(sk, dst,
185   - ipv6_addr_equal(&fl.fl6_dst, &np->daddr) ?
  185 + ipv6_addr_equal(&fl6.daddr, &np->daddr) ?
186 186 &np->daddr : NULL,
187 187 #ifdef CONFIG_IPV6_SUBTREES
188   - ipv6_addr_equal(&fl.fl6_src, &np->saddr) ?
  188 + ipv6_addr_equal(&fl6.saddr, &np->saddr) ?
189 189 &np->saddr :
190 190 #endif
191 191 NULL);
... ... @@ -231,7 +231,7 @@
231 231 kfree_skb(skb);
232 232 }
233 233  
234   -void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info)
  234 +void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info)
235 235 {
236 236 struct ipv6_pinfo *np = inet6_sk(sk);
237 237 struct sock_exterr_skb *serr;
... ... @@ -250,7 +250,7 @@
250 250 skb_put(skb, sizeof(struct ipv6hdr));
251 251 skb_reset_network_header(skb);
252 252 iph = ipv6_hdr(skb);
253   - ipv6_addr_copy(&iph->daddr, &fl->fl6_dst);
  253 + ipv6_addr_copy(&iph->daddr, &fl6->daddr);
254 254  
255 255 serr = SKB_EXT_ERR(skb);
256 256 serr->ee.ee_errno = err;
... ... @@ -261,7 +261,7 @@
261 261 serr->ee.ee_info = info;
262 262 serr->ee.ee_data = 0;
263 263 serr->addr_offset = (u8 *)&iph->daddr - skb_network_header(skb);
264   - serr->port = fl->fl6_dport;
  264 + serr->port = fl6->uli.ports.dport;
265 265  
266 266 __skb_pull(skb, skb_tail_pointer(skb) - skb->data);
267 267 skb_reset_transport_header(skb);
... ... @@ -270,7 +270,7 @@
270 270 kfree_skb(skb);
271 271 }
272 272  
273   -void ipv6_local_rxpmtu(struct sock *sk, struct flowi *fl, u32 mtu)
  273 +void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu)
274 274 {
275 275 struct ipv6_pinfo *np = inet6_sk(sk);
276 276 struct ipv6hdr *iph;
... ... @@ -287,7 +287,7 @@
287 287 skb_put(skb, sizeof(struct ipv6hdr));
288 288 skb_reset_network_header(skb);
289 289 iph = ipv6_hdr(skb);
290   - ipv6_addr_copy(&iph->daddr, &fl->fl6_dst);
  290 + ipv6_addr_copy(&iph->daddr, &fl6->daddr);
291 291  
292 292 mtu_info = IP6CBMTU(skb);
293 293 if (!mtu_info) {
... ... @@ -299,7 +299,7 @@
299 299 mtu_info->ip6m_addr.sin6_family = AF_INET6;
300 300 mtu_info->ip6m_addr.sin6_port = 0;
301 301 mtu_info->ip6m_addr.sin6_flowinfo = 0;
302   - mtu_info->ip6m_addr.sin6_scope_id = fl->flowi_oif;
  302 + mtu_info->ip6m_addr.sin6_scope_id = fl6->flowi6_oif;
303 303 ipv6_addr_copy(&mtu_info->ip6m_addr.sin6_addr, &ipv6_hdr(skb)->daddr);
304 304  
305 305 __skb_pull(skb, skb_tail_pointer(skb) - skb->data);
... ... @@ -593,7 +593,7 @@
593 593 }
594 594  
595 595 int datagram_send_ctl(struct net *net,
596   - struct msghdr *msg, struct flowi *fl,
  596 + struct msghdr *msg, struct flowi6 *fl6,
597 597 struct ipv6_txoptions *opt,
598 598 int *hlimit, int *tclass, int *dontfrag)
599 599 {
600 600  
601 601  
... ... @@ -629,16 +629,17 @@
629 629 src_info = (struct in6_pktinfo *)CMSG_DATA(cmsg);
630 630  
631 631 if (src_info->ipi6_ifindex) {
632   - if (fl->flowi_oif && src_info->ipi6_ifindex != fl->flowi_oif)
  632 + if (fl6->flowi6_oif &&
  633 + src_info->ipi6_ifindex != fl6->flowi6_oif)
633 634 return -EINVAL;
634   - fl->flowi_oif = src_info->ipi6_ifindex;
  635 + fl6->flowi6_oif = src_info->ipi6_ifindex;
635 636 }
636 637  
637 638 addr_type = __ipv6_addr_type(&src_info->ipi6_addr);
638 639  
639 640 rcu_read_lock();
640   - if (fl->flowi_oif) {
641   - dev = dev_get_by_index_rcu(net, fl->flowi_oif);
  641 + if (fl6->flowi6_oif) {
  642 + dev = dev_get_by_index_rcu(net, fl6->flowi6_oif);
642 643 if (!dev) {
643 644 rcu_read_unlock();
644 645 return -ENODEV;
... ... @@ -654,7 +655,7 @@
654 655 strict ? dev : NULL, 0))
655 656 err = -EINVAL;
656 657 else
657   - ipv6_addr_copy(&fl->fl6_src, &src_info->ipi6_addr);
  658 + ipv6_addr_copy(&fl6->saddr, &src_info->ipi6_addr);
658 659 }
659 660  
660 661 rcu_read_unlock();
661 662  
... ... @@ -671,13 +672,13 @@
671 672 goto exit_f;
672 673 }
673 674  
674   - if (fl->fl6_flowlabel&IPV6_FLOWINFO_MASK) {
675   - if ((fl->fl6_flowlabel^*(__be32 *)CMSG_DATA(cmsg))&~IPV6_FLOWINFO_MASK) {
  675 + if (fl6->flowlabel&IPV6_FLOWINFO_MASK) {
  676 + if ((fl6->flowlabel^*(__be32 *)CMSG_DATA(cmsg))&~IPV6_FLOWINFO_MASK) {
676 677 err = -EINVAL;
677 678 goto exit_f;
678 679 }
679 680 }
680   - fl->fl6_flowlabel = IPV6_FLOWINFO_MASK & *(__be32 *)CMSG_DATA(cmsg);
  681 + fl6->flowlabel = IPV6_FLOWINFO_MASK & *(__be32 *)CMSG_DATA(cmsg);
681 682 break;
682 683  
683 684 case IPV6_2292HOPOPTS:
... ... @@ -876,22 +876,22 @@
876 876 * fl6_update_dst - update flowi destination address with info given
877 877 * by srcrt option, if any.
878 878 *
879   - * @fl: flowi for which fl6_dst is to be updated
  879 + * @fl6: flowi6 for which daddr is to be updated
880 880 * @opt: struct ipv6_txoptions in which to look for srcrt opt
881   - * @orig: copy of original fl6_dst address if modified
  881 + * @orig: copy of original daddr address if modified
882 882 *
883 883 * Returns NULL if no txoptions or no srcrt, otherwise returns orig
884   - * and initial value of fl->fl6_dst set in orig
  884 + * and initial value of fl6->daddr set in orig
885 885 */
886   -struct in6_addr *fl6_update_dst(struct flowi *fl,
  886 +struct in6_addr *fl6_update_dst(struct flowi6 *fl6,
887 887 const struct ipv6_txoptions *opt,
888 888 struct in6_addr *orig)
889 889 {
890 890 if (!opt || !opt->srcrt)
891 891 return NULL;
892 892  
893   - ipv6_addr_copy(orig, &fl->fl6_dst);
894   - ipv6_addr_copy(&fl->fl6_dst, ((struct rt0_hdr *)opt->srcrt)->addr);
  893 + ipv6_addr_copy(orig, &fl6->daddr);
  894 + ipv6_addr_copy(&fl6->daddr, ((struct rt0_hdr *)opt->srcrt)->addr);
895 895 return orig;
896 896 }
897 897  
net/ipv6/fib6_rules.c
... ... @@ -29,7 +29,7 @@
29 29 u8 tclass;
30 30 };
31 31  
32   -struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi *fl,
  32 +struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6,
33 33 int flags, pol_lookup_t lookup)
34 34 {
35 35 struct fib_lookup_arg arg = {
... ... @@ -37,7 +37,8 @@
37 37 .flags = FIB_LOOKUP_NOREF,
38 38 };
39 39  
40   - fib_rules_lookup(net->ipv6.fib6_rules_ops, fl, flags, &arg);
  40 + fib_rules_lookup(net->ipv6.fib6_rules_ops,
  41 + flowi6_to_flowi(fl6), flags, &arg);
41 42  
42 43 if (arg.result)
43 44 return arg.result;
... ... @@ -49,6 +50,7 @@
49 50 static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
50 51 int flags, struct fib_lookup_arg *arg)
51 52 {
  53 + struct flowi6 *flp6 = &flp->u.ip6;
52 54 struct rt6_info *rt = NULL;
53 55 struct fib6_table *table;
54 56 struct net *net = rule->fr_net;
... ... @@ -71,7 +73,7 @@
71 73  
72 74 table = fib6_get_table(net, rule->table);
73 75 if (table)
74   - rt = lookup(net, table, flp, flags);
  76 + rt = lookup(net, table, flp6, flags);
75 77  
76 78 if (rt != net->ipv6.ip6_null_entry) {
77 79 struct fib6_rule *r = (struct fib6_rule *)rule;
78 80  
... ... @@ -86,14 +88,14 @@
86 88  
87 89 if (ipv6_dev_get_saddr(net,
88 90 ip6_dst_idev(&rt->dst)->dev,
89   - &flp->fl6_dst,
  91 + &flp6->daddr,
90 92 rt6_flags2srcprefs(flags),
91 93 &saddr))
92 94 goto again;
93 95 if (!ipv6_prefix_equal(&saddr, &r->src.addr,
94 96 r->src.plen))
95 97 goto again;
96   - ipv6_addr_copy(&flp->fl6_src, &saddr);
  98 + ipv6_addr_copy(&flp6->saddr, &saddr);
97 99 }
98 100 goto out;
99 101 }
100 102  
... ... @@ -113,9 +115,10 @@
113 115 static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
114 116 {
115 117 struct fib6_rule *r = (struct fib6_rule *) rule;
  118 + struct flowi6 *fl6 = &fl->u.ip6;
116 119  
117 120 if (r->dst.plen &&
118   - !ipv6_prefix_equal(&fl->fl6_dst, &r->dst.addr, r->dst.plen))
  121 + !ipv6_prefix_equal(&fl6->daddr, &r->dst.addr, r->dst.plen))
119 122 return 0;
120 123  
121 124 /*
122 125  
... ... @@ -125,14 +128,14 @@
125 128 */
126 129 if (r->src.plen) {
127 130 if (flags & RT6_LOOKUP_F_HAS_SADDR) {
128   - if (!ipv6_prefix_equal(&fl->fl6_src, &r->src.addr,
  131 + if (!ipv6_prefix_equal(&fl6->saddr, &r->src.addr,
129 132 r->src.plen))
130 133 return 0;
131 134 } else if (!(r->common.flags & FIB_RULE_FIND_SADDR))
132 135 return 0;
133 136 }
134 137  
135   - if (r->tclass && r->tclass != ((ntohl(fl->fl6_flowlabel) >> 20) & 0xff))
  138 + if (r->tclass && r->tclass != ((ntohl(fl6->flowlabel) >> 20) & 0xff))
136 139 return 0;
137 140  
138 141 return 1;
... ... @@ -158,7 +158,7 @@
158 158 * Check the ICMP output rate limit
159 159 */
160 160 static inline bool icmpv6_xrlim_allow(struct sock *sk, u8 type,
161   - struct flowi *fl)
  161 + struct flowi6 *fl6)
162 162 {
163 163 struct dst_entry *dst;
164 164 struct net *net = sock_net(sk);
... ... @@ -177,7 +177,7 @@
177 177 * XXX: perhaps the expire for routing entries cloned by
178 178 * this lookup should be more aggressive (not longer than timeout).
179 179 */
180   - dst = ip6_route_output(net, sk, fl);
  180 + dst = ip6_route_output(net, sk, fl6);
181 181 if (dst->error) {
182 182 IP6_INC_STATS(net, ip6_dst_idev(dst),
183 183 IPSTATS_MIB_OUTNOROUTES);
... ... @@ -217,7 +217,7 @@
217 217 return (*op & 0xC0) == 0x80;
218 218 }
219 219  
220   -static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct icmp6hdr *thdr, int len)
  220 +static int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, struct icmp6hdr *thdr, int len)
221 221 {
222 222 struct sk_buff *skb;
223 223 struct icmp6hdr *icmp6h;
... ... @@ -233,9 +233,9 @@
233 233 if (skb_queue_len(&sk->sk_write_queue) == 1) {
234 234 skb->csum = csum_partial(icmp6h,
235 235 sizeof(struct icmp6hdr), skb->csum);
236   - icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src,
237   - &fl->fl6_dst,
238   - len, fl->flowi_proto,
  236 + icmp6h->icmp6_cksum = csum_ipv6_magic(&fl6->saddr,
  237 + &fl6->daddr,
  238 + len, fl6->flowi6_proto,
239 239 skb->csum);
240 240 } else {
241 241 __wsum tmp_csum = 0;
... ... @@ -246,9 +246,9 @@
246 246  
247 247 tmp_csum = csum_partial(icmp6h,
248 248 sizeof(struct icmp6hdr), tmp_csum);
249   - icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src,
250   - &fl->fl6_dst,
251   - len, fl->flowi_proto,
  249 + icmp6h->icmp6_cksum = csum_ipv6_magic(&fl6->saddr,
  250 + &fl6->daddr,
  251 + len, fl6->flowi6_proto,
252 252 tmp_csum);
253 253 }
254 254 ip6_push_pending_frames(sk);
255 255  
256 256  
... ... @@ -301,13 +301,13 @@
301 301 #endif
302 302  
303 303 static struct dst_entry *icmpv6_route_lookup(struct net *net, struct sk_buff *skb,
304   - struct sock *sk, struct flowi *fl)
  304 + struct sock *sk, struct flowi6 *fl6)
305 305 {
306 306 struct dst_entry *dst, *dst2;
307   - struct flowi fl2;
  307 + struct flowi6 fl2;
308 308 int err;
309 309  
310   - err = ip6_dst_lookup(sk, &dst, fl);
  310 + err = ip6_dst_lookup(sk, &dst, fl6);
311 311 if (err)
312 312 return ERR_PTR(err);
313 313  
... ... @@ -324,7 +324,7 @@
324 324 /* No need to clone since we're just using its address. */
325 325 dst2 = dst;
326 326  
327   - dst = xfrm_lookup(net, dst, fl, sk, 0);
  327 + dst = xfrm_lookup(net, dst, flowi6_to_flowi(fl6), sk, 0);
328 328 if (!IS_ERR(dst)) {
329 329 if (dst != dst2)
330 330 return dst;
... ... @@ -335,7 +335,7 @@
335 335 return dst;
336 336 }
337 337  
338   - err = xfrm_decode_session_reverse(skb, &fl2, AF_INET6);
  338 + err = xfrm_decode_session_reverse(skb, flowi6_to_flowi(&fl2), AF_INET6);
339 339 if (err)
340 340 goto relookup_failed;
341 341  
... ... @@ -343,7 +343,7 @@
343 343 if (err)
344 344 goto relookup_failed;
345 345  
346   - dst2 = xfrm_lookup(net, dst2, &fl2, sk, XFRM_LOOKUP_ICMP);
  346 + dst2 = xfrm_lookup(net, dst2, flowi6_to_flowi(&fl2), sk, XFRM_LOOKUP_ICMP);
347 347 if (!IS_ERR(dst2)) {
348 348 dst_release(dst);
349 349 dst = dst2;
... ... @@ -375,7 +375,7 @@
375 375 struct in6_addr *saddr = NULL;
376 376 struct dst_entry *dst;
377 377 struct icmp6hdr tmp_hdr;
378   - struct flowi fl;
  378 + struct flowi6 fl6;
379 379 struct icmpv6_msg msg;
380 380 int iif = 0;
381 381 int addr_type = 0;
382 382  
383 383  
... ... @@ -442,22 +442,22 @@
442 442  
443 443 mip6_addr_swap(skb);
444 444  
445   - memset(&fl, 0, sizeof(fl));
446   - fl.flowi_proto = IPPROTO_ICMPV6;
447   - ipv6_addr_copy(&fl.fl6_dst, &hdr->saddr);
  445 + memset(&fl6, 0, sizeof(fl6));
  446 + fl6.flowi6_proto = IPPROTO_ICMPV6;
  447 + ipv6_addr_copy(&fl6.daddr, &hdr->saddr);
448 448 if (saddr)
449   - ipv6_addr_copy(&fl.fl6_src, saddr);
450   - fl.flowi_oif = iif;
451   - fl.fl6_icmp_type = type;
452   - fl.fl6_icmp_code = code;
453   - security_skb_classify_flow(skb, &fl);
  449 + ipv6_addr_copy(&fl6.saddr, saddr);
  450 + fl6.flowi6_oif = iif;
  451 + fl6.uli.icmpt.type = type;
  452 + fl6.uli.icmpt.code = code;
  453 + security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
454 454  
455 455 sk = icmpv6_xmit_lock(net);
456 456 if (sk == NULL)
457 457 return;
458 458 np = inet6_sk(sk);
459 459  
460   - if (!icmpv6_xrlim_allow(sk, type, &fl))
  460 + if (!icmpv6_xrlim_allow(sk, type, &fl6))
461 461 goto out;
462 462  
463 463 tmp_hdr.icmp6_type = type;
464 464  
465 465  
... ... @@ -465,14 +465,14 @@
465 465 tmp_hdr.icmp6_cksum = 0;
466 466 tmp_hdr.icmp6_pointer = htonl(info);
467 467  
468   - if (!fl.flowi_oif && ipv6_addr_is_multicast(&fl.fl6_dst))
469   - fl.flowi_oif = np->mcast_oif;
  468 + if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr))
  469 + fl6.flowi6_oif = np->mcast_oif;
470 470  
471   - dst = icmpv6_route_lookup(net, skb, sk, &fl);
  471 + dst = icmpv6_route_lookup(net, skb, sk, &fl6);
472 472 if (IS_ERR(dst))
473 473 goto out;
474 474  
475   - if (ipv6_addr_is_multicast(&fl.fl6_dst))
  475 + if (ipv6_addr_is_multicast(&fl6.daddr))
476 476 hlimit = np->mcast_hops;
477 477 else
478 478 hlimit = np->hop_limit;
479 479  
... ... @@ -495,14 +495,14 @@
495 495 err = ip6_append_data(sk, icmpv6_getfrag, &msg,
496 496 len + sizeof(struct icmp6hdr),
497 497 sizeof(struct icmp6hdr), hlimit,
498   - np->tclass, NULL, &fl, (struct rt6_info*)dst,
  498 + np->tclass, NULL, &fl6, (struct rt6_info*)dst,
499 499 MSG_DONTWAIT, np->dontfrag);
500 500 if (err) {
501 501 ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTERRORS);
502 502 ip6_flush_pending_frames(sk);
503 503 goto out_put;
504 504 }
505   - err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr));
  505 + err = icmpv6_push_pending_frames(sk, &fl6, &tmp_hdr, len + sizeof(struct icmp6hdr));
506 506  
507 507 out_put:
508 508 if (likely(idev != NULL))
... ... @@ -524,7 +524,7 @@
524 524 struct in6_addr *saddr = NULL;
525 525 struct icmp6hdr *icmph = icmp6_hdr(skb);
526 526 struct icmp6hdr tmp_hdr;
527   - struct flowi fl;
  527 + struct flowi6 fl6;
528 528 struct icmpv6_msg msg;
529 529 struct dst_entry *dst;
530 530 int err = 0;
531 531  
532 532  
533 533  
534 534  
535 535  
... ... @@ -538,31 +538,31 @@
538 538 memcpy(&tmp_hdr, icmph, sizeof(tmp_hdr));
539 539 tmp_hdr.icmp6_type = ICMPV6_ECHO_REPLY;
540 540  
541   - memset(&fl, 0, sizeof(fl));
542   - fl.flowi_proto = IPPROTO_ICMPV6;
543   - ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr);
  541 + memset(&fl6, 0, sizeof(fl6));
  542 + fl6.flowi6_proto = IPPROTO_ICMPV6;
  543 + ipv6_addr_copy(&fl6.daddr, &ipv6_hdr(skb)->saddr);
544 544 if (saddr)
545   - ipv6_addr_copy(&fl.fl6_src, saddr);
546   - fl.flowi_oif = skb->dev->ifindex;
547   - fl.fl6_icmp_type = ICMPV6_ECHO_REPLY;
548   - security_skb_classify_flow(skb, &fl);
  545 + ipv6_addr_copy(&fl6.saddr, saddr);
  546 + fl6.flowi6_oif = skb->dev->ifindex;
  547 + fl6.uli.icmpt.type = ICMPV6_ECHO_REPLY;
  548 + security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
549 549  
550 550 sk = icmpv6_xmit_lock(net);
551 551 if (sk == NULL)
552 552 return;
553 553 np = inet6_sk(sk);
554 554  
555   - if (!fl.flowi_oif && ipv6_addr_is_multicast(&fl.fl6_dst))
556   - fl.flowi_oif = np->mcast_oif;
  555 + if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr))
  556 + fl6.flowi6_oif = np->mcast_oif;
557 557  
558   - err = ip6_dst_lookup(sk, &dst, &fl);
  558 + err = ip6_dst_lookup(sk, &dst, &fl6);
559 559 if (err)
560 560 goto out;
561   - dst = xfrm_lookup(net, dst, &fl, sk, 0);
  561 + dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), sk, 0);
562 562 if (IS_ERR(dst))
563 563 goto out;
564 564  
565   - if (ipv6_addr_is_multicast(&fl.fl6_dst))
  565 + if (ipv6_addr_is_multicast(&fl6.daddr))
566 566 hlimit = np->mcast_hops;
567 567 else
568 568 hlimit = np->hop_limit;
... ... @@ -576,7 +576,7 @@
576 576 msg.type = ICMPV6_ECHO_REPLY;
577 577  
578 578 err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr),
579   - sizeof(struct icmp6hdr), hlimit, np->tclass, NULL, &fl,
  579 + sizeof(struct icmp6hdr), hlimit, np->tclass, NULL, &fl6,
580 580 (struct rt6_info*)dst, MSG_DONTWAIT,
581 581 np->dontfrag);
582 582  
... ... @@ -585,7 +585,7 @@
585 585 ip6_flush_pending_frames(sk);
586 586 goto out_put;
587 587 }
588   - err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, skb->len + sizeof(struct icmp6hdr));
  588 + err = icmpv6_push_pending_frames(sk, &fl6, &tmp_hdr, skb->len + sizeof(struct icmp6hdr));
589 589  
590 590 out_put:
591 591 if (likely(idev != NULL))
592 592  
... ... @@ -784,20 +784,20 @@
784 784 return 0;
785 785 }
786 786  
787   -void icmpv6_flow_init(struct sock *sk, struct flowi *fl,
  787 +void icmpv6_flow_init(struct sock *sk, struct flowi6 *fl6,
788 788 u8 type,
789 789 const struct in6_addr *saddr,
790 790 const struct in6_addr *daddr,
791 791 int oif)
792 792 {
793   - memset(fl, 0, sizeof(*fl));
794   - ipv6_addr_copy(&fl->fl6_src, saddr);
795   - ipv6_addr_copy(&fl->fl6_dst, daddr);
796   - fl->flowi_proto = IPPROTO_ICMPV6;
797   - fl->fl6_icmp_type = type;
798   - fl->fl6_icmp_code = 0;
799   - fl->flowi_oif = oif;
800   - security_sk_classify_flow(sk, fl);
  793 + memset(fl6, 0, sizeof(*fl6));
  794 + ipv6_addr_copy(&fl6->saddr, saddr);
  795 + ipv6_addr_copy(&fl6->daddr, daddr);
  796 + fl6->flowi6_proto = IPPROTO_ICMPV6;
  797 + fl6->uli.icmpt.type = type;
  798 + fl6->uli.icmpt.code = 0;
  799 + fl6->flowi6_oif = oif;
  800 + security_sk_classify_flow(sk, flowi6_to_flowi(fl6));
801 801 }
802 802  
803 803 /*
net/ipv6/inet6_connection_sock.c
... ... @@ -61,20 +61,20 @@
61 61 struct ipv6_pinfo *np = inet6_sk(sk);
62 62 struct in6_addr *final_p, final;
63 63 struct dst_entry *dst;
64   - struct flowi fl;
  64 + struct flowi6 fl6;
65 65  
66   - memset(&fl, 0, sizeof(fl));
67   - fl.flowi_proto = IPPROTO_TCP;
68   - ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr);
69   - final_p = fl6_update_dst(&fl, np->opt, &final);
70   - ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr);
71   - fl.flowi_oif = sk->sk_bound_dev_if;
72   - fl.flowi_mark = sk->sk_mark;
73   - fl.fl6_dport = inet_rsk(req)->rmt_port;
74   - fl.fl6_sport = inet_rsk(req)->loc_port;
75   - security_req_classify_flow(req, &fl);
  66 + memset(&fl6, 0, sizeof(fl6));
  67 + fl6.flowi6_proto = IPPROTO_TCP;
  68 + ipv6_addr_copy(&fl6.daddr, &treq->rmt_addr);
  69 + final_p = fl6_update_dst(&fl6, np->opt, &final);
  70 + ipv6_addr_copy(&fl6.saddr, &treq->loc_addr);
  71 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  72 + fl6.flowi6_mark = sk->sk_mark;
  73 + fl6.uli.ports.dport = inet_rsk(req)->rmt_port;
  74 + fl6.uli.ports.sport = inet_rsk(req)->loc_port;
  75 + security_req_classify_flow(req, flowi6_to_flowi(&fl6));
76 76  
77   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
  77 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
78 78 if (IS_ERR(dst))
79 79 return NULL;
80 80  
81 81  
82 82  
83 83  
... ... @@ -208,28 +208,28 @@
208 208 struct sock *sk = skb->sk;
209 209 struct inet_sock *inet = inet_sk(sk);
210 210 struct ipv6_pinfo *np = inet6_sk(sk);
211   - struct flowi fl;
  211 + struct flowi6 fl6;
212 212 struct dst_entry *dst;
213 213 struct in6_addr *final_p, final;
214 214  
215   - memset(&fl, 0, sizeof(fl));
216   - fl.flowi_proto = sk->sk_protocol;
217   - ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
218   - ipv6_addr_copy(&fl.fl6_src, &np->saddr);
219   - fl.fl6_flowlabel = np->flow_label;
220   - IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
221   - fl.flowi_oif = sk->sk_bound_dev_if;
222   - fl.flowi_mark = sk->sk_mark;
223   - fl.fl6_sport = inet->inet_sport;
224   - fl.fl6_dport = inet->inet_dport;
225   - security_sk_classify_flow(sk, &fl);
  215 + memset(&fl6, 0, sizeof(fl6));
  216 + fl6.flowi6_proto = sk->sk_protocol;
  217 + ipv6_addr_copy(&fl6.daddr, &np->daddr);
  218 + ipv6_addr_copy(&fl6.saddr, &np->saddr);
  219 + fl6.flowlabel = np->flow_label;
  220 + IP6_ECN_flow_xmit(sk, fl6.flowlabel);
  221 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  222 + fl6.flowi6_mark = sk->sk_mark;
  223 + fl6.uli.ports.sport = inet->inet_sport;
  224 + fl6.uli.ports.dport = inet->inet_dport;
  225 + security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
226 226  
227   - final_p = fl6_update_dst(&fl, np->opt, &final);
  227 + final_p = fl6_update_dst(&fl6, np->opt, &final);
228 228  
229 229 dst = __inet6_csk_dst_check(sk, np->dst_cookie);
230 230  
231 231 if (dst == NULL) {
232   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
  232 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
233 233  
234 234 if (IS_ERR(dst)) {
235 235 sk->sk_err_soft = -PTR_ERR(dst);
236 236  
... ... @@ -244,9 +244,9 @@
244 244 skb_dst_set(skb, dst_clone(dst));
245 245  
246 246 /* Restore final destination back after routing done */
247   - ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
  247 + ipv6_addr_copy(&fl6.daddr, &np->daddr);
248 248  
249   - return ip6_xmit(sk, skb, &fl, np->opt);
  249 + return ip6_xmit(sk, skb, &fl6, np->opt);
250 250 }
251 251  
252 252 EXPORT_SYMBOL_GPL(inet6_csk_xmit);
... ... @@ -260,10 +260,10 @@
260 260 return net->ipv6.fib6_main_tbl;
261 261 }
262 262  
263   -struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi *fl,
  263 +struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6,
264 264 int flags, pol_lookup_t lookup)
265 265 {
266   - return (struct dst_entry *) lookup(net, net->ipv6.fib6_main_tbl, fl, flags);
  266 + return (struct dst_entry *) lookup(net, net->ipv6.fib6_main_tbl, fl6, flags);
267 267 }
268 268  
269 269 static void __net_init fib6_tables_init(struct net *net)
net/ipv6/ip6_flowlabel.c
... ... @@ -342,7 +342,7 @@
342 342  
343 343 if (olen > 0) {
344 344 struct msghdr msg;
345   - struct flowi flowi;
  345 + struct flowi6 flowi6;
346 346 int junk;
347 347  
348 348 err = -ENOMEM;
349 349  
... ... @@ -358,9 +358,9 @@
358 358  
359 359 msg.msg_controllen = olen;
360 360 msg.msg_control = (void*)(fl->opt+1);
361   - flowi.flowi_oif = 0;
  361 + memset(&flowi6, 0, sizeof(flowi6));
362 362  
363   - err = datagram_send_ctl(net, &msg, &flowi, fl->opt, &junk,
  363 + err = datagram_send_ctl(net, &msg, &flowi6, fl->opt, &junk,
364 364 &junk, &junk);
365 365 if (err)
366 366 goto done;
net/ipv6/ip6_output.c
... ... @@ -174,15 +174,15 @@
174 174 * xmit an sk_buff (used by TCP, SCTP and DCCP)
175 175 */
176 176  
177   -int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
  177 +int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
178 178 struct ipv6_txoptions *opt)
179 179 {
180 180 struct net *net = sock_net(sk);
181 181 struct ipv6_pinfo *np = inet6_sk(sk);
182   - struct in6_addr *first_hop = &fl->fl6_dst;
  182 + struct in6_addr *first_hop = &fl6->daddr;
183 183 struct dst_entry *dst = skb_dst(skb);
184 184 struct ipv6hdr *hdr;
185   - u8 proto = fl->flowi_proto;
  185 + u8 proto = fl6->flowi6_proto;
186 186 int seg_len = skb->len;
187 187 int hlimit = -1;
188 188 int tclass = 0;
189 189  
... ... @@ -230,13 +230,13 @@
230 230 if (hlimit < 0)
231 231 hlimit = ip6_dst_hoplimit(dst);
232 232  
233   - *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | fl->fl6_flowlabel;
  233 + *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | fl6->flowlabel;
234 234  
235 235 hdr->payload_len = htons(seg_len);
236 236 hdr->nexthdr = proto;
237 237 hdr->hop_limit = hlimit;
238 238  
239   - ipv6_addr_copy(&hdr->saddr, &fl->fl6_src);
  239 + ipv6_addr_copy(&hdr->saddr, &fl6->saddr);
240 240 ipv6_addr_copy(&hdr->daddr, first_hop);
241 241  
242 242 skb->priority = sk->sk_priority;
... ... @@ -879,7 +879,7 @@
879 879  
880 880 static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
881 881 struct dst_entry *dst,
882   - struct flowi *fl)
  882 + struct flowi6 *fl6)
883 883 {
884 884 struct ipv6_pinfo *np = inet6_sk(sk);
885 885 struct rt6_info *rt = (struct rt6_info *)dst;
886 886  
887 887  
... ... @@ -904,11 +904,11 @@
904 904 * sockets.
905 905 * 2. oif also should be the same.
906 906 */
907   - if (ip6_rt_check(&rt->rt6i_dst, &fl->fl6_dst, np->daddr_cache) ||
  907 + if (ip6_rt_check(&rt->rt6i_dst, &fl6->daddr, np->daddr_cache) ||
908 908 #ifdef CONFIG_IPV6_SUBTREES
909   - ip6_rt_check(&rt->rt6i_src, &fl->fl6_src, np->saddr_cache) ||
  909 + ip6_rt_check(&rt->rt6i_src, &fl6->saddr, np->saddr_cache) ||
910 910 #endif
911   - (fl->flowi_oif && fl->flowi_oif != dst->dev->ifindex)) {
  911 + (fl6->flowi6_oif && fl6->flowi6_oif != dst->dev->ifindex)) {
912 912 dst_release(dst);
913 913 dst = NULL;
914 914 }
915 915  
916 916  
917 917  
918 918  
... ... @@ -918,22 +918,22 @@
918 918 }
919 919  
920 920 static int ip6_dst_lookup_tail(struct sock *sk,
921   - struct dst_entry **dst, struct flowi *fl)
  921 + struct dst_entry **dst, struct flowi6 *fl6)
922 922 {
923 923 int err;
924 924 struct net *net = sock_net(sk);
925 925  
926 926 if (*dst == NULL)
927   - *dst = ip6_route_output(net, sk, fl);
  927 + *dst = ip6_route_output(net, sk, fl6);
928 928  
929 929 if ((err = (*dst)->error))
930 930 goto out_err_release;
931 931  
932   - if (ipv6_addr_any(&fl->fl6_src)) {
  932 + if (ipv6_addr_any(&fl6->saddr)) {
933 933 err = ipv6_dev_get_saddr(net, ip6_dst_idev(*dst)->dev,
934   - &fl->fl6_dst,
  934 + &fl6->daddr,
935 935 sk ? inet6_sk(sk)->srcprefs : 0,
936   - &fl->fl6_src);
  936 + &fl6->saddr);
937 937 if (err)
938 938 goto out_err_release;
939 939 }
940 940  
... ... @@ -949,10 +949,10 @@
949 949 */
950 950 if ((*dst)->neighbour && !((*dst)->neighbour->nud_state & NUD_VALID)) {
951 951 struct inet6_ifaddr *ifp;
952   - struct flowi fl_gw;
  952 + struct flowi6 fl_gw6;
953 953 int redirect;
954 954  
955   - ifp = ipv6_get_ifaddr(net, &fl->fl6_src,
  955 + ifp = ipv6_get_ifaddr(net, &fl6->saddr,
956 956 (*dst)->dev, 1);
957 957  
958 958 redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC);
... ... @@ -965,9 +965,9 @@
965 965 * default router instead
966 966 */
967 967 dst_release(*dst);
968   - memcpy(&fl_gw, fl, sizeof(struct flowi));
969   - memset(&fl_gw.fl6_dst, 0, sizeof(struct in6_addr));
970   - *dst = ip6_route_output(net, sk, &fl_gw);
  968 + memcpy(&fl_gw6, fl6, sizeof(struct flowi6));
  969 + memset(&fl_gw6.daddr, 0, sizeof(struct in6_addr));
  970 + *dst = ip6_route_output(net, sk, &fl_gw6);
971 971 if ((err = (*dst)->error))
972 972 goto out_err_release;
973 973 }
974 974  
975 975  
976 976  
... ... @@ -988,23 +988,23 @@
988 988 * ip6_dst_lookup - perform route lookup on flow
989 989 * @sk: socket which provides route info
990 990 * @dst: pointer to dst_entry * for result
991   - * @fl: flow to lookup
  991 + * @fl6: flow to lookup
992 992 *
993 993 * This function performs a route lookup on the given flow.
994 994 *
995 995 * It returns zero on success, or a standard errno code on error.
996 996 */
997   -int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
  997 +int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6)
998 998 {
999 999 *dst = NULL;
1000   - return ip6_dst_lookup_tail(sk, dst, fl);
  1000 + return ip6_dst_lookup_tail(sk, dst, fl6);
1001 1001 }
1002 1002 EXPORT_SYMBOL_GPL(ip6_dst_lookup);
1003 1003  
1004 1004 /**
1005 1005 * ip6_dst_lookup_flow - perform route lookup on flow with ipsec
1006 1006 * @sk: socket which provides route info
1007   - * @fl: flow to lookup
  1007 + * @fl6: flow to lookup
1008 1008 * @final_dst: final destination address for ipsec lookup
1009 1009 * @can_sleep: we are in a sleepable context
1010 1010 *
1011 1011  
1012 1012  
1013 1013  
1014 1014  
1015 1015  
... ... @@ -1013,29 +1013,29 @@
1013 1013 * It returns a valid dst pointer on success, or a pointer encoded
1014 1014 * error code.
1015 1015 */
1016   -struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi *fl,
  1016 +struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
1017 1017 const struct in6_addr *final_dst,
1018 1018 bool can_sleep)
1019 1019 {
1020 1020 struct dst_entry *dst = NULL;
1021 1021 int err;
1022 1022  
1023   - err = ip6_dst_lookup_tail(sk, &dst, fl);
  1023 + err = ip6_dst_lookup_tail(sk, &dst, fl6);
1024 1024 if (err)
1025 1025 return ERR_PTR(err);
1026 1026 if (final_dst)
1027   - ipv6_addr_copy(&fl->fl6_dst, final_dst);
  1027 + ipv6_addr_copy(&fl6->daddr, final_dst);
1028 1028 if (can_sleep)
1029   - fl->flowi_flags |= FLOWI_FLAG_CAN_SLEEP;
  1029 + fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP;
1030 1030  
1031   - return xfrm_lookup(sock_net(sk), dst, fl, sk, 0);
  1031 + return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0);
1032 1032 }
1033 1033 EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow);
1034 1034  
1035 1035 /**
1036 1036 * ip6_sk_dst_lookup_flow - perform socket cached route lookup on flow
1037 1037 * @sk: socket which provides the dst cache and route info
1038   - * @fl: flow to lookup
  1038 + * @fl6: flow to lookup
1039 1039 * @final_dst: final destination address for ipsec lookup
1040 1040 * @can_sleep: we are in a sleepable context
1041 1041 *
1042 1042  
1043 1043  
1044 1044  
1045 1045  
1046 1046  
... ... @@ -1047,24 +1047,24 @@
1047 1047 * It returns a valid dst pointer on success, or a pointer encoded
1048 1048 * error code.
1049 1049 */
1050   -struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi *fl,
  1050 +struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
1051 1051 const struct in6_addr *final_dst,
1052 1052 bool can_sleep)
1053 1053 {
1054 1054 struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
1055 1055 int err;
1056 1056  
1057   - dst = ip6_sk_dst_check(sk, dst, fl);
  1057 + dst = ip6_sk_dst_check(sk, dst, fl6);
1058 1058  
1059   - err = ip6_dst_lookup_tail(sk, &dst, fl);
  1059 + err = ip6_dst_lookup_tail(sk, &dst, fl6);
1060 1060 if (err)
1061 1061 return ERR_PTR(err);
1062 1062 if (final_dst)
1063   - ipv6_addr_copy(&fl->fl6_dst, final_dst);
  1063 + ipv6_addr_copy(&fl6->daddr, final_dst);
1064 1064 if (can_sleep)
1065   - fl->flowi_flags |= FLOWI_FLAG_CAN_SLEEP;
  1065 + fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP;
1066 1066  
1067   - return xfrm_lookup(sock_net(sk), dst, fl, sk, 0);
  1067 + return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0);
1068 1068 }
1069 1069 EXPORT_SYMBOL_GPL(ip6_sk_dst_lookup_flow);
1070 1070  
... ... @@ -1145,7 +1145,7 @@
1145 1145 int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
1146 1146 int offset, int len, int odd, struct sk_buff *skb),
1147 1147 void *from, int length, int transhdrlen,
1148   - int hlimit, int tclass, struct ipv6_txoptions *opt, struct flowi *fl,
  1148 + int hlimit, int tclass, struct ipv6_txoptions *opt, struct flowi6 *fl6,
1149 1149 struct rt6_info *rt, unsigned int flags, int dontfrag)
1150 1150 {
1151 1151 struct inet_sock *inet = inet_sk(sk);
... ... @@ -1203,7 +1203,7 @@
1203 1203 }
1204 1204 dst_hold(&rt->dst);
1205 1205 inet->cork.dst = &rt->dst;
1206   - inet->cork.fl = *fl;
  1206 + inet->cork.fl.u.ip6 = *fl6;
1207 1207 np->cork.hop_limit = hlimit;
1208 1208 np->cork.tclass = tclass;
1209 1209 mtu = np->pmtudisc == IPV6_PMTUDISC_PROBE ?
... ... @@ -1224,7 +1224,7 @@
1224 1224 transhdrlen += exthdrlen;
1225 1225 } else {
1226 1226 rt = (struct rt6_info *)inet->cork.dst;
1227   - fl = &inet->cork.fl;
  1227 + fl6 = &inet->cork.fl.u.ip6;
1228 1228 opt = np->cork.opt;
1229 1229 transhdrlen = 0;
1230 1230 exthdrlen = 0;
... ... @@ -1239,7 +1239,7 @@
1239 1239  
1240 1240 if (mtu <= sizeof(struct ipv6hdr) + IPV6_MAXPLEN) {
1241 1241 if (inet->cork.length + length > sizeof(struct ipv6hdr) + IPV6_MAXPLEN - fragheaderlen) {
1242   - ipv6_local_error(sk, EMSGSIZE, fl, mtu-exthdrlen);
  1242 + ipv6_local_error(sk, EMSGSIZE, fl6, mtu-exthdrlen);
1243 1243 return -EMSGSIZE;
1244 1244 }
1245 1245 }
... ... @@ -1271,7 +1271,7 @@
1271 1271 if (length > mtu) {
1272 1272 int proto = sk->sk_protocol;
1273 1273 if (dontfrag && (proto == IPPROTO_UDP || proto == IPPROTO_RAW)){
1274   - ipv6_local_rxpmtu(sk, fl, mtu-exthdrlen);
  1274 + ipv6_local_rxpmtu(sk, fl6, mtu-exthdrlen);
1275 1275 return -EMSGSIZE;
1276 1276 }
1277 1277  
... ... @@ -1516,8 +1516,8 @@
1516 1516 struct ipv6hdr *hdr;
1517 1517 struct ipv6_txoptions *opt = np->cork.opt;
1518 1518 struct rt6_info *rt = (struct rt6_info *)inet->cork.dst;
1519   - struct flowi *fl = &inet->cork.fl;
1520   - unsigned char proto = fl->flowi_proto;
  1519 + struct flowi6 *fl6 = &inet->cork.fl.u.ip6;
  1520 + unsigned char proto = fl6->flowi6_proto;
1521 1521 int err = 0;
1522 1522  
1523 1523 if ((skb = __skb_dequeue(&sk->sk_write_queue)) == NULL)
... ... @@ -1542,7 +1542,7 @@
1542 1542 if (np->pmtudisc < IPV6_PMTUDISC_DO)
1543 1543 skb->local_df = 1;
1544 1544  
1545   - ipv6_addr_copy(final_dst, &fl->fl6_dst);
  1545 + ipv6_addr_copy(final_dst, &fl6->daddr);
1546 1546 __skb_pull(skb, skb_network_header_len(skb));
1547 1547 if (opt && opt->opt_flen)
1548 1548 ipv6_push_frag_opts(skb, opt, &proto);
1549 1549  
... ... @@ -1553,12 +1553,12 @@
1553 1553 skb_reset_network_header(skb);
1554 1554 hdr = ipv6_hdr(skb);
1555 1555  
1556   - *(__be32*)hdr = fl->fl6_flowlabel |
  1556 + *(__be32*)hdr = fl6->flowlabel |
1557 1557 htonl(0x60000000 | ((int)np->cork.tclass << 20));
1558 1558  
1559 1559 hdr->hop_limit = np->cork.hop_limit;
1560 1560 hdr->nexthdr = proto;
1561   - ipv6_addr_copy(&hdr->saddr, &fl->fl6_src);
  1561 + ipv6_addr_copy(&hdr->saddr, &fl6->saddr);
1562 1562 ipv6_addr_copy(&hdr->daddr, final_dst);
1563 1563  
1564 1564 skb->priority = sk->sk_priority;
net/ipv6/ip6_tunnel.c
... ... @@ -884,7 +884,7 @@
884 884 static int ip6_tnl_xmit2(struct sk_buff *skb,
885 885 struct net_device *dev,
886 886 __u8 dsfield,
887   - struct flowi *fl,
  887 + struct flowi6 *fl6,
888 888 int encap_limit,
889 889 __u32 *pmtu)
890 890 {
891 891  
... ... @@ -904,11 +904,11 @@
904 904 if ((dst = ip6_tnl_dst_check(t)) != NULL)
905 905 dst_hold(dst);
906 906 else {
907   - dst = ip6_route_output(net, NULL, fl);
  907 + dst = ip6_route_output(net, NULL, fl6);
908 908  
909 909 if (dst->error)
910 910 goto tx_err_link_failure;
911   - dst = xfrm_lookup(net, dst, fl, NULL, 0);
  911 + dst = xfrm_lookup(net, dst, flowi6_to_flowi(fl6), NULL, 0);
912 912 if (IS_ERR(dst)) {
913 913 err = PTR_ERR(dst);
914 914 dst = NULL;
... ... @@ -963,7 +963,7 @@
963 963  
964 964 skb->transport_header = skb->network_header;
965 965  
966   - proto = fl->flowi_proto;
  966 + proto = fl6->flowi6_proto;
967 967 if (encap_limit >= 0) {
968 968 init_tel_txopt(&opt, encap_limit);
969 969 ipv6_push_nfrag_opts(skb, &opt.ops, &proto, NULL);
970 970  
... ... @@ -971,13 +971,13 @@
971 971 skb_push(skb, sizeof(struct ipv6hdr));
972 972 skb_reset_network_header(skb);
973 973 ipv6h = ipv6_hdr(skb);
974   - *(__be32*)ipv6h = fl->fl6_flowlabel | htonl(0x60000000);
  974 + *(__be32*)ipv6h = fl6->flowlabel | htonl(0x60000000);
975 975 dsfield = INET_ECN_encapsulate(0, dsfield);
976 976 ipv6_change_dsfield(ipv6h, ~INET_ECN_MASK, dsfield);
977 977 ipv6h->hop_limit = t->parms.hop_limit;
978 978 ipv6h->nexthdr = proto;
979   - ipv6_addr_copy(&ipv6h->saddr, &fl->fl6_src);
980   - ipv6_addr_copy(&ipv6h->daddr, &fl->fl6_dst);
  979 + ipv6_addr_copy(&ipv6h->saddr, &fl6->saddr);
  980 + ipv6_addr_copy(&ipv6h->daddr, &fl6->daddr);
981 981 nf_reset(skb);
982 982 pkt_len = skb->len;
983 983 err = ip6_local_out(skb);
... ... @@ -1007,7 +1007,7 @@
1007 1007 struct ip6_tnl *t = netdev_priv(dev);
1008 1008 struct iphdr *iph = ip_hdr(skb);
1009 1009 int encap_limit = -1;
1010   - struct flowi fl;
  1010 + struct flowi6 fl6;
1011 1011 __u8 dsfield;
1012 1012 __u32 mtu;
1013 1013 int err;
1014 1014  
1015 1015  
... ... @@ -1019,16 +1019,16 @@
1019 1019 if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT))
1020 1020 encap_limit = t->parms.encap_limit;
1021 1021  
1022   - memcpy(&fl, &t->fl, sizeof (fl));
1023   - fl.flowi_proto = IPPROTO_IPIP;
  1022 + memcpy(&fl6, &t->fl.u.ip6, sizeof (fl6));
  1023 + fl6.flowi6_proto = IPPROTO_IPIP;
1024 1024  
1025 1025 dsfield = ipv4_get_dsfield(iph);
1026 1026  
1027 1027 if ((t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS))
1028   - fl.fl6_flowlabel |= htonl((__u32)iph->tos << IPV6_TCLASS_SHIFT)
  1028 + fl6.flowlabel |= htonl((__u32)iph->tos << IPV6_TCLASS_SHIFT)
1029 1029 & IPV6_TCLASS_MASK;
1030 1030  
1031   - err = ip6_tnl_xmit2(skb, dev, dsfield, &fl, encap_limit, &mtu);
  1031 + err = ip6_tnl_xmit2(skb, dev, dsfield, &fl6, encap_limit, &mtu);
1032 1032 if (err != 0) {
1033 1033 /* XXX: send ICMP error even if DF is not set. */
1034 1034 if (err == -EMSGSIZE)
... ... @@ -1047,7 +1047,7 @@
1047 1047 struct ipv6hdr *ipv6h = ipv6_hdr(skb);
1048 1048 int encap_limit = -1;
1049 1049 __u16 offset;
1050   - struct flowi fl;
  1050 + struct flowi6 fl6;
1051 1051 __u8 dsfield;
1052 1052 __u32 mtu;
1053 1053 int err;
1054 1054  
1055 1055  
1056 1056  
... ... @@ -1069,16 +1069,16 @@
1069 1069 } else if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT))
1070 1070 encap_limit = t->parms.encap_limit;
1071 1071  
1072   - memcpy(&fl, &t->fl, sizeof (fl));
1073   - fl.flowi_proto = IPPROTO_IPV6;
  1072 + memcpy(&fl6, &t->fl.u.ip6, sizeof (fl6));
  1073 + fl6.flowi6_proto = IPPROTO_IPV6;
1074 1074  
1075 1075 dsfield = ipv6_get_dsfield(ipv6h);
1076 1076 if ((t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS))
1077   - fl.fl6_flowlabel |= (*(__be32 *) ipv6h & IPV6_TCLASS_MASK);
  1077 + fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_TCLASS_MASK);
1078 1078 if ((t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL))
1079   - fl.fl6_flowlabel |= (*(__be32 *) ipv6h & IPV6_FLOWLABEL_MASK);
  1079 + fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_FLOWLABEL_MASK);
1080 1080  
1081   - err = ip6_tnl_xmit2(skb, dev, dsfield, &fl, encap_limit, &mtu);
  1081 + err = ip6_tnl_xmit2(skb, dev, dsfield, &fl6, encap_limit, &mtu);
1082 1082 if (err != 0) {
1083 1083 if (err == -EMSGSIZE)
1084 1084 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
1085 1085  
1086 1086  
1087 1087  
... ... @@ -1141,21 +1141,21 @@
1141 1141 {
1142 1142 struct net_device *dev = t->dev;
1143 1143 struct ip6_tnl_parm *p = &t->parms;
1144   - struct flowi *fl = &t->fl;
  1144 + struct flowi6 *fl6 = &t->fl.u.ip6;
1145 1145  
1146 1146 memcpy(dev->dev_addr, &p->laddr, sizeof(struct in6_addr));
1147 1147 memcpy(dev->broadcast, &p->raddr, sizeof(struct in6_addr));
1148 1148  
1149 1149 /* Set up flowi template */
1150   - ipv6_addr_copy(&fl->fl6_src, &p->laddr);
1151   - ipv6_addr_copy(&fl->fl6_dst, &p->raddr);
1152   - fl->flowi_oif = p->link;
1153   - fl->fl6_flowlabel = 0;
  1150 + ipv6_addr_copy(&fl6->saddr, &p->laddr);
  1151 + ipv6_addr_copy(&fl6->daddr, &p->raddr);
  1152 + fl6->flowi6_oif = p->link;
  1153 + fl6->flowlabel = 0;
1154 1154  
1155 1155 if (!(p->flags&IP6_TNL_F_USE_ORIG_TCLASS))
1156   - fl->fl6_flowlabel |= IPV6_TCLASS_MASK & p->flowinfo;
  1156 + fl6->flowlabel |= IPV6_TCLASS_MASK & p->flowinfo;
1157 1157 if (!(p->flags&IP6_TNL_F_USE_ORIG_FLOWLABEL))
1158   - fl->fl6_flowlabel |= IPV6_FLOWLABEL_MASK & p->flowinfo;
  1158 + fl6->flowlabel |= IPV6_FLOWLABEL_MASK & p->flowinfo;
1159 1159  
1160 1160 ip6_tnl_set_cap(t);
1161 1161  
... ... @@ -135,14 +135,15 @@
135 135 return NULL;
136 136 }
137 137  
138   -static int ip6mr_fib_lookup(struct net *net, struct flowi *flp,
  138 +static int ip6mr_fib_lookup(struct net *net, struct flowi6 *flp6,
139 139 struct mr6_table **mrt)
140 140 {
141 141 struct ip6mr_result res;
142 142 struct fib_lookup_arg arg = { .result = &res, };
143 143 int err;
144 144  
145   - err = fib_rules_lookup(net->ipv6.mr6_rules_ops, flp, 0, &arg);
  145 + err = fib_rules_lookup(net->ipv6.mr6_rules_ops,
  146 + flowi6_to_flowi(flp6), 0, &arg);
146 147 if (err < 0)
147 148 return err;
148 149 *mrt = res.mrt;
... ... @@ -270,7 +271,7 @@
270 271 return net->ipv6.mrt6;
271 272 }
272 273  
273   -static int ip6mr_fib_lookup(struct net *net, struct flowi *flp,
  274 +static int ip6mr_fib_lookup(struct net *net, struct flowi6 *flp6,
274 275 struct mr6_table **mrt)
275 276 {
276 277 *mrt = net->ipv6.mrt6;
... ... @@ -617,9 +618,9 @@
617 618 struct net_device *reg_dev = NULL;
618 619 struct net *net = dev_net(skb->dev);
619 620 struct mr6_table *mrt;
620   - struct flowi fl = {
621   - .flowi_iif = skb->dev->ifindex,
622   - .flowi_mark = skb->mark,
  621 + struct flowi6 fl6 = {
  622 + .flowi6_iif = skb->dev->ifindex,
  623 + .flowi6_mark = skb->mark,
623 624 };
624 625 int reg_vif_num;
625 626  
... ... @@ -644,7 +645,7 @@
644 645 ntohs(encap->payload_len) + sizeof(*pim) > skb->len)
645 646 goto drop;
646 647  
647   - if (ip6mr_fib_lookup(net, &fl, &mrt) < 0)
  648 + if (ip6mr_fib_lookup(net, &fl6, &mrt) < 0)
648 649 goto drop;
649 650 reg_vif_num = mrt->mroute_reg_vif_num;
650 651  
651 652  
... ... @@ -687,14 +688,14 @@
687 688 {
688 689 struct net *net = dev_net(dev);
689 690 struct mr6_table *mrt;
690   - struct flowi fl = {
691   - .flowi_oif = dev->ifindex,
692   - .flowi_iif = skb->skb_iif,
693   - .flowi_mark = skb->mark,
  691 + struct flowi6 fl6 = {
  692 + .flowi6_oif = dev->ifindex,
  693 + .flowi6_iif = skb->skb_iif,
  694 + .flowi6_mark = skb->mark,
694 695 };
695 696 int err;
696 697  
697   - err = ip6mr_fib_lookup(net, &fl, &mrt);
  698 + err = ip6mr_fib_lookup(net, &fl6, &mrt);
698 699 if (err < 0)
699 700 return err;
700 701  
701 702  
... ... @@ -1547,13 +1548,13 @@
1547 1548 struct sock *mroute6_socket(struct net *net, struct sk_buff *skb)
1548 1549 {
1549 1550 struct mr6_table *mrt;
1550   - struct flowi fl = {
1551   - .flowi_iif = skb->skb_iif,
1552   - .flowi_oif = skb->dev->ifindex,
1553   - .flowi_mark= skb->mark,
  1551 + struct flowi6 fl6 = {
  1552 + .flowi6_iif = skb->skb_iif,
  1553 + .flowi6_oif = skb->dev->ifindex,
  1554 + .flowi6_mark = skb->mark,
1554 1555 };
1555 1556  
1556   - if (ip6mr_fib_lookup(net, &fl, &mrt) < 0)
  1557 + if (ip6mr_fib_lookup(net, &fl6, &mrt) < 0)
1557 1558 return NULL;
1558 1559  
1559 1560 return mrt->mroute6_sk;
... ... @@ -1897,7 +1898,7 @@
1897 1898 struct mif_device *vif = &mrt->vif6_table[vifi];
1898 1899 struct net_device *dev;
1899 1900 struct dst_entry *dst;
1900   - struct flowi fl;
  1901 + struct flowi6 fl6;
1901 1902  
1902 1903 if (vif->dev == NULL)
1903 1904 goto out_free;
1904 1905  
... ... @@ -1915,12 +1916,12 @@
1915 1916  
1916 1917 ipv6h = ipv6_hdr(skb);
1917 1918  
1918   - fl = (struct flowi) {
1919   - .flowi_oif = vif->link,
1920   - .fl6_dst = ipv6h->daddr,
  1919 + fl6 = (struct flowi6) {
  1920 + .flowi6_oif = vif->link,
  1921 + .daddr = ipv6h->daddr,
1921 1922 };
1922 1923  
1923   - dst = ip6_route_output(net, NULL, &fl);
  1924 + dst = ip6_route_output(net, NULL, &fl6);
1924 1925 if (!dst)
1925 1926 goto out_free;
1926 1927  
1927 1928  
... ... @@ -2043,13 +2044,13 @@
2043 2044 struct mfc6_cache *cache;
2044 2045 struct net *net = dev_net(skb->dev);
2045 2046 struct mr6_table *mrt;
2046   - struct flowi fl = {
2047   - .flowi_iif = skb->dev->ifindex,
2048   - .flowi_mark= skb->mark,
  2047 + struct flowi6 fl6 = {
  2048 + .flowi6_iif = skb->dev->ifindex,
  2049 + .flowi6_mark = skb->mark,
2049 2050 };
2050 2051 int err;
2051 2052  
2052   - err = ip6mr_fib_lookup(net, &fl, &mrt);
  2053 + err = ip6mr_fib_lookup(net, &fl6, &mrt);
2053 2054 if (err < 0)
2054 2055 return err;
2055 2056  
net/ipv6/ipv6_sockglue.c
... ... @@ -444,12 +444,12 @@
444 444 {
445 445 struct ipv6_txoptions *opt = NULL;
446 446 struct msghdr msg;
447   - struct flowi fl;
  447 + struct flowi6 fl6;
448 448 int junk;
449 449  
450   - fl.fl6_flowlabel = 0;
451   - fl.flowi_oif = sk->sk_bound_dev_if;
452   - fl.flowi_mark = sk->sk_mark;
  450 + memset(&fl6, 0, sizeof(fl6));
  451 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  452 + fl6.flowi6_mark = sk->sk_mark;
453 453  
454 454 if (optlen == 0)
455 455 goto update;
... ... @@ -475,7 +475,7 @@
475 475 msg.msg_controllen = optlen;
476 476 msg.msg_control = (void*)(opt+1);
477 477  
478   - retv = datagram_send_ctl(net, &msg, &fl, opt, &junk, &junk,
  478 + retv = datagram_send_ctl(net, &msg, &fl6, opt, &junk, &junk,
479 479 &junk);
480 480 if (retv)
481 481 goto done;
... ... @@ -1396,7 +1396,7 @@
1396 1396 struct inet6_dev *idev;
1397 1397 struct net *net = dev_net(skb->dev);
1398 1398 int err;
1399   - struct flowi fl;
  1399 + struct flowi6 fl6;
1400 1400 struct dst_entry *dst;
1401 1401  
1402 1402 rcu_read_lock();
1403 1403  
... ... @@ -1419,11 +1419,11 @@
1419 1419 goto err_out;
1420 1420 }
1421 1421  
1422   - icmpv6_flow_init(net->ipv6.igmp_sk, &fl, ICMPV6_MLD2_REPORT,
  1422 + icmpv6_flow_init(net->ipv6.igmp_sk, &fl6, ICMPV6_MLD2_REPORT,
1423 1423 &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr,
1424 1424 skb->dev->ifindex);
1425 1425  
1426   - dst = xfrm_lookup(net, dst, &fl, NULL, 0);
  1426 + dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
1427 1427 err = 0;
1428 1428 if (IS_ERR(dst)) {
1429 1429 err = PTR_ERR(dst);
... ... @@ -1731,7 +1731,7 @@
1731 1731 u8 ra[8] = { IPPROTO_ICMPV6, 0,
1732 1732 IPV6_TLV_ROUTERALERT, 2, 0, 0,
1733 1733 IPV6_TLV_PADN, 0 };
1734   - struct flowi fl;
  1734 + struct flowi6 fl6;
1735 1735 struct dst_entry *dst;
1736 1736  
1737 1737 if (type == ICMPV6_MGM_REDUCTION)
1738 1738  
... ... @@ -1791,11 +1791,11 @@
1791 1791 goto err_out;
1792 1792 }
1793 1793  
1794   - icmpv6_flow_init(sk, &fl, type,
  1794 + icmpv6_flow_init(sk, &fl6, type,
1795 1795 &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr,
1796 1796 skb->dev->ifindex);
1797 1797  
1798   - dst = xfrm_lookup(net, dst, &fl, NULL, 0);
  1798 + dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
1799 1799 if (IS_ERR(dst)) {
1800 1800 err = PTR_ERR(dst);
1801 1801 goto err_out;
... ... @@ -208,14 +208,15 @@
208 208 {
209 209 struct net *net = xs_net(x);
210 210 struct inet6_skb_parm *opt = (struct inet6_skb_parm *)skb->cb;
  211 + const struct flowi6 *fl6 = &fl->u.ip6;
211 212 struct ipv6_destopt_hao *hao = NULL;
212 213 struct xfrm_selector sel;
213 214 int offset;
214 215 struct timeval stamp;
215 216 int err = 0;
216 217  
217   - if (unlikely(fl->flowi_proto == IPPROTO_MH &&
218   - fl->fl6_mh_type <= IP6_MH_TYPE_MAX))
  218 + if (unlikely(fl6->flowi6_proto == IPPROTO_MH &&
  219 + fl6->uli.mht.type <= IP6_MH_TYPE_MAX))
219 220 goto out;
220 221  
221 222 if (likely(opt->dsthao)) {
222 223  
223 224  
... ... @@ -240,14 +241,14 @@
240 241 sizeof(sel.saddr));
241 242 sel.prefixlen_s = 128;
242 243 sel.family = AF_INET6;
243   - sel.proto = fl->flowi_proto;
244   - sel.dport = xfrm_flowi_dport(fl, &fl->u.ip6.uli);
  244 + sel.proto = fl6->flowi6_proto;
  245 + sel.dport = xfrm_flowi_dport(fl, &fl6->uli);
245 246 if (sel.dport)
246 247 sel.dport_mask = htons(~0);
247   - sel.sport = xfrm_flowi_sport(fl, &fl->u.ip6.uli);
  248 + sel.sport = xfrm_flowi_sport(fl, &fl6->uli);
248 249 if (sel.sport)
249 250 sel.sport_mask = htons(~0);
250   - sel.ifindex = fl->flowi_oif;
  251 + sel.ifindex = fl6->flowi6_oif;
251 252  
252 253 err = km_report(net, IPPROTO_DSTOPTS, &sel,
253 254 (hao ? (xfrm_address_t *)&hao->addr : NULL));
... ... @@ -511,7 +511,7 @@
511 511 const struct in6_addr *saddr,
512 512 struct icmp6hdr *icmp6h)
513 513 {
514   - struct flowi fl;
  514 + struct flowi6 fl6;
515 515 struct dst_entry *dst;
516 516 struct net *net = dev_net(dev);
517 517 struct sock *sk = net->ipv6.ndisc_sk;
... ... @@ -521,7 +521,7 @@
521 521  
522 522 type = icmp6h->icmp6_type;
523 523  
524   - icmpv6_flow_init(sk, &fl, type, saddr, daddr, dev->ifindex);
  524 + icmpv6_flow_init(sk, &fl6, type, saddr, daddr, dev->ifindex);
525 525  
526 526 dst = icmp6_dst_alloc(dev, neigh, daddr);
527 527 if (!dst) {
... ... @@ -529,7 +529,7 @@
529 529 return;
530 530 }
531 531  
532   - dst = xfrm_lookup(net, dst, &fl, NULL, 0);
  532 + dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
533 533 if (IS_ERR(dst)) {
534 534 kfree_skb(skb);
535 535 return;
... ... @@ -1515,7 +1515,7 @@
1515 1515 struct rt6_info *rt;
1516 1516 struct dst_entry *dst;
1517 1517 struct inet6_dev *idev;
1518   - struct flowi fl;
  1518 + struct flowi6 fl6;
1519 1519 u8 *opt;
1520 1520 int rd_len;
1521 1521 int err;
1522 1522  
1523 1523  
... ... @@ -1535,14 +1535,14 @@
1535 1535 return;
1536 1536 }
1537 1537  
1538   - icmpv6_flow_init(sk, &fl, NDISC_REDIRECT,
  1538 + icmpv6_flow_init(sk, &fl6, NDISC_REDIRECT,
1539 1539 &saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex);
1540 1540  
1541   - dst = ip6_route_output(net, NULL, &fl);
  1541 + dst = ip6_route_output(net, NULL, &fl6);
1542 1542 if (dst == NULL)
1543 1543 return;
1544 1544  
1545   - dst = xfrm_lookup(net, dst, &fl, NULL, 0);
  1545 + dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
1546 1546 if (IS_ERR(dst))
1547 1547 return;
1548 1548  
net/ipv6/netfilter.c
... ... @@ -15,14 +15,14 @@
15 15 struct net *net = dev_net(skb_dst(skb)->dev);
16 16 struct ipv6hdr *iph = ipv6_hdr(skb);
17 17 struct dst_entry *dst;
18   - struct flowi fl = {
19   - .flowi_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0,
20   - .flowi_mark = skb->mark,
21   - .fl6_dst = iph->daddr,
22   - .fl6_src = iph->saddr,
  18 + struct flowi6 fl6 = {
  19 + .flowi6_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0,
  20 + .flowi6_mark = skb->mark,
  21 + .daddr = iph->daddr,
  22 + .saddr = iph->saddr,
23 23 };
24 24  
25   - dst = ip6_route_output(net, skb->sk, &fl);
  25 + dst = ip6_route_output(net, skb->sk, &fl6);
26 26 if (dst->error) {
27 27 IP6_INC_STATS(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES);
28 28 LIMIT_NETDEBUG(KERN_DEBUG "ip6_route_me_harder: No more route.\n");
29 29  
... ... @@ -37,9 +37,9 @@
37 37  
38 38 #ifdef CONFIG_XFRM
39 39 if (!(IP6CB(skb)->flags & IP6SKB_XFRM_TRANSFORMED) &&
40   - xfrm_decode_session(skb, &fl, AF_INET6) == 0) {
  40 + xfrm_decode_session(skb, flowi6_to_flowi(&fl6), AF_INET6) == 0) {
41 41 skb_dst_set(skb, NULL);
42   - dst = xfrm_lookup(net, dst, &fl, skb->sk, 0);
  42 + dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), skb->sk, 0);
43 43 if (IS_ERR(dst))
44 44 return -1;
45 45 skb_dst_set(skb, dst);
... ... @@ -92,7 +92,7 @@
92 92  
93 93 static int nf_ip6_route(struct dst_entry **dst, struct flowi *fl)
94 94 {
95   - *dst = ip6_route_output(&init_net, NULL, fl);
  95 + *dst = ip6_route_output(&init_net, NULL, &fl->u.ip6);
96 96 return (*dst)->error;
97 97 }
98 98  
net/ipv6/netfilter/ip6t_REJECT.c
... ... @@ -47,7 +47,7 @@
47 47 struct ipv6hdr *ip6h;
48 48 struct dst_entry *dst = NULL;
49 49 u8 proto;
50   - struct flowi fl;
  50 + struct flowi6 fl6;
51 51  
52 52 if ((!(ipv6_addr_type(&oip6h->saddr) & IPV6_ADDR_UNICAST)) ||
53 53 (!(ipv6_addr_type(&oip6h->daddr) & IPV6_ADDR_UNICAST))) {
54 54  
... ... @@ -89,19 +89,19 @@
89 89 return;
90 90 }
91 91  
92   - memset(&fl, 0, sizeof(fl));
93   - fl.flowi_proto = IPPROTO_TCP;
94   - ipv6_addr_copy(&fl.fl6_src, &oip6h->daddr);
95   - ipv6_addr_copy(&fl.fl6_dst, &oip6h->saddr);
96   - fl.fl6_sport = otcph.dest;
97   - fl.fl6_dport = otcph.source;
98   - security_skb_classify_flow(oldskb, &fl);
99   - dst = ip6_route_output(net, NULL, &fl);
  92 + memset(&fl6, 0, sizeof(fl6));
  93 + fl6.flowi6_proto = IPPROTO_TCP;
  94 + ipv6_addr_copy(&fl6.saddr, &oip6h->daddr);
  95 + ipv6_addr_copy(&fl6.daddr, &oip6h->saddr);
  96 + fl6.uli.ports.sport = otcph.dest;
  97 + fl6.uli.ports.dport = otcph.source;
  98 + security_skb_classify_flow(oldskb, flowi6_to_flowi(&fl6));
  99 + dst = ip6_route_output(net, NULL, &fl6);
100 100 if (dst == NULL || dst->error) {
101 101 dst_release(dst);
102 102 return;
103 103 }
104   - dst = xfrm_lookup(net, dst, &fl, NULL, 0);
  104 + dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
105 105 if (IS_ERR(dst))
106 106 return;
107 107  
... ... @@ -524,7 +524,7 @@
524 524 goto out;
525 525 }
526 526  
527   -static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl,
  527 +static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
528 528 struct raw6_sock *rp)
529 529 {
530 530 struct sk_buff *skb;
531 531  
... ... @@ -586,11 +586,10 @@
586 586 if (unlikely(csum))
587 587 tmp_csum = csum_sub(tmp_csum, csum_unfold(csum));
588 588  
589   - csum = csum_ipv6_magic(&fl->fl6_src,
590   - &fl->fl6_dst,
591   - total_len, fl->flowi_proto, tmp_csum);
  589 + csum = csum_ipv6_magic(&fl6->saddr, &fl6->daddr,
  590 + total_len, fl6->flowi6_proto, tmp_csum);
592 591  
593   - if (csum == 0 && fl->flowi_proto == IPPROTO_UDP)
  592 + if (csum == 0 && fl6->flowi6_proto == IPPROTO_UDP)
594 593 csum = CSUM_MANGLED_0;
595 594  
596 595 if (skb_store_bits(skb, offset, &csum, 2))
... ... @@ -603,7 +602,7 @@
603 602 }
604 603  
605 604 static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
606   - struct flowi *fl, struct dst_entry **dstp,
  605 + struct flowi6 *fl6, struct dst_entry **dstp,
607 606 unsigned int flags)
608 607 {
609 608 struct ipv6_pinfo *np = inet6_sk(sk);
... ... @@ -613,7 +612,7 @@
613 612 struct rt6_info *rt = (struct rt6_info *)*dstp;
614 613  
615 614 if (length > rt->dst.dev->mtu) {
616   - ipv6_local_error(sk, EMSGSIZE, fl, rt->dst.dev->mtu);
  615 + ipv6_local_error(sk, EMSGSIZE, fl6, rt->dst.dev->mtu);
617 616 return -EMSGSIZE;
618 617 }
619 618 if (flags&MSG_PROBE)
... ... @@ -662,7 +661,7 @@
662 661 return err;
663 662 }
664 663  
665   -static int rawv6_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
  664 +static int rawv6_probe_proto_opt(struct flowi6 *fl6, struct msghdr *msg)
666 665 {
667 666 struct iovec *iov;
668 667 u8 __user *type = NULL;
... ... @@ -679,7 +678,7 @@
679 678 if (!iov)
680 679 continue;
681 680  
682   - switch (fl->flowi_proto) {
  681 + switch (fl6->flowi6_proto) {
683 682 case IPPROTO_ICMPV6:
684 683 /* check if one-byte field is readable or not. */
685 684 if (iov->iov_base && iov->iov_len < 1)
... ... @@ -694,8 +693,8 @@
694 693 code = iov->iov_base;
695 694  
696 695 if (type && code) {
697   - if (get_user(fl->fl6_icmp_type, type) ||
698   - get_user(fl->fl6_icmp_code, code))
  696 + if (get_user(fl6->uli.icmpt.type, type) ||
  697 + get_user(fl6->uli.icmpt.code, code))
699 698 return -EFAULT;
700 699 probed = 1;
701 700 }
... ... @@ -706,7 +705,7 @@
706 705 /* check if type field is readable or not. */
707 706 if (iov->iov_len > 2 - len) {
708 707 u8 __user *p = iov->iov_base;
709   - if (get_user(fl->fl6_mh_type, &p[2 - len]))
  708 + if (get_user(fl6->uli.mht.type, &p[2 - len]))
710 709 return -EFAULT;
711 710 probed = 1;
712 711 } else
... ... @@ -735,7 +734,7 @@
735 734 struct ipv6_txoptions *opt = NULL;
736 735 struct ip6_flowlabel *flowlabel = NULL;
737 736 struct dst_entry *dst = NULL;
738   - struct flowi fl;
  737 + struct flowi6 fl6;
739 738 int addr_len = msg->msg_namelen;
740 739 int hlimit = -1;
741 740 int tclass = -1;
742 741  
... ... @@ -756,9 +755,9 @@
756 755 /*
757 756 * Get and verify the address.
758 757 */
759   - memset(&fl, 0, sizeof(fl));
  758 + memset(&fl6, 0, sizeof(fl6));
760 759  
761   - fl.flowi_mark = sk->sk_mark;
  760 + fl6.flowi6_mark = sk->sk_mark;
762 761  
763 762 if (sin6) {
764 763 if (addr_len < SIN6_LEN_RFC2133)
... ... @@ -780,9 +779,9 @@
780 779  
781 780 daddr = &sin6->sin6_addr;
782 781 if (np->sndflow) {
783   - fl.fl6_flowlabel = sin6->sin6_flowinfo&IPV6_FLOWINFO_MASK;
784   - if (fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) {
785   - flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
  782 + fl6.flowlabel = sin6->sin6_flowinfo&IPV6_FLOWINFO_MASK;
  783 + if (fl6.flowlabel&IPV6_FLOWLABEL_MASK) {
  784 + flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
786 785 if (flowlabel == NULL)
787 786 return -EINVAL;
788 787 daddr = &flowlabel->dst;
789 788  
790 789  
791 790  
792 791  
... ... @@ -800,32 +799,32 @@
800 799 if (addr_len >= sizeof(struct sockaddr_in6) &&
801 800 sin6->sin6_scope_id &&
802 801 ipv6_addr_type(daddr)&IPV6_ADDR_LINKLOCAL)
803   - fl.flowi_oif = sin6->sin6_scope_id;
  802 + fl6.flowi6_oif = sin6->sin6_scope_id;
804 803 } else {
805 804 if (sk->sk_state != TCP_ESTABLISHED)
806 805 return -EDESTADDRREQ;
807 806  
808 807 proto = inet->inet_num;
809 808 daddr = &np->daddr;
810   - fl.fl6_flowlabel = np->flow_label;
  809 + fl6.flowlabel = np->flow_label;
811 810 }
812 811  
813   - if (fl.flowi_oif == 0)
814   - fl.flowi_oif = sk->sk_bound_dev_if;
  812 + if (fl6.flowi6_oif == 0)
  813 + fl6.flowi6_oif = sk->sk_bound_dev_if;
815 814  
816 815 if (msg->msg_controllen) {
817 816 opt = &opt_space;
818 817 memset(opt, 0, sizeof(struct ipv6_txoptions));
819 818 opt->tot_len = sizeof(struct ipv6_txoptions);
820 819  
821   - err = datagram_send_ctl(sock_net(sk), msg, &fl, opt, &hlimit,
  820 + err = datagram_send_ctl(sock_net(sk), msg, &fl6, opt, &hlimit,
822 821 &tclass, &dontfrag);
823 822 if (err < 0) {
824 823 fl6_sock_release(flowlabel);
825 824 return err;
826 825 }
827   - if ((fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) && !flowlabel) {
828   - flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
  826 + if ((fl6.flowlabel&IPV6_FLOWLABEL_MASK) && !flowlabel) {
  827 + flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
829 828 if (flowlabel == NULL)
830 829 return -EINVAL;
831 830 }
832 831  
833 832  
834 833  
835 834  
836 835  
837 836  
... ... @@ -838,31 +837,31 @@
838 837 opt = fl6_merge_options(&opt_space, flowlabel, opt);
839 838 opt = ipv6_fixup_options(&opt_space, opt);
840 839  
841   - fl.flowi_proto = proto;
842   - err = rawv6_probe_proto_opt(&fl, msg);
  840 + fl6.flowi6_proto = proto;
  841 + err = rawv6_probe_proto_opt(&fl6, msg);
843 842 if (err)
844 843 goto out;
845 844  
846 845 if (!ipv6_addr_any(daddr))
847   - ipv6_addr_copy(&fl.fl6_dst, daddr);
  846 + ipv6_addr_copy(&fl6.daddr, daddr);
848 847 else
849   - fl.fl6_dst.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */
850   - if (ipv6_addr_any(&fl.fl6_src) && !ipv6_addr_any(&np->saddr))
851   - ipv6_addr_copy(&fl.fl6_src, &np->saddr);
  848 + fl6.daddr.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */
  849 + if (ipv6_addr_any(&fl6.saddr) && !ipv6_addr_any(&np->saddr))
  850 + ipv6_addr_copy(&fl6.saddr, &np->saddr);
852 851  
853   - final_p = fl6_update_dst(&fl, opt, &final);
  852 + final_p = fl6_update_dst(&fl6, opt, &final);
854 853  
855   - if (!fl.flowi_oif && ipv6_addr_is_multicast(&fl.fl6_dst))
856   - fl.flowi_oif = np->mcast_oif;
857   - security_sk_classify_flow(sk, &fl);
  854 + if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr))
  855 + fl6.flowi6_oif = np->mcast_oif;
  856 + security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
858 857  
859   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, true);
  858 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, true);
860 859 if (IS_ERR(dst)) {
861 860 err = PTR_ERR(dst);
862 861 goto out;
863 862 }
864 863 if (hlimit < 0) {
865   - if (ipv6_addr_is_multicast(&fl.fl6_dst))
  864 + if (ipv6_addr_is_multicast(&fl6.daddr))
866 865 hlimit = np->mcast_hops;
867 866 else
868 867 hlimit = np->hop_limit;
869 868  
870 869  
... ... @@ -881,17 +880,17 @@
881 880  
882 881 back_from_confirm:
883 882 if (inet->hdrincl)
884   - err = rawv6_send_hdrinc(sk, msg->msg_iov, len, &fl, &dst, msg->msg_flags);
  883 + err = rawv6_send_hdrinc(sk, msg->msg_iov, len, &fl6, &dst, msg->msg_flags);
885 884 else {
886 885 lock_sock(sk);
887 886 err = ip6_append_data(sk, ip_generic_getfrag, msg->msg_iov,
888   - len, 0, hlimit, tclass, opt, &fl, (struct rt6_info*)dst,
  887 + len, 0, hlimit, tclass, opt, &fl6, (struct rt6_info*)dst,
889 888 msg->msg_flags, dontfrag);
890 889  
891 890 if (err)
892 891 ip6_flush_pending_frames(sk);
893 892 else if (!(msg->msg_flags & MSG_MORE))
894   - err = rawv6_push_pending_frames(sk, &fl, rp);
  893 + err = rawv6_push_pending_frames(sk, &fl6, rp);
895 894 release_sock(sk);
896 895 }
897 896 done:
... ... @@ -599,17 +599,17 @@
599 599  
600 600 static struct rt6_info *ip6_pol_route_lookup(struct net *net,
601 601 struct fib6_table *table,
602   - struct flowi *fl, int flags)
  602 + struct flowi6 *fl6, int flags)
603 603 {
604 604 struct fib6_node *fn;
605 605 struct rt6_info *rt;
606 606  
607 607 read_lock_bh(&table->tb6_lock);
608   - fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
  608 + fn = fib6_lookup(&table->tb6_root, &fl6->daddr, &fl6->saddr);
609 609 restart:
610 610 rt = fn->leaf;
611   - rt = rt6_device_match(net, rt, &fl->fl6_src, fl->flowi_oif, flags);
612   - BACKTRACK(net, &fl->fl6_src);
  611 + rt = rt6_device_match(net, rt, &fl6->saddr, fl6->flowi6_oif, flags);
  612 + BACKTRACK(net, &fl6->saddr);
613 613 out:
614 614 dst_use(&rt->dst, jiffies);
615 615 read_unlock_bh(&table->tb6_lock);
616 616  
617 617  
... ... @@ -620,19 +620,19 @@
620 620 struct rt6_info *rt6_lookup(struct net *net, const struct in6_addr *daddr,
621 621 const struct in6_addr *saddr, int oif, int strict)
622 622 {
623   - struct flowi fl = {
624   - .flowi_oif = oif,
625   - .fl6_dst = *daddr,
  623 + struct flowi6 fl6 = {
  624 + .flowi6_oif = oif,
  625 + .daddr = *daddr,
626 626 };
627 627 struct dst_entry *dst;
628 628 int flags = strict ? RT6_LOOKUP_F_IFACE : 0;
629 629  
630 630 if (saddr) {
631   - memcpy(&fl.fl6_src, saddr, sizeof(*saddr));
  631 + memcpy(&fl6.saddr, saddr, sizeof(*saddr));
632 632 flags |= RT6_LOOKUP_F_HAS_SADDR;
633 633 }
634 634  
635   - dst = fib6_rule_lookup(net, &fl, flags, ip6_pol_route_lookup);
  635 + dst = fib6_rule_lookup(net, &fl6, flags, ip6_pol_route_lookup);
636 636 if (dst->error == 0)
637 637 return (struct rt6_info *) dst;
638 638  
... ... @@ -753,7 +753,7 @@
753 753 }
754 754  
755 755 static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, int oif,
756   - struct flowi *fl, int flags)
  756 + struct flowi6 *fl6, int flags)
757 757 {
758 758 struct fib6_node *fn;
759 759 struct rt6_info *rt, *nrt;
760 760  
... ... @@ -768,12 +768,12 @@
768 768 read_lock_bh(&table->tb6_lock);
769 769  
770 770 restart_2:
771   - fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
  771 + fn = fib6_lookup(&table->tb6_root, &fl6->daddr, &fl6->saddr);
772 772  
773 773 restart:
774 774 rt = rt6_select(fn, oif, strict | reachable);
775 775  
776   - BACKTRACK(net, &fl->fl6_src);
  776 + BACKTRACK(net, &fl6->saddr);
777 777 if (rt == net->ipv6.ip6_null_entry ||
778 778 rt->rt6i_flags & RTF_CACHE)
779 779 goto out;
780 780  
... ... @@ -782,9 +782,9 @@
782 782 read_unlock_bh(&table->tb6_lock);
783 783  
784 784 if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP))
785   - nrt = rt6_alloc_cow(rt, &fl->fl6_dst, &fl->fl6_src);
  785 + nrt = rt6_alloc_cow(rt, &fl6->daddr, &fl6->saddr);
786 786 else if (!(rt->dst.flags & DST_HOST))
787   - nrt = rt6_alloc_clone(rt, &fl->fl6_dst);
  787 + nrt = rt6_alloc_clone(rt, &fl6->daddr);
788 788 else
789 789 goto out2;
790 790  
791 791  
... ... @@ -823,9 +823,9 @@
823 823 }
824 824  
825 825 static struct rt6_info *ip6_pol_route_input(struct net *net, struct fib6_table *table,
826   - struct flowi *fl, int flags)
  826 + struct flowi6 *fl6, int flags)
827 827 {
828   - return ip6_pol_route(net, table, fl->flowi_iif, fl, flags);
  828 + return ip6_pol_route(net, table, fl6->flowi6_iif, fl6, flags);
829 829 }
830 830  
831 831 void ip6_route_input(struct sk_buff *skb)
832 832  
833 833  
834 834  
835 835  
836 836  
837 837  
838 838  
... ... @@ -833,41 +833,41 @@
833 833 struct ipv6hdr *iph = ipv6_hdr(skb);
834 834 struct net *net = dev_net(skb->dev);
835 835 int flags = RT6_LOOKUP_F_HAS_SADDR;
836   - struct flowi fl = {
837   - .flowi_iif = skb->dev->ifindex,
838   - .fl6_dst = iph->daddr,
839   - .fl6_src = iph->saddr,
840   - .fl6_flowlabel = (* (__be32 *) iph)&IPV6_FLOWINFO_MASK,
841   - .flowi_mark = skb->mark,
842   - .flowi_proto = iph->nexthdr,
  836 + struct flowi6 fl6 = {
  837 + .flowi6_iif = skb->dev->ifindex,
  838 + .daddr = iph->daddr,
  839 + .saddr = iph->saddr,
  840 + .flowlabel = (* (__be32 *) iph)&IPV6_FLOWINFO_MASK,
  841 + .flowi6_mark = skb->mark,
  842 + .flowi6_proto = iph->nexthdr,
843 843 };
844 844  
845 845 if (rt6_need_strict(&iph->daddr) && skb->dev->type != ARPHRD_PIMREG)
846 846 flags |= RT6_LOOKUP_F_IFACE;
847 847  
848   - skb_dst_set(skb, fib6_rule_lookup(net, &fl, flags, ip6_pol_route_input));
  848 + skb_dst_set(skb, fib6_rule_lookup(net, &fl6, flags, ip6_pol_route_input));
849 849 }
850 850  
851 851 static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table,
852   - struct flowi *fl, int flags)
  852 + struct flowi6 *fl6, int flags)
853 853 {
854   - return ip6_pol_route(net, table, fl->flowi_oif, fl, flags);
  854 + return ip6_pol_route(net, table, fl6->flowi6_oif, fl6, flags);
855 855 }
856 856  
857 857 struct dst_entry * ip6_route_output(struct net *net, struct sock *sk,
858   - struct flowi *fl)
  858 + struct flowi6 *fl6)
859 859 {
860 860 int flags = 0;
861 861  
862   - if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl->fl6_dst))
  862 + if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr))
863 863 flags |= RT6_LOOKUP_F_IFACE;
864 864  
865   - if (!ipv6_addr_any(&fl->fl6_src))
  865 + if (!ipv6_addr_any(&fl6->saddr))
866 866 flags |= RT6_LOOKUP_F_HAS_SADDR;
867 867 else if (sk)
868 868 flags |= rt6_srcprefs2flags(inet6_sk(sk)->srcprefs);
869 869  
870   - return fib6_rule_lookup(net, fl, flags, ip6_pol_route_output);
  870 + return fib6_rule_lookup(net, fl6, flags, ip6_pol_route_output);
871 871 }
872 872  
873 873 EXPORT_SYMBOL(ip6_route_output);
874 874  
875 875  
... ... @@ -1444,16 +1444,16 @@
1444 1444 * Handle redirects
1445 1445 */
1446 1446 struct ip6rd_flowi {
1447   - struct flowi fl;
  1447 + struct flowi6 fl6;
1448 1448 struct in6_addr gateway;
1449 1449 };
1450 1450  
1451 1451 static struct rt6_info *__ip6_route_redirect(struct net *net,
1452 1452 struct fib6_table *table,
1453   - struct flowi *fl,
  1453 + struct flowi6 *fl6,
1454 1454 int flags)
1455 1455 {
1456   - struct ip6rd_flowi *rdfl = (struct ip6rd_flowi *)fl;
  1456 + struct ip6rd_flowi *rdfl = (struct ip6rd_flowi *)fl6;
1457 1457 struct rt6_info *rt;
1458 1458 struct fib6_node *fn;
1459 1459  
... ... @@ -1469,7 +1469,7 @@
1469 1469 */
1470 1470  
1471 1471 read_lock_bh(&table->tb6_lock);
1472   - fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
  1472 + fn = fib6_lookup(&table->tb6_root, &fl6->daddr, &fl6->saddr);
1473 1473 restart:
1474 1474 for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) {
1475 1475 /*
... ... @@ -1484,7 +1484,7 @@
1484 1484 continue;
1485 1485 if (!(rt->rt6i_flags & RTF_GATEWAY))
1486 1486 continue;
1487   - if (fl->flowi_oif != rt->rt6i_dev->ifindex)
  1487 + if (fl6->flowi6_oif != rt->rt6i_dev->ifindex)
1488 1488 continue;
1489 1489 if (!ipv6_addr_equal(&rdfl->gateway, &rt->rt6i_gateway))
1490 1490 continue;
... ... @@ -1493,7 +1493,7 @@
1493 1493  
1494 1494 if (!rt)
1495 1495 rt = net->ipv6.ip6_null_entry;
1496   - BACKTRACK(net, &fl->fl6_src);
  1496 + BACKTRACK(net, &fl6->saddr);
1497 1497 out:
1498 1498 dst_hold(&rt->dst);
1499 1499  
... ... @@ -1510,10 +1510,10 @@
1510 1510 int flags = RT6_LOOKUP_F_HAS_SADDR;
1511 1511 struct net *net = dev_net(dev);
1512 1512 struct ip6rd_flowi rdfl = {
1513   - .fl = {
1514   - .flowi_oif = dev->ifindex,
1515   - .fl6_dst = *dest,
1516   - .fl6_src = *src,
  1513 + .fl6 = {
  1514 + .flowi6_oif = dev->ifindex,
  1515 + .daddr = *dest,
  1516 + .saddr = *src,
1517 1517 },
1518 1518 };
1519 1519  
... ... @@ -1522,7 +1522,7 @@
1522 1522 if (rt6_need_strict(dest))
1523 1523 flags |= RT6_LOOKUP_F_IFACE;
1524 1524  
1525   - return (struct rt6_info *)fib6_rule_lookup(net, (struct flowi *)&rdfl,
  1525 + return (struct rt6_info *)fib6_rule_lookup(net, &rdfl.fl6,
1526 1526 flags, __ip6_route_redirect);
1527 1527 }
1528 1528  
... ... @@ -2385,7 +2385,7 @@
2385 2385 struct rt6_info *rt;
2386 2386 struct sk_buff *skb;
2387 2387 struct rtmsg *rtm;
2388   - struct flowi fl;
  2388 + struct flowi6 fl6;
2389 2389 int err, iif = 0;
2390 2390  
2391 2391 err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy);
2392 2392  
2393 2393  
2394 2394  
... ... @@ -2393,27 +2393,27 @@
2393 2393 goto errout;
2394 2394  
2395 2395 err = -EINVAL;
2396   - memset(&fl, 0, sizeof(fl));
  2396 + memset(&fl6, 0, sizeof(fl6));
2397 2397  
2398 2398 if (tb[RTA_SRC]) {
2399 2399 if (nla_len(tb[RTA_SRC]) < sizeof(struct in6_addr))
2400 2400 goto errout;
2401 2401  
2402   - ipv6_addr_copy(&fl.fl6_src, nla_data(tb[RTA_SRC]));
  2402 + ipv6_addr_copy(&fl6.saddr, nla_data(tb[RTA_SRC]));
2403 2403 }
2404 2404  
2405 2405 if (tb[RTA_DST]) {
2406 2406 if (nla_len(tb[RTA_DST]) < sizeof(struct in6_addr))
2407 2407 goto errout;
2408 2408  
2409   - ipv6_addr_copy(&fl.fl6_dst, nla_data(tb[RTA_DST]));
  2409 + ipv6_addr_copy(&fl6.daddr, nla_data(tb[RTA_DST]));
2410 2410 }
2411 2411  
2412 2412 if (tb[RTA_IIF])
2413 2413 iif = nla_get_u32(tb[RTA_IIF]);
2414 2414  
2415 2415 if (tb[RTA_OIF])
2416   - fl.flowi_oif = nla_get_u32(tb[RTA_OIF]);
  2416 + fl6.flowi6_oif = nla_get_u32(tb[RTA_OIF]);
2417 2417  
2418 2418 if (iif) {
2419 2419 struct net_device *dev;
2420 2420  
... ... @@ -2436,10 +2436,10 @@
2436 2436 skb_reset_mac_header(skb);
2437 2437 skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr));
2438 2438  
2439   - rt = (struct rt6_info*) ip6_route_output(net, NULL, &fl);
  2439 + rt = (struct rt6_info*) ip6_route_output(net, NULL, &fl6);
2440 2440 skb_dst_set(skb, &rt->dst);
2441 2441  
2442   - err = rt6_fill_node(net, skb, rt, &fl.fl6_dst, &fl.fl6_src, iif,
  2442 + err = rt6_fill_node(net, skb, rt, &fl6.daddr, &fl6.saddr, iif,
2443 2443 RTM_NEWROUTE, NETLINK_CB(in_skb).pid,
2444 2444 nlh->nlmsg_seq, 0, 0, 0);
2445 2445 if (err < 0) {
net/ipv6/syncookies.c
... ... @@ -232,19 +232,19 @@
232 232 */
233 233 {
234 234 struct in6_addr *final_p, final;
235   - struct flowi fl;
236   - memset(&fl, 0, sizeof(fl));
237   - fl.flowi_proto = IPPROTO_TCP;
238   - ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
239   - final_p = fl6_update_dst(&fl, np->opt, &final);
240   - ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
241   - fl.flowi_oif = sk->sk_bound_dev_if;
242   - fl.flowi_mark = sk->sk_mark;
243   - fl.fl6_dport = inet_rsk(req)->rmt_port;
244   - fl.fl6_sport = inet_sk(sk)->inet_sport;
245   - security_req_classify_flow(req, &fl);
  235 + struct flowi6 fl6;
  236 + memset(&fl6, 0, sizeof(fl6));
  237 + fl6.flowi6_proto = IPPROTO_TCP;
  238 + ipv6_addr_copy(&fl6.daddr, &ireq6->rmt_addr);
  239 + final_p = fl6_update_dst(&fl6, np->opt, &final);
  240 + ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr);
  241 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  242 + fl6.flowi6_mark = sk->sk_mark;
  243 + fl6.uli.ports.dport = inet_rsk(req)->rmt_port;
  244 + fl6.uli.ports.sport = inet_sk(sk)->inet_sport;
  245 + security_req_classify_flow(req, flowi6_to_flowi(&fl6));
246 246  
247   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
  247 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
248 248 if (IS_ERR(dst))
249 249 goto out_free;
250 250 }
... ... @@ -131,7 +131,7 @@
131 131 struct tcp_sock *tp = tcp_sk(sk);
132 132 struct in6_addr *saddr = NULL, *final_p, final;
133 133 struct rt6_info *rt;
134   - struct flowi fl;
  134 + struct flowi6 fl6;
135 135 struct dst_entry *dst;
136 136 int addr_type;
137 137 int err;
138 138  
139 139  
... ... @@ -142,14 +142,14 @@
142 142 if (usin->sin6_family != AF_INET6)
143 143 return -EAFNOSUPPORT;
144 144  
145   - memset(&fl, 0, sizeof(fl));
  145 + memset(&fl6, 0, sizeof(fl6));
146 146  
147 147 if (np->sndflow) {
148   - fl.fl6_flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK;
149   - IP6_ECN_flow_init(fl.fl6_flowlabel);
150   - if (fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) {
  148 + fl6.flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK;
  149 + IP6_ECN_flow_init(fl6.flowlabel);
  150 + if (fl6.flowlabel&IPV6_FLOWLABEL_MASK) {
151 151 struct ip6_flowlabel *flowlabel;
152   - flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
  152 + flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
153 153 if (flowlabel == NULL)
154 154 return -EINVAL;
155 155 ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
... ... @@ -195,7 +195,7 @@
195 195 }
196 196  
197 197 ipv6_addr_copy(&np->daddr, &usin->sin6_addr);
198   - np->flow_label = fl.fl6_flowlabel;
  198 + np->flow_label = fl6.flowlabel;
199 199  
200 200 /*
201 201 * TCP over IPv4
202 202  
203 203  
204 204  
205 205  
206 206  
... ... @@ -242,27 +242,27 @@
242 242 if (!ipv6_addr_any(&np->rcv_saddr))
243 243 saddr = &np->rcv_saddr;
244 244  
245   - fl.flowi_proto = IPPROTO_TCP;
246   - ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
247   - ipv6_addr_copy(&fl.fl6_src,
  245 + fl6.flowi6_proto = IPPROTO_TCP;
  246 + ipv6_addr_copy(&fl6.daddr, &np->daddr);
  247 + ipv6_addr_copy(&fl6.saddr,
248 248 (saddr ? saddr : &np->saddr));
249   - fl.flowi_oif = sk->sk_bound_dev_if;
250   - fl.flowi_mark = sk->sk_mark;
251   - fl.fl6_dport = usin->sin6_port;
252   - fl.fl6_sport = inet->inet_sport;
  249 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  250 + fl6.flowi6_mark = sk->sk_mark;
  251 + fl6.uli.ports.dport = usin->sin6_port;
  252 + fl6.uli.ports.sport = inet->inet_sport;
253 253  
254   - final_p = fl6_update_dst(&fl, np->opt, &final);
  254 + final_p = fl6_update_dst(&fl6, np->opt, &final);
255 255  
256   - security_sk_classify_flow(sk, &fl);
  256 + security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
257 257  
258   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, true);
  258 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, true);
259 259 if (IS_ERR(dst)) {
260 260 err = PTR_ERR(dst);
261 261 goto failure;
262 262 }
263 263  
264 264 if (saddr == NULL) {
265   - saddr = &fl.fl6_src;
  265 + saddr = &fl6.saddr;
266 266 ipv6_addr_copy(&np->rcv_saddr, saddr);
267 267 }
268 268  
269 269  
270 270  
... ... @@ -389,23 +389,23 @@
389 389  
390 390 if (dst == NULL) {
391 391 struct inet_sock *inet = inet_sk(sk);
392   - struct flowi fl;
  392 + struct flowi6 fl6;
393 393  
394 394 /* BUGGG_FUTURE: Again, it is not clear how
395 395 to handle rthdr case. Ignore this complexity
396 396 for now.
397 397 */
398   - memset(&fl, 0, sizeof(fl));
399   - fl.flowi_proto = IPPROTO_TCP;
400   - ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
401   - ipv6_addr_copy(&fl.fl6_src, &np->saddr);
402   - fl.flowi_oif = sk->sk_bound_dev_if;
403   - fl.flowi_mark = sk->sk_mark;
404   - fl.fl6_dport = inet->inet_dport;
405   - fl.fl6_sport = inet->inet_sport;
406   - security_skb_classify_flow(skb, &fl);
  398 + memset(&fl6, 0, sizeof(fl6));
  399 + fl6.flowi6_proto = IPPROTO_TCP;
  400 + ipv6_addr_copy(&fl6.daddr, &np->daddr);
  401 + ipv6_addr_copy(&fl6.saddr, &np->saddr);
  402 + fl6.flowi6_oif = sk->sk_bound_dev_if;
  403 + fl6.flowi6_mark = sk->sk_mark;
  404 + fl6.uli.ports.dport = inet->inet_dport;
  405 + fl6.uli.ports.sport = inet->inet_sport;
  406 + security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
407 407  
408   - dst = ip6_dst_lookup_flow(sk, &fl, NULL, false);
  408 + dst = ip6_dst_lookup_flow(sk, &fl6, NULL, false);
409 409 if (IS_ERR(dst)) {
410 410 sk->sk_err_soft = -PTR_ERR(dst);
411 411 goto out;
412 412  
413 413  
414 414  
... ... @@ -482,25 +482,25 @@
482 482 struct sk_buff * skb;
483 483 struct ipv6_txoptions *opt = NULL;
484 484 struct in6_addr * final_p, final;
485   - struct flowi fl;
  485 + struct flowi6 fl6;
486 486 struct dst_entry *dst;
487 487 int err;
488 488  
489   - memset(&fl, 0, sizeof(fl));
490   - fl.flowi_proto = IPPROTO_TCP;
491   - ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr);
492   - ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr);
493   - fl.fl6_flowlabel = 0;
494   - fl.flowi_oif = treq->iif;
495   - fl.flowi_mark = sk->sk_mark;
496   - fl.fl6_dport = inet_rsk(req)->rmt_port;
497   - fl.fl6_sport = inet_rsk(req)->loc_port;
498   - security_req_classify_flow(req, &fl);
  489 + memset(&fl6, 0, sizeof(fl6));
  490 + fl6.flowi6_proto = IPPROTO_TCP;
  491 + ipv6_addr_copy(&fl6.daddr, &treq->rmt_addr);
  492 + ipv6_addr_copy(&fl6.saddr, &treq->loc_addr);
  493 + fl6.flowlabel = 0;
  494 + fl6.flowi6_oif = treq->iif;
  495 + fl6.flowi6_mark = sk->sk_mark;
  496 + fl6.uli.ports.dport = inet_rsk(req)->rmt_port;
  497 + fl6.uli.ports.sport = inet_rsk(req)->loc_port;
  498 + security_req_classify_flow(req, flowi6_to_flowi(&fl6));
499 499  
500 500 opt = np->opt;
501   - final_p = fl6_update_dst(&fl, opt, &final);
  501 + final_p = fl6_update_dst(&fl6, opt, &final);
502 502  
503   - dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
  503 + dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
504 504 if (IS_ERR(dst)) {
505 505 err = PTR_ERR(dst);
506 506 goto done;
... ... @@ -510,8 +510,8 @@
510 510 if (skb) {
511 511 __tcp_v6_send_check(skb, &treq->loc_addr, &treq->rmt_addr);
512 512  
513   - ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr);
514   - err = ip6_xmit(sk, skb, &fl, opt);
  513 + ipv6_addr_copy(&fl6.daddr, &treq->rmt_addr);
  514 + err = ip6_xmit(sk, skb, &fl6, opt);
515 515 err = net_xmit_eval(err);
516 516 }
517 517  
... ... @@ -992,7 +992,7 @@
992 992 {
993 993 struct tcphdr *th = tcp_hdr(skb), *t1;
994 994 struct sk_buff *buff;
995   - struct flowi fl;
  995 + struct flowi6 fl6;
996 996 struct net *net = dev_net(skb_dst(skb)->dev);
997 997 struct sock *ctl_sk = net->ipv6.tcp_sk;
998 998 unsigned int tot_len = sizeof(struct tcphdr);
999 999  
1000 1000  
1001 1001  
1002 1002  
... ... @@ -1046,29 +1046,29 @@
1046 1046 }
1047 1047 #endif
1048 1048  
1049   - memset(&fl, 0, sizeof(fl));
1050   - ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr);
1051   - ipv6_addr_copy(&fl.fl6_src, &ipv6_hdr(skb)->daddr);
  1049 + memset(&fl6, 0, sizeof(fl6));
  1050 + ipv6_addr_copy(&fl6.daddr, &ipv6_hdr(skb)->saddr);
  1051 + ipv6_addr_copy(&fl6.saddr, &ipv6_hdr(skb)->daddr);
1052 1052  
1053 1053 buff->ip_summed = CHECKSUM_PARTIAL;
1054 1054 buff->csum = 0;
1055 1055  
1056   - __tcp_v6_send_check(buff, &fl.fl6_src, &fl.fl6_dst);
  1056 + __tcp_v6_send_check(buff, &fl6.saddr, &fl6.daddr);
1057 1057  
1058   - fl.flowi_proto = IPPROTO_TCP;
1059   - fl.flowi_oif = inet6_iif(skb);
1060   - fl.fl6_dport = t1->dest;
1061   - fl.fl6_sport = t1->source;
1062   - security_skb_classify_flow(skb, &fl);
  1058 + fl6.flowi6_proto = IPPROTO_TCP;
  1059 + fl6.flowi6_oif = inet6_iif(skb);
  1060 + fl6.uli.ports.dport = t1->dest;
  1061 + fl6.uli.ports.sport = t1->source;
  1062 + security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
1063 1063  
1064 1064 /* Pass a socket to ip6_dst_lookup either it is for RST
1065 1065 * Underlying function will use this to retrieve the network
1066 1066 * namespace
1067 1067 */
1068   - dst = ip6_dst_lookup_flow(ctl_sk, &fl, NULL, false);
  1068 + dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL, false);
1069 1069 if (!IS_ERR(dst)) {
1070 1070 skb_dst_set(buff, dst);
1071   - ip6_xmit(ctl_sk, buff, &fl, NULL);
  1071 + ip6_xmit(ctl_sk, buff, &fl6, NULL);
1072 1072 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
1073 1073 if (rst)
1074 1074 TCP_INC_STATS_BH(net, TCP_MIB_OUTRSTS);
... ... @@ -886,7 +886,7 @@
886 886 struct udphdr *uh;
887 887 struct udp_sock *up = udp_sk(sk);
888 888 struct inet_sock *inet = inet_sk(sk);
889   - struct flowi *fl = &inet->cork.fl;
  889 + struct flowi6 *fl6 = &inet->cork.fl.u.ip6;
890 890 int err = 0;
891 891 int is_udplite = IS_UDPLITE(sk);
892 892 __wsum csum = 0;
893 893  
894 894  
... ... @@ -899,23 +899,23 @@
899 899 * Create a UDP header
900 900 */
901 901 uh = udp_hdr(skb);
902   - uh->source = fl->fl6_sport;
903   - uh->dest = fl->fl6_dport;
  902 + uh->source = fl6->uli.ports.sport;
  903 + uh->dest = fl6->uli.ports.dport;
904 904 uh->len = htons(up->len);
905 905 uh->check = 0;
906 906  
907 907 if (is_udplite)
908 908 csum = udplite_csum_outgoing(sk, skb);
909 909 else if (skb->ip_summed == CHECKSUM_PARTIAL) { /* UDP hardware csum */
910   - udp6_hwcsum_outgoing(sk, skb, &fl->fl6_src, &fl->fl6_dst,
  910 + udp6_hwcsum_outgoing(sk, skb, &fl6->saddr, &fl6->daddr,
911 911 up->len);
912 912 goto send;
913 913 } else
914 914 csum = udp_csum_outgoing(sk, skb);
915 915  
916 916 /* add protocol-dependent pseudo-header */
917   - uh->check = csum_ipv6_magic(&fl->fl6_src, &fl->fl6_dst,
918   - up->len, fl->flowi_proto, csum);
  917 + uh->check = csum_ipv6_magic(&fl6->saddr, &fl6->daddr,
  918 + up->len, fl6->flowi6_proto, csum);
919 919 if (uh->check == 0)
920 920 uh->check = CSUM_MANGLED_0;
921 921  
... ... @@ -947,7 +947,7 @@
947 947 struct in6_addr *daddr, *final_p, final;
948 948 struct ipv6_txoptions *opt = NULL;
949 949 struct ip6_flowlabel *flowlabel = NULL;
950   - struct flowi fl;
  950 + struct flowi6 fl6;
951 951 struct dst_entry *dst;
952 952 int addr_len = msg->msg_namelen;
953 953 int ulen = len;
954 954  
955 955  
... ... @@ -1030,19 +1030,19 @@
1030 1030 }
1031 1031 ulen += sizeof(struct udphdr);
1032 1032  
1033   - memset(&fl, 0, sizeof(fl));
  1033 + memset(&fl6, 0, sizeof(fl6));
1034 1034  
1035 1035 if (sin6) {
1036 1036 if (sin6->sin6_port == 0)
1037 1037 return -EINVAL;
1038 1038  
1039   - fl.fl6_dport = sin6->sin6_port;
  1039 + fl6.uli.ports.dport = sin6->sin6_port;
1040 1040 daddr = &sin6->sin6_addr;
1041 1041  
1042 1042 if (np->sndflow) {
1043   - fl.fl6_flowlabel = sin6->sin6_flowinfo&IPV6_FLOWINFO_MASK;
1044   - if (fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) {
1045   - flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
  1043 + fl6.flowlabel = sin6->sin6_flowinfo&IPV6_FLOWINFO_MASK;
  1044 + if (fl6.flowlabel&IPV6_FLOWLABEL_MASK) {
  1045 + flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
1046 1046 if (flowlabel == NULL)
1047 1047 return -EINVAL;
1048 1048 daddr = &flowlabel->dst;
1049 1049  
1050 1050  
1051 1051  
1052 1052  
1053 1053  
1054 1054  
1055 1055  
... ... @@ -1060,38 +1060,38 @@
1060 1060 if (addr_len >= sizeof(struct sockaddr_in6) &&
1061 1061 sin6->sin6_scope_id &&
1062 1062 ipv6_addr_type(daddr)&IPV6_ADDR_LINKLOCAL)
1063   - fl.flowi_oif = sin6->sin6_scope_id;
  1063 + fl6.flowi6_oif = sin6->sin6_scope_id;
1064 1064 } else {
1065 1065 if (sk->sk_state != TCP_ESTABLISHED)
1066 1066 return -EDESTADDRREQ;
1067 1067  
1068   - fl.fl6_dport = inet->inet_dport;
  1068 + fl6.uli.ports.dport = inet->inet_dport;
1069 1069 daddr = &np->daddr;
1070   - fl.fl6_flowlabel = np->flow_label;
  1070 + fl6.flowlabel = np->flow_label;
1071 1071 connected = 1;
1072 1072 }
1073 1073  
1074   - if (!fl.flowi_oif)
1075   - fl.flowi_oif = sk->sk_bound_dev_if;
  1074 + if (!fl6.flowi6_oif)
  1075 + fl6.flowi6_oif = sk->sk_bound_dev_if;
1076 1076  
1077   - if (!fl.flowi_oif)
1078   - fl.flowi_oif = np->sticky_pktinfo.ipi6_ifindex;
  1077 + if (!fl6.flowi6_oif)
  1078 + fl6.flowi6_oif = np->sticky_pktinfo.ipi6_ifindex;
1079 1079  
1080   - fl.flowi_mark = sk->sk_mark;
  1080 + fl6.flowi6_mark = sk->sk_mark;
1081 1081  
1082 1082 if (msg->msg_controllen) {
1083 1083 opt = &opt_space;
1084 1084 memset(opt, 0, sizeof(struct ipv6_txoptions));
1085 1085 opt->tot_len = sizeof(*opt);
1086 1086  
1087   - err = datagram_send_ctl(sock_net(sk), msg, &fl, opt, &hlimit,
  1087 + err = datagram_send_ctl(sock_net(sk), msg, &fl6, opt, &hlimit,
1088 1088 &tclass, &dontfrag);
1089 1089 if (err < 0) {
1090 1090 fl6_sock_release(flowlabel);
1091 1091 return err;
1092 1092 }
1093   - if ((fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) && !flowlabel) {
1094   - flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
  1093 + if ((fl6.flowlabel&IPV6_FLOWLABEL_MASK) && !flowlabel) {
  1094 + flowlabel = fl6_sock_lookup(sk, fl6.flowlabel);
1095 1095 if (flowlabel == NULL)
1096 1096 return -EINVAL;
1097 1097 }
1098 1098  
1099 1099  
1100 1100  
1101 1101  
1102 1102  
1103 1103  
... ... @@ -1105,27 +1105,27 @@
1105 1105 opt = fl6_merge_options(&opt_space, flowlabel, opt);
1106 1106 opt = ipv6_fixup_options(&opt_space, opt);
1107 1107  
1108   - fl.flowi_proto = sk->sk_protocol;
  1108 + fl6.flowi6_proto = sk->sk_protocol;
1109 1109 if (!ipv6_addr_any(daddr))
1110   - ipv6_addr_copy(&fl.fl6_dst, daddr);
  1110 + ipv6_addr_copy(&fl6.daddr, daddr);
1111 1111 else
1112   - fl.fl6_dst.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */
1113   - if (ipv6_addr_any(&fl.fl6_src) && !ipv6_addr_any(&np->saddr))
1114   - ipv6_addr_copy(&fl.fl6_src, &np->saddr);
1115   - fl.fl6_sport = inet->inet_sport;
  1112 + fl6.daddr.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */
  1113 + if (ipv6_addr_any(&fl6.saddr) && !ipv6_addr_any(&np->saddr))
  1114 + ipv6_addr_copy(&fl6.saddr, &np->saddr);
  1115 + fl6.uli.ports.sport = inet->inet_sport;
1116 1116  
1117   - final_p = fl6_update_dst(&fl, opt, &final);
  1117 + final_p = fl6_update_dst(&fl6, opt, &final);
1118 1118 if (final_p)
1119 1119 connected = 0;
1120 1120  
1121   - if (!fl.flowi_oif && ipv6_addr_is_multicast(&fl.fl6_dst)) {
1122   - fl.flowi_oif = np->mcast_oif;
  1121 + if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr)) {
  1122 + fl6.flowi6_oif = np->mcast_oif;
1123 1123 connected = 0;
1124 1124 }
1125 1125  
1126   - security_sk_classify_flow(sk, &fl);
  1126 + security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
1127 1127  
1128   - dst = ip6_sk_dst_lookup_flow(sk, &fl, final_p, true);
  1128 + dst = ip6_sk_dst_lookup_flow(sk, &fl6, final_p, true);
1129 1129 if (IS_ERR(dst)) {
1130 1130 err = PTR_ERR(dst);
1131 1131 dst = NULL;
... ... @@ -1133,7 +1133,7 @@
1133 1133 }
1134 1134  
1135 1135 if (hlimit < 0) {
1136   - if (ipv6_addr_is_multicast(&fl.fl6_dst))
  1136 + if (ipv6_addr_is_multicast(&fl6.daddr))
1137 1137 hlimit = np->mcast_hops;
1138 1138 else
1139 1139 hlimit = np->hop_limit;
... ... @@ -1168,7 +1168,7 @@
1168 1168 up->len += ulen;
1169 1169 getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag;
1170 1170 err = ip6_append_data(sk, getfrag, msg->msg_iov, ulen,
1171   - sizeof(struct udphdr), hlimit, tclass, opt, &fl,
  1171 + sizeof(struct udphdr), hlimit, tclass, opt, &fl6,
1172 1172 (struct rt6_info*)dst,
1173 1173 corkreq ? msg->msg_flags|MSG_MORE : msg->msg_flags, dontfrag);
1174 1174 if (err)
1175 1175  
... ... @@ -1181,10 +1181,10 @@
1181 1181 if (dst) {
1182 1182 if (connected) {
1183 1183 ip6_dst_store(sk, dst,
1184   - ipv6_addr_equal(&fl.fl6_dst, &np->daddr) ?
  1184 + ipv6_addr_equal(&fl6.daddr, &np->daddr) ?
1185 1185 &np->daddr : NULL,
1186 1186 #ifdef CONFIG_IPV6_SUBTREES
1187   - ipv6_addr_equal(&fl.fl6_src, &np->saddr) ?
  1187 + ipv6_addr_equal(&fl6.saddr, &np->saddr) ?
1188 1188 &np->saddr :
1189 1189 #endif
1190 1190 NULL);
net/ipv6/xfrm6_policy.c
... ... @@ -39,8 +39,7 @@
39 39 if (saddr)
40 40 memcpy(&fl6.saddr, saddr, sizeof(fl6.saddr));
41 41  
42   - dst = ip6_route_output(net, NULL,
43   - flowi6_to_flowi(&fl6));
  42 + dst = ip6_route_output(net, NULL, &fl6);
44 43  
45 44 err = dst->error;
46 45 if (dst->error) {
net/netfilter/ipvs/ip_vs_ctl.c
... ... @@ -75,15 +75,13 @@
75 75 const struct in6_addr *addr)
76 76 {
77 77 struct rt6_info *rt;
78   - struct flowi fl = {
79   - .flowi_oif = 0,
80   - .fl6_dst = *addr,
81   - .fl6_src = { .s6_addr32 = {0, 0, 0, 0} },
  78 + struct flowi6 fl6 = {
  79 + .daddr = *addr,
82 80 };
83 81  
84   - rt = (struct rt6_info *)ip6_route_output(net, NULL, &fl);
  82 + rt = (struct rt6_info *)ip6_route_output(net, NULL, &fl6);
85 83 if (rt && rt->rt6i_dev && (rt->rt6i_dev->flags & IFF_LOOPBACK))
86   - return 1;
  84 + return 1;
87 85  
88 86 return 0;
89 87 }
net/netfilter/ipvs/ip_vs_xmit.c
... ... @@ -198,27 +198,27 @@
198 198 struct in6_addr *ret_saddr, int do_xfrm)
199 199 {
200 200 struct dst_entry *dst;
201   - struct flowi fl = {
202   - .fl6_dst = *daddr,
  201 + struct flowi6 fl6 = {
  202 + .daddr = *daddr,
203 203 };
204 204  
205   - dst = ip6_route_output(net, NULL, &fl);
  205 + dst = ip6_route_output(net, NULL, &fl6);
206 206 if (dst->error)
207 207 goto out_err;
208 208 if (!ret_saddr)
209 209 return dst;
210   - if (ipv6_addr_any(&fl.fl6_src) &&
  210 + if (ipv6_addr_any(&fl6.saddr) &&
211 211 ipv6_dev_get_saddr(net, ip6_dst_idev(dst)->dev,
212   - &fl.fl6_dst, 0, &fl.fl6_src) < 0)
  212 + &fl6.daddr, 0, &fl6.saddr) < 0)
213 213 goto out_err;
214 214 if (do_xfrm) {
215   - dst = xfrm_lookup(net, dst, &fl, NULL, 0);
  215 + dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
216 216 if (IS_ERR(dst)) {
217 217 dst = NULL;
218 218 goto out_err;
219 219 }
220 220 }
221   - ipv6_addr_copy(ret_saddr, &fl.fl6_src);
  221 + ipv6_addr_copy(ret_saddr, &fl6.saddr);
222 222 return dst;
223 223  
224 224 out_err:
net/netfilter/xt_TEE.c
... ... @@ -143,18 +143,18 @@
143 143 const struct ipv6hdr *iph = ipv6_hdr(skb);
144 144 struct net *net = pick_net(skb);
145 145 struct dst_entry *dst;
146   - struct flowi fl;
  146 + struct flowi6 fl6;
147 147  
148   - memset(&fl, 0, sizeof(fl));
  148 + memset(&fl6, 0, sizeof(fl6));
149 149 if (info->priv) {
150 150 if (info->priv->oif == -1)
151 151 return false;
152   - fl.flowi_oif = info->priv->oif;
  152 + fl6.flowi6_oif = info->priv->oif;
153 153 }
154   - fl.fl6_dst = info->gw.in6;
155   - fl.fl6_flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) |
  154 + fl6.daddr = info->gw.in6;
  155 + fl6.flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) |
156 156 (iph->flow_lbl[1] << 8) | iph->flow_lbl[2];
157   - dst = ip6_route_output(net, NULL, &fl);
  157 + dst = ip6_route_output(net, NULL, &fl6);
158 158 if (dst == NULL)
159 159 return false;
160 160  
... ... @@ -201,40 +201,40 @@
201 201 {
202 202 struct sock *sk = skb->sk;
203 203 struct ipv6_pinfo *np = inet6_sk(sk);
204   - struct flowi fl;
  204 + struct flowi6 fl6;
205 205  
206   - memset(&fl, 0, sizeof(fl));
  206 + memset(&fl6, 0, sizeof(fl6));
207 207  
208   - fl.flowi_proto = sk->sk_protocol;
  208 + fl6.flowi6_proto = sk->sk_protocol;
209 209  
210 210 /* Fill in the dest address from the route entry passed with the skb
211 211 * and the source address from the transport.
212 212 */
213   - ipv6_addr_copy(&fl.fl6_dst, &transport->ipaddr.v6.sin6_addr);
214   - ipv6_addr_copy(&fl.fl6_src, &transport->saddr.v6.sin6_addr);
  213 + ipv6_addr_copy(&fl6.daddr, &transport->ipaddr.v6.sin6_addr);
  214 + ipv6_addr_copy(&fl6.saddr, &transport->saddr.v6.sin6_addr);
215 215  
216   - fl.fl6_flowlabel = np->flow_label;
217   - IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
218   - if (ipv6_addr_type(&fl.fl6_src) & IPV6_ADDR_LINKLOCAL)
219   - fl.flowi_oif = transport->saddr.v6.sin6_scope_id;
  216 + fl6.flowlabel = np->flow_label;
  217 + IP6_ECN_flow_xmit(sk, fl6.flowlabel);
  218 + if (ipv6_addr_type(&fl6.saddr) & IPV6_ADDR_LINKLOCAL)
  219 + fl6.flowi6_oif = transport->saddr.v6.sin6_scope_id;
220 220 else
221   - fl.flowi_oif = sk->sk_bound_dev_if;
  221 + fl6.flowi6_oif = sk->sk_bound_dev_if;
222 222  
223 223 if (np->opt && np->opt->srcrt) {
224 224 struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
225   - ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
  225 + ipv6_addr_copy(&fl6.daddr, rt0->addr);
226 226 }
227 227  
228 228 SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, src:%pI6 dst:%pI6\n",
229 229 __func__, skb, skb->len,
230   - &fl.fl6_src, &fl.fl6_dst);
  230 + &fl6.saddr, &fl6.daddr);
231 231  
232 232 SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
233 233  
234 234 if (!(transport->param_flags & SPP_PMTUD_ENABLE))
235 235 skb->local_df = 1;
236 236  
237   - return ip6_xmit(sk, skb, &fl, np->opt);
  237 + return ip6_xmit(sk, skb, &fl6, np->opt);
238 238 }
239 239  
240 240 /* Returns the dst cache entry for the given source and destination ip
241 241  
242 242  
243 243  
244 244  
245 245  
... ... @@ -245,22 +245,22 @@
245 245 union sctp_addr *saddr)
246 246 {
247 247 struct dst_entry *dst;
248   - struct flowi fl;
  248 + struct flowi6 fl6;
249 249  
250   - memset(&fl, 0, sizeof(fl));
251   - ipv6_addr_copy(&fl.fl6_dst, &daddr->v6.sin6_addr);
  250 + memset(&fl6, 0, sizeof(fl6));
  251 + ipv6_addr_copy(&fl6.daddr, &daddr->v6.sin6_addr);
252 252 if (ipv6_addr_type(&daddr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL)
253   - fl.flowi_oif = daddr->v6.sin6_scope_id;
  253 + fl6.flowi6_oif = daddr->v6.sin6_scope_id;
254 254  
255 255  
256   - SCTP_DEBUG_PRINTK("%s: DST=%pI6 ", __func__, &fl.fl6_dst);
  256 + SCTP_DEBUG_PRINTK("%s: DST=%pI6 ", __func__, &fl6.daddr);
257 257  
258 258 if (saddr) {
259   - ipv6_addr_copy(&fl.fl6_src, &saddr->v6.sin6_addr);
260   - SCTP_DEBUG_PRINTK("SRC=%pI6 - ", &fl.fl6_src);
  259 + ipv6_addr_copy(&fl6.saddr, &saddr->v6.sin6_addr);
  260 + SCTP_DEBUG_PRINTK("SRC=%pI6 - ", &fl6.saddr);
261 261 }
262 262  
263   - dst = ip6_route_output(&init_net, NULL, &fl);
  263 + dst = ip6_route_output(&init_net, NULL, &fl6);
264 264 if (!dst->error) {
265 265 struct rt6_info *rt;
266 266 rt = (struct rt6_info *)dst;