aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/fib_rules.c6
-rw-r--r--net/dccp/ipv4.c17
-rw-r--r--net/dccp/ipv6.c20
-rw-r--r--net/decnet/af_decnet.c4
-rw-r--r--net/decnet/dn_fib.c4
-rw-r--r--net/decnet/dn_nsp_out.c4
-rw-r--r--net/decnet/dn_route.c96
-rw-r--r--net/ipv4/fib_frontend.c12
-rw-r--r--net/ipv4/fib_semantics.c2
-rw-r--r--net/ipv4/fib_trie.c2
-rw-r--r--net/ipv4/icmp.c12
-rw-r--r--net/ipv4/inet_connection_sock.c22
-rw-r--r--net/ipv4/ip_output.c18
-rw-r--r--net/ipv4/ipmr.c12
-rw-r--r--net/ipv4/netfilter.c6
-rw-r--r--net/ipv4/raw.c10
-rw-r--r--net/ipv4/route.c72
-rw-r--r--net/ipv4/syncookies.c20
-rw-r--r--net/ipv4/udp.c21
-rw-r--r--net/ipv4/xfrm4_policy.c10
-rw-r--r--net/ipv4/xfrm4_state.c4
-rw-r--r--net/ipv6/af_inet6.c6
-rw-r--r--net/ipv6/datagram.c20
-rw-r--r--net/ipv6/icmp.c24
-rw-r--r--net/ipv6/inet6_connection_sock.c12
-rw-r--r--net/ipv6/ip6_flowlabel.c2
-rw-r--r--net/ipv6/ip6_output.c10
-rw-r--r--net/ipv6/ip6_tunnel.c8
-rw-r--r--net/ipv6/ip6mr.c22
-rw-r--r--net/ipv6/ipv6_sockglue.c4
-rw-r--r--net/ipv6/mip6.c6
-rw-r--r--net/ipv6/netfilter.c4
-rw-r--r--net/ipv6/netfilter/ip6t_REJECT.c2
-rw-r--r--net/ipv6/raw.c20
-rw-r--r--net/ipv6/route.c20
-rw-r--r--net/ipv6/syncookies.c6
-rw-r--r--net/ipv6/tcp_ipv6.c22
-rw-r--r--net/ipv6/udp.c20
-rw-r--r--net/ipv6/xfrm6_policy.c10
-rw-r--r--net/ipv6/xfrm6_state.c4
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c2
-rw-r--r--net/netfilter/ipvs/ip_vs_xmit.c2
-rw-r--r--net/netfilter/xt_TEE.c4
-rw-r--r--net/sctp/ipv6.c8
-rw-r--r--net/sctp/protocol.c4
-rw-r--r--net/xfrm/xfrm_policy.c18
-rw-r--r--net/xfrm/xfrm_state.c2
47 files changed, 325 insertions, 311 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index a20e5d3bbfa0..8248ebb5891d 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -181,13 +181,13 @@ static int fib_rule_match(struct fib_rule *rule, struct fib_rules_ops *ops,
181{ 181{
182 int ret = 0; 182 int ret = 0;
183 183
184 if (rule->iifindex && (rule->iifindex != fl->iif)) 184 if (rule->iifindex && (rule->iifindex != fl->flowi_iif))
185 goto out; 185 goto out;
186 186
187 if (rule->oifindex && (rule->oifindex != fl->oif)) 187 if (rule->oifindex && (rule->oifindex != fl->flowi_oif))
188 goto out; 188 goto out;
189 189
190 if ((rule->mark ^ fl->mark) & rule->mark_mask) 190 if ((rule->mark ^ fl->flowi_mark) & rule->mark_mask)
191 goto out; 191 goto out;
192 192
193 ret = ops->match(rule, fl, flags); 193 ret = ops->match(rule, fl, flags);
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 7882377bc62e..09a09911c5ea 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -465,14 +465,15 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
465 struct sk_buff *skb) 465 struct sk_buff *skb)
466{ 466{
467 struct rtable *rt; 467 struct rtable *rt;
468 struct flowi fl = { .oif = skb_rtable(skb)->rt_iif, 468 struct flowi fl = {
469 .fl4_dst = ip_hdr(skb)->saddr, 469 .flowi_oif = skb_rtable(skb)->rt_iif,
470 .fl4_src = ip_hdr(skb)->daddr, 470 .fl4_dst = ip_hdr(skb)->saddr,
471 .fl4_tos = RT_CONN_FLAGS(sk), 471 .fl4_src = ip_hdr(skb)->daddr,
472 .proto = sk->sk_protocol, 472 .fl4_tos = RT_CONN_FLAGS(sk),
473 .fl_ip_sport = dccp_hdr(skb)->dccph_dport, 473 .flowi_proto = sk->sk_protocol,
474 .fl_ip_dport = dccp_hdr(skb)->dccph_sport 474 .fl_ip_sport = dccp_hdr(skb)->dccph_dport,
475 }; 475 .fl_ip_dport = dccp_hdr(skb)->dccph_sport,
476 };
476 477
477 security_skb_classify_flow(skb, &fl); 478 security_skb_classify_flow(skb, &fl);
478 rt = ip_route_output_flow(net, &fl, sk); 479 rt = ip_route_output_flow(net, &fl, sk);
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 5efc57f5e605..5209ee7a3dc2 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -154,10 +154,10 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
154 for now. 154 for now.
155 */ 155 */
156 memset(&fl, 0, sizeof(fl)); 156 memset(&fl, 0, sizeof(fl));
157 fl.proto = IPPROTO_DCCP; 157 fl.flowi_proto = IPPROTO_DCCP;
158 ipv6_addr_copy(&fl.fl6_dst, &np->daddr); 158 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
159 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 159 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
160 fl.oif = sk->sk_bound_dev_if; 160 fl.flowi_oif = sk->sk_bound_dev_if;
161 fl.fl_ip_dport = inet->inet_dport; 161 fl.fl_ip_dport = inet->inet_dport;
162 fl.fl_ip_sport = inet->inet_sport; 162 fl.fl_ip_sport = inet->inet_sport;
163 security_sk_classify_flow(sk, &fl); 163 security_sk_classify_flow(sk, &fl);
@@ -248,11 +248,11 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
248 struct dst_entry *dst; 248 struct dst_entry *dst;
249 249
250 memset(&fl, 0, sizeof(fl)); 250 memset(&fl, 0, sizeof(fl));
251 fl.proto = IPPROTO_DCCP; 251 fl.flowi_proto = IPPROTO_DCCP;
252 ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr); 252 ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
253 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); 253 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
254 fl.fl6_flowlabel = 0; 254 fl.fl6_flowlabel = 0;
255 fl.oif = ireq6->iif; 255 fl.flowi_oif = ireq6->iif;
256 fl.fl_ip_dport = inet_rsk(req)->rmt_port; 256 fl.fl_ip_dport = inet_rsk(req)->rmt_port;
257 fl.fl_ip_sport = inet_rsk(req)->loc_port; 257 fl.fl_ip_sport = inet_rsk(req)->loc_port;
258 security_req_classify_flow(req, &fl); 258 security_req_classify_flow(req, &fl);
@@ -321,8 +321,8 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
321 ipv6_addr_copy(&fl.fl6_dst, &rxip6h->saddr); 321 ipv6_addr_copy(&fl.fl6_dst, &rxip6h->saddr);
322 ipv6_addr_copy(&fl.fl6_src, &rxip6h->daddr); 322 ipv6_addr_copy(&fl.fl6_src, &rxip6h->daddr);
323 323
324 fl.proto = IPPROTO_DCCP; 324 fl.flowi_proto = IPPROTO_DCCP;
325 fl.oif = inet6_iif(rxskb); 325 fl.flowi_oif = inet6_iif(rxskb);
326 fl.fl_ip_dport = dccp_hdr(skb)->dccph_dport; 326 fl.fl_ip_dport = dccp_hdr(skb)->dccph_dport;
327 fl.fl_ip_sport = dccp_hdr(skb)->dccph_sport; 327 fl.fl_ip_sport = dccp_hdr(skb)->dccph_sport;
328 security_skb_classify_flow(rxskb, &fl); 328 security_skb_classify_flow(rxskb, &fl);
@@ -530,11 +530,11 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
530 struct flowi fl; 530 struct flowi fl;
531 531
532 memset(&fl, 0, sizeof(fl)); 532 memset(&fl, 0, sizeof(fl));
533 fl.proto = IPPROTO_DCCP; 533 fl.flowi_proto = IPPROTO_DCCP;
534 ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr); 534 ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
535 final_p = fl6_update_dst(&fl, opt, &final); 535 final_p = fl6_update_dst(&fl, opt, &final);
536 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); 536 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
537 fl.oif = sk->sk_bound_dev_if; 537 fl.flowi_oif = sk->sk_bound_dev_if;
538 fl.fl_ip_dport = inet_rsk(req)->rmt_port; 538 fl.fl_ip_dport = inet_rsk(req)->rmt_port;
539 fl.fl_ip_sport = inet_rsk(req)->loc_port; 539 fl.fl_ip_sport = inet_rsk(req)->loc_port;
540 security_sk_classify_flow(sk, &fl); 540 security_sk_classify_flow(sk, &fl);
@@ -953,10 +953,10 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
953 if (!ipv6_addr_any(&np->rcv_saddr)) 953 if (!ipv6_addr_any(&np->rcv_saddr))
954 saddr = &np->rcv_saddr; 954 saddr = &np->rcv_saddr;
955 955
956 fl.proto = IPPROTO_DCCP; 956 fl.flowi_proto = IPPROTO_DCCP;
957 ipv6_addr_copy(&fl.fl6_dst, &np->daddr); 957 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
958 ipv6_addr_copy(&fl.fl6_src, saddr ? saddr : &np->saddr); 958 ipv6_addr_copy(&fl.fl6_src, saddr ? saddr : &np->saddr);
959 fl.oif = sk->sk_bound_dev_if; 959 fl.flowi_oif = sk->sk_bound_dev_if;
960 fl.fl_ip_dport = usin->sin6_port; 960 fl.fl_ip_dport = usin->sin6_port;
961 fl.fl_ip_sport = inet->inet_sport; 961 fl.fl_ip_sport = inet->inet_sport;
962 security_sk_classify_flow(sk, &fl); 962 security_sk_classify_flow(sk, &fl);
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 2af15b15d1fa..aafd15a01575 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -948,11 +948,11 @@ static int __dn_connect(struct sock *sk, struct sockaddr_dn *addr, int addrlen,
948 948
949 err = -EHOSTUNREACH; 949 err = -EHOSTUNREACH;
950 memset(&fl, 0, sizeof(fl)); 950 memset(&fl, 0, sizeof(fl));
951 fl.oif = sk->sk_bound_dev_if; 951 fl.flowi_oif = sk->sk_bound_dev_if;
952 fl.fld_dst = dn_saddr2dn(&scp->peer); 952 fl.fld_dst = dn_saddr2dn(&scp->peer);
953 fl.fld_src = dn_saddr2dn(&scp->addr); 953 fl.fld_src = dn_saddr2dn(&scp->addr);
954 dn_sk_ports_copy(&fl, scp); 954 dn_sk_ports_copy(&fl, scp);
955 fl.proto = DNPROTO_NSP; 955 fl.flowi_proto = DNPROTO_NSP;
956 if (dn_route_output_sock(&sk->sk_dst_cache, &fl, sk, flags) < 0) 956 if (dn_route_output_sock(&sk->sk_dst_cache, &fl, sk, flags) < 0)
957 goto out; 957 goto out;
958 sk->sk_route_caps = sk->sk_dst_cache->dev->features; 958 sk->sk_route_caps = sk->sk_dst_cache->dev->features;
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 0ef0a81bcd72..4dfffa0b67a8 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -223,7 +223,7 @@ static int dn_fib_check_nh(const struct rtmsg *r, struct dn_fib_info *fi, struct
223 223
224 memset(&fl, 0, sizeof(fl)); 224 memset(&fl, 0, sizeof(fl));
225 fl.fld_dst = nh->nh_gw; 225 fl.fld_dst = nh->nh_gw;
226 fl.oif = nh->nh_oif; 226 fl.flowi_oif = nh->nh_oif;
227 fl.fld_scope = r->rtm_scope + 1; 227 fl.fld_scope = r->rtm_scope + 1;
228 228
229 if (fl.fld_scope < RT_SCOPE_LINK) 229 if (fl.fld_scope < RT_SCOPE_LINK)
@@ -424,7 +424,7 @@ int dn_fib_semantic_match(int type, struct dn_fib_info *fi, const struct flowi *
424 for_nexthops(fi) { 424 for_nexthops(fi) {
425 if (nh->nh_flags & RTNH_F_DEAD) 425 if (nh->nh_flags & RTNH_F_DEAD)
426 continue; 426 continue;
427 if (!fl->oif || fl->oif == nh->nh_oif) 427 if (!fl->flowi_oif || fl->flowi_oif == nh->nh_oif)
428 break; 428 break;
429 } 429 }
430 if (nhsel < fi->fib_nhs) { 430 if (nhsel < fi->fib_nhs) {
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index 2ef115277bea..b3d66742a01f 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -92,11 +92,11 @@ try_again:
92 } 92 }
93 93
94 memset(&fl, 0, sizeof(fl)); 94 memset(&fl, 0, sizeof(fl));
95 fl.oif = sk->sk_bound_dev_if; 95 fl.flowi_oif = sk->sk_bound_dev_if;
96 fl.fld_src = dn_saddr2dn(&scp->addr); 96 fl.fld_src = dn_saddr2dn(&scp->addr);
97 fl.fld_dst = dn_saddr2dn(&scp->peer); 97 fl.fld_dst = dn_saddr2dn(&scp->peer);
98 dn_sk_ports_copy(&fl, scp); 98 dn_sk_ports_copy(&fl, scp);
99 fl.proto = DNPROTO_NSP; 99 fl.flowi_proto = DNPROTO_NSP;
100 if (dn_route_output_sock(&sk->sk_dst_cache, &fl, sk, 0) == 0) { 100 if (dn_route_output_sock(&sk->sk_dst_cache, &fl, sk, 0) == 0) {
101 dst = sk_dst_get(sk); 101 dst = sk_dst_get(sk);
102 sk->sk_route_caps = dst->dev->features; 102 sk->sk_route_caps = dst->dev->features;
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 484fdbf92bd8..d74d34b93f80 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -286,10 +286,10 @@ static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
286{ 286{
287 return ((fl1->fld_dst ^ fl2->fld_dst) | 287 return ((fl1->fld_dst ^ fl2->fld_dst) |
288 (fl1->fld_src ^ fl2->fld_src) | 288 (fl1->fld_src ^ fl2->fld_src) |
289 (fl1->mark ^ fl2->mark) | 289 (fl1->flowi_mark ^ fl2->flowi_mark) |
290 (fl1->fld_scope ^ fl2->fld_scope) | 290 (fl1->fld_scope ^ fl2->fld_scope) |
291 (fl1->oif ^ fl2->oif) | 291 (fl1->flowi_oif ^ fl2->flowi_oif) |
292 (fl1->iif ^ fl2->iif)) == 0; 292 (fl1->flowi_iif ^ fl2->flowi_iif)) == 0;
293} 293}
294 294
295static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route **rp) 295static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route **rp)
@@ -905,12 +905,14 @@ static inline __le16 dn_fib_rules_map_destination(__le16 daddr, struct dn_fib_re
905 905
906static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *oldflp, int try_hard) 906static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *oldflp, int try_hard)
907{ 907{
908 struct flowi fl = { .fld_dst = oldflp->fld_dst, 908 struct flowi fl = {
909 .fld_src = oldflp->fld_src, 909 .fld_dst = oldflp->fld_dst,
910 .fld_scope = RT_SCOPE_UNIVERSE, 910 .fld_src = oldflp->fld_src,
911 .mark = oldflp->mark, 911 .fld_scope = RT_SCOPE_UNIVERSE,
912 .iif = init_net.loopback_dev->ifindex, 912 .flowi_mark = oldflp->flowi_mark,
913 .oif = oldflp->oif }; 913 .flowi_iif = init_net.loopback_dev->ifindex,
914 .flowi_oif = oldflp->flowi_oif,
915 };
914 struct dn_route *rt = NULL; 916 struct dn_route *rt = NULL;
915 struct net_device *dev_out = NULL, *dev; 917 struct net_device *dev_out = NULL, *dev;
916 struct neighbour *neigh = NULL; 918 struct neighbour *neigh = NULL;
@@ -926,11 +928,11 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old
926 "dn_route_output_slow: dst=%04x src=%04x mark=%d" 928 "dn_route_output_slow: dst=%04x src=%04x mark=%d"
927 " iif=%d oif=%d\n", le16_to_cpu(oldflp->fld_dst), 929 " iif=%d oif=%d\n", le16_to_cpu(oldflp->fld_dst),
928 le16_to_cpu(oldflp->fld_src), 930 le16_to_cpu(oldflp->fld_src),
929 oldflp->mark, init_net.loopback_dev->ifindex, oldflp->oif); 931 oldflp->flowi_mark, init_net.loopback_dev->ifindex, oldflp->flowi_oif);
930 932
931 /* If we have an output interface, verify its a DECnet device */ 933 /* If we have an output interface, verify its a DECnet device */
932 if (oldflp->oif) { 934 if (oldflp->flowi_oif) {
933 dev_out = dev_get_by_index(&init_net, oldflp->oif); 935 dev_out = dev_get_by_index(&init_net, oldflp->flowi_oif);
934 err = -ENODEV; 936 err = -ENODEV;
935 if (dev_out && dev_out->dn_ptr == NULL) { 937 if (dev_out && dev_out->dn_ptr == NULL) {
936 dev_put(dev_out); 938 dev_put(dev_out);
@@ -988,7 +990,7 @@ source_ok:
988 if (!fl.fld_dst) 990 if (!fl.fld_dst)
989 goto out; 991 goto out;
990 } 992 }
991 fl.oif = init_net.loopback_dev->ifindex; 993 fl.flowi_oif = init_net.loopback_dev->ifindex;
992 res.type = RTN_LOCAL; 994 res.type = RTN_LOCAL;
993 goto make_route; 995 goto make_route;
994 } 996 }
@@ -998,7 +1000,7 @@ source_ok:
998 "dn_route_output_slow: initial checks complete." 1000 "dn_route_output_slow: initial checks complete."
999 " dst=%o4x src=%04x oif=%d try_hard=%d\n", 1001 " dst=%o4x src=%04x oif=%d try_hard=%d\n",
1000 le16_to_cpu(fl.fld_dst), le16_to_cpu(fl.fld_src), 1002 le16_to_cpu(fl.fld_dst), le16_to_cpu(fl.fld_src),
1001 fl.oif, try_hard); 1003 fl.flowi_oif, try_hard);
1002 1004
1003 /* 1005 /*
1004 * N.B. If the kernel is compiled without router support then 1006 * N.B. If the kernel is compiled without router support then
@@ -1023,8 +1025,8 @@ source_ok:
1023 if (!try_hard) { 1025 if (!try_hard) {
1024 neigh = neigh_lookup_nodev(&dn_neigh_table, &init_net, &fl.fld_dst); 1026 neigh = neigh_lookup_nodev(&dn_neigh_table, &init_net, &fl.fld_dst);
1025 if (neigh) { 1027 if (neigh) {
1026 if ((oldflp->oif && 1028 if ((oldflp->flowi_oif &&
1027 (neigh->dev->ifindex != oldflp->oif)) || 1029 (neigh->dev->ifindex != oldflp->flowi_oif)) ||
1028 (oldflp->fld_src && 1030 (oldflp->fld_src &&
1029 (!dn_dev_islocal(neigh->dev, 1031 (!dn_dev_islocal(neigh->dev,
1030 oldflp->fld_src)))) { 1032 oldflp->fld_src)))) {
@@ -1078,7 +1080,7 @@ select_source:
1078 if (fl.fld_src == 0 && res.type != RTN_LOCAL) 1080 if (fl.fld_src == 0 && res.type != RTN_LOCAL)
1079 goto e_addr; 1081 goto e_addr;
1080 } 1082 }
1081 fl.oif = dev_out->ifindex; 1083 fl.flowi_oif = dev_out->ifindex;
1082 goto make_route; 1084 goto make_route;
1083 } 1085 }
1084 free_res = 1; 1086 free_res = 1;
@@ -1093,14 +1095,14 @@ select_source:
1093 dev_put(dev_out); 1095 dev_put(dev_out);
1094 dev_out = init_net.loopback_dev; 1096 dev_out = init_net.loopback_dev;
1095 dev_hold(dev_out); 1097 dev_hold(dev_out);
1096 fl.oif = dev_out->ifindex; 1098 fl.flowi_oif = dev_out->ifindex;
1097 if (res.fi) 1099 if (res.fi)
1098 dn_fib_info_put(res.fi); 1100 dn_fib_info_put(res.fi);
1099 res.fi = NULL; 1101 res.fi = NULL;
1100 goto make_route; 1102 goto make_route;
1101 } 1103 }
1102 1104
1103 if (res.fi->fib_nhs > 1 && fl.oif == 0) 1105 if (res.fi->fib_nhs > 1 && fl.flowi_oif == 0)
1104 dn_fib_select_multipath(&fl, &res); 1106 dn_fib_select_multipath(&fl, &res);
1105 1107
1106 /* 1108 /*
@@ -1115,7 +1117,7 @@ select_source:
1115 dev_put(dev_out); 1117 dev_put(dev_out);
1116 dev_out = DN_FIB_RES_DEV(res); 1118 dev_out = DN_FIB_RES_DEV(res);
1117 dev_hold(dev_out); 1119 dev_hold(dev_out);
1118 fl.oif = dev_out->ifindex; 1120 fl.flowi_oif = dev_out->ifindex;
1119 gateway = DN_FIB_RES_GW(res); 1121 gateway = DN_FIB_RES_GW(res);
1120 1122
1121make_route: 1123make_route:
@@ -1131,9 +1133,9 @@ make_route:
1131 1133
1132 rt->fl.fld_src = oldflp->fld_src; 1134 rt->fl.fld_src = oldflp->fld_src;
1133 rt->fl.fld_dst = oldflp->fld_dst; 1135 rt->fl.fld_dst = oldflp->fld_dst;
1134 rt->fl.oif = oldflp->oif; 1136 rt->fl.flowi_oif = oldflp->flowi_oif;
1135 rt->fl.iif = 0; 1137 rt->fl.flowi_iif = 0;
1136 rt->fl.mark = oldflp->mark; 1138 rt->fl.flowi_mark = oldflp->flowi_mark;
1137 1139
1138 rt->rt_saddr = fl.fld_src; 1140 rt->rt_saddr = fl.fld_src;
1139 rt->rt_daddr = fl.fld_dst; 1141 rt->rt_daddr = fl.fld_dst;
@@ -1201,9 +1203,9 @@ static int __dn_route_output_key(struct dst_entry **pprt, const struct flowi *fl
1201 rt = rcu_dereference_bh(rt->dst.dn_next)) { 1203 rt = rcu_dereference_bh(rt->dst.dn_next)) {
1202 if ((flp->fld_dst == rt->fl.fld_dst) && 1204 if ((flp->fld_dst == rt->fl.fld_dst) &&
1203 (flp->fld_src == rt->fl.fld_src) && 1205 (flp->fld_src == rt->fl.fld_src) &&
1204 (flp->mark == rt->fl.mark) && 1206 (flp->flowi_mark == rt->fl.flowi_mark) &&
1205 dn_is_output_route(rt) && 1207 dn_is_output_route(rt) &&
1206 (rt->fl.oif == flp->oif)) { 1208 (rt->fl.flowi_oif == flp->flowi_oif)) {
1207 dst_use(&rt->dst, jiffies); 1209 dst_use(&rt->dst, jiffies);
1208 rcu_read_unlock_bh(); 1210 rcu_read_unlock_bh();
1209 *pprt = &rt->dst; 1211 *pprt = &rt->dst;
@@ -1221,7 +1223,7 @@ static int dn_route_output_key(struct dst_entry **pprt, struct flowi *flp, int f
1221 int err; 1223 int err;
1222 1224
1223 err = __dn_route_output_key(pprt, flp, flags); 1225 err = __dn_route_output_key(pprt, flp, flags);
1224 if (err == 0 && flp->proto) { 1226 if (err == 0 && flp->flowi_proto) {
1225 *pprt = xfrm_lookup(&init_net, *pprt, flp, NULL, 0); 1227 *pprt = xfrm_lookup(&init_net, *pprt, flp, NULL, 0);
1226 if (IS_ERR(*pprt)) { 1228 if (IS_ERR(*pprt)) {
1227 err = PTR_ERR(*pprt); 1229 err = PTR_ERR(*pprt);
@@ -1236,9 +1238,9 @@ int dn_route_output_sock(struct dst_entry **pprt, struct flowi *fl, struct sock
1236 int err; 1238 int err;
1237 1239
1238 err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD); 1240 err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD);
1239 if (err == 0 && fl->proto) { 1241 if (err == 0 && fl->flowi_proto) {
1240 if (!(flags & MSG_DONTWAIT)) 1242 if (!(flags & MSG_DONTWAIT))
1241 fl->flags |= FLOWI_FLAG_CAN_SLEEP; 1243 fl->flowi_flags |= FLOWI_FLAG_CAN_SLEEP;
1242 *pprt = xfrm_lookup(&init_net, *pprt, fl, sk, 0); 1244 *pprt = xfrm_lookup(&init_net, *pprt, fl, sk, 0);
1243 if (IS_ERR(*pprt)) { 1245 if (IS_ERR(*pprt)) {
1244 err = PTR_ERR(*pprt); 1246 err = PTR_ERR(*pprt);
@@ -1260,11 +1262,13 @@ static int dn_route_input_slow(struct sk_buff *skb)
1260 int flags = 0; 1262 int flags = 0;
1261 __le16 gateway = 0; 1263 __le16 gateway = 0;
1262 __le16 local_src = 0; 1264 __le16 local_src = 0;
1263 struct flowi fl = { .fld_dst = cb->dst, 1265 struct flowi fl = {
1264 .fld_src = cb->src, 1266 .fld_dst = cb->dst,
1265 .fld_scope = RT_SCOPE_UNIVERSE, 1267 .fld_src = cb->src,
1266 .mark = skb->mark, 1268 .fld_scope = RT_SCOPE_UNIVERSE,
1267 .iif = skb->dev->ifindex }; 1269 .flowi_mark = skb->mark,
1270 .flowi_iif = skb->dev->ifindex,
1271 };
1268 struct dn_fib_res res = { .fi = NULL, .type = RTN_UNREACHABLE }; 1272 struct dn_fib_res res = { .fi = NULL, .type = RTN_UNREACHABLE };
1269 int err = -EINVAL; 1273 int err = -EINVAL;
1270 int free_res = 0; 1274 int free_res = 0;
@@ -1343,7 +1347,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
1343 if (dn_db->parms.forwarding == 0) 1347 if (dn_db->parms.forwarding == 0)
1344 goto e_inval; 1348 goto e_inval;
1345 1349
1346 if (res.fi->fib_nhs > 1 && fl.oif == 0) 1350 if (res.fi->fib_nhs > 1 && fl.flowi_oif == 0)
1347 dn_fib_select_multipath(&fl, &res); 1351 dn_fib_select_multipath(&fl, &res);
1348 1352
1349 /* 1353 /*
@@ -1408,9 +1412,9 @@ make_route:
1408 1412
1409 rt->fl.fld_src = cb->src; 1413 rt->fl.fld_src = cb->src;
1410 rt->fl.fld_dst = cb->dst; 1414 rt->fl.fld_dst = cb->dst;
1411 rt->fl.oif = 0; 1415 rt->fl.flowi_oif = 0;
1412 rt->fl.iif = in_dev->ifindex; 1416 rt->fl.flowi_iif = in_dev->ifindex;
1413 rt->fl.mark = fl.mark; 1417 rt->fl.flowi_mark = fl.flowi_mark;
1414 1418
1415 rt->dst.flags = DST_HOST; 1419 rt->dst.flags = DST_HOST;
1416 rt->dst.neighbour = neigh; 1420 rt->dst.neighbour = neigh;
@@ -1482,9 +1486,9 @@ static int dn_route_input(struct sk_buff *skb)
1482 rt = rcu_dereference(rt->dst.dn_next)) { 1486 rt = rcu_dereference(rt->dst.dn_next)) {
1483 if ((rt->fl.fld_src == cb->src) && 1487 if ((rt->fl.fld_src == cb->src) &&
1484 (rt->fl.fld_dst == cb->dst) && 1488 (rt->fl.fld_dst == cb->dst) &&
1485 (rt->fl.oif == 0) && 1489 (rt->fl.flowi_oif == 0) &&
1486 (rt->fl.mark == skb->mark) && 1490 (rt->fl.flowi_mark == skb->mark) &&
1487 (rt->fl.iif == cb->iif)) { 1491 (rt->fl.flowi_iif == cb->iif)) {
1488 dst_use(&rt->dst, jiffies); 1492 dst_use(&rt->dst, jiffies);
1489 rcu_read_unlock(); 1493 rcu_read_unlock();
1490 skb_dst_set(skb, (struct dst_entry *)rt); 1494 skb_dst_set(skb, (struct dst_entry *)rt);
@@ -1541,7 +1545,7 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
1541 rt->dst.error) < 0) 1545 rt->dst.error) < 0)
1542 goto rtattr_failure; 1546 goto rtattr_failure;
1543 if (dn_is_input_route(rt)) 1547 if (dn_is_input_route(rt))
1544 RTA_PUT(skb, RTA_IIF, sizeof(int), &rt->fl.iif); 1548 RTA_PUT(skb, RTA_IIF, sizeof(int), &rt->fl.flowi_iif);
1545 1549
1546 nlh->nlmsg_len = skb_tail_pointer(skb) - b; 1550 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
1547 return skb->len; 1551 return skb->len;
@@ -1570,7 +1574,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
1570 return -EINVAL; 1574 return -EINVAL;
1571 1575
1572 memset(&fl, 0, sizeof(fl)); 1576 memset(&fl, 0, sizeof(fl));
1573 fl.proto = DNPROTO_NSP; 1577 fl.flowi_proto = DNPROTO_NSP;
1574 1578
1575 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); 1579 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
1576 if (skb == NULL) 1580 if (skb == NULL)
@@ -1583,11 +1587,11 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
1583 if (rta[RTA_DST-1]) 1587 if (rta[RTA_DST-1])
1584 memcpy(&fl.fld_dst, RTA_DATA(rta[RTA_DST-1]), 2); 1588 memcpy(&fl.fld_dst, RTA_DATA(rta[RTA_DST-1]), 2);
1585 if (rta[RTA_IIF-1]) 1589 if (rta[RTA_IIF-1])
1586 memcpy(&fl.iif, RTA_DATA(rta[RTA_IIF-1]), sizeof(int)); 1590 memcpy(&fl.flowi_iif, RTA_DATA(rta[RTA_IIF-1]), sizeof(int));
1587 1591
1588 if (fl.iif) { 1592 if (fl.flowi_iif) {
1589 struct net_device *dev; 1593 struct net_device *dev;
1590 if ((dev = dev_get_by_index(&init_net, fl.iif)) == NULL) { 1594 if ((dev = dev_get_by_index(&init_net, fl.flowi_iif)) == NULL) {
1591 kfree_skb(skb); 1595 kfree_skb(skb);
1592 return -ENODEV; 1596 return -ENODEV;
1593 } 1597 }
@@ -1611,7 +1615,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
1611 int oif = 0; 1615 int oif = 0;
1612 if (rta[RTA_OIF - 1]) 1616 if (rta[RTA_OIF - 1])
1613 memcpy(&oif, RTA_DATA(rta[RTA_OIF - 1]), sizeof(int)); 1617 memcpy(&oif, RTA_DATA(rta[RTA_OIF - 1]), sizeof(int));
1614 fl.oif = oif; 1618 fl.flowi_oif = oif;
1615 err = dn_route_output_key((struct dst_entry **)&rt, &fl, 0); 1619 err = dn_route_output_key((struct dst_entry **)&rt, &fl, 0);
1616 } 1620 }
1617 1621
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index fe10bcd0f307..76105284a81c 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -200,9 +200,9 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
200 int ret; 200 int ret;
201 struct net *net; 201 struct net *net;
202 202
203 fl.oif = 0; 203 fl.flowi_oif = 0;
204 fl.iif = oif; 204 fl.flowi_iif = oif;
205 fl.mark = mark; 205 fl.flowi_mark = mark;
206 fl.fl4_dst = src; 206 fl.fl4_dst = src;
207 fl.fl4_src = dst; 207 fl.fl4_src = dst;
208 fl.fl4_tos = tos; 208 fl.fl4_tos = tos;
@@ -215,7 +215,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
215 rpf = IN_DEV_RPFILTER(in_dev); 215 rpf = IN_DEV_RPFILTER(in_dev);
216 accept_local = IN_DEV_ACCEPT_LOCAL(in_dev); 216 accept_local = IN_DEV_ACCEPT_LOCAL(in_dev);
217 if (mark && !IN_DEV_SRC_VMARK(in_dev)) 217 if (mark && !IN_DEV_SRC_VMARK(in_dev))
218 fl.mark = 0; 218 fl.flowi_mark = 0;
219 } 219 }
220 220
221 if (in_dev == NULL) 221 if (in_dev == NULL)
@@ -253,7 +253,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
253 goto last_resort; 253 goto last_resort;
254 if (rpf == 1) 254 if (rpf == 1)
255 goto e_rpf; 255 goto e_rpf;
256 fl.oif = dev->ifindex; 256 fl.flowi_oif = dev->ifindex;
257 257
258 ret = 0; 258 ret = 0;
259 if (fib_lookup(net, &fl, &res) == 0) { 259 if (fib_lookup(net, &fl, &res) == 0) {
@@ -797,7 +797,7 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb)
797 797
798 struct fib_result res; 798 struct fib_result res;
799 struct flowi fl = { 799 struct flowi fl = {
800 .mark = frn->fl_mark, 800 .flowi_mark = frn->fl_mark,
801 .fl4_dst = frn->fl_addr, 801 .fl4_dst = frn->fl_addr,
802 .fl4_tos = frn->fl_tos, 802 .fl4_tos = frn->fl_tos,
803 .fl4_scope = frn->fl_scope, 803 .fl4_scope = frn->fl_scope,
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index b5d523b911e6..79179ade5294 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -563,7 +563,7 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
563 struct flowi fl = { 563 struct flowi fl = {
564 .fl4_dst = nh->nh_gw, 564 .fl4_dst = nh->nh_gw,
565 .fl4_scope = cfg->fc_scope + 1, 565 .fl4_scope = cfg->fc_scope + 1,
566 .oif = nh->nh_oif, 566 .flowi_oif = nh->nh_oif,
567 }; 567 };
568 568
569 /* It is not necessary, but requires a bit of thinking */ 569 /* It is not necessary, but requires a bit of thinking */
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index a4109a544778..d5ff80ef001a 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1379,7 +1379,7 @@ static int check_leaf(struct fib_table *tb, struct trie *t, struct leaf *l,
1379 1379
1380 if (nh->nh_flags & RTNH_F_DEAD) 1380 if (nh->nh_flags & RTNH_F_DEAD)
1381 continue; 1381 continue;
1382 if (flp->oif && flp->oif != nh->nh_oif) 1382 if (flp->flowi_oif && flp->flowi_oif != nh->nh_oif)
1383 continue; 1383 continue;
1384 1384
1385#ifdef CONFIG_IP_FIB_TRIE_STATS 1385#ifdef CONFIG_IP_FIB_TRIE_STATS
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 1771ce662548..3fde7f23c70b 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -353,10 +353,12 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
353 daddr = icmp_param->replyopts.faddr; 353 daddr = icmp_param->replyopts.faddr;
354 } 354 }
355 { 355 {
356 struct flowi fl = { .fl4_dst= daddr, 356 struct flowi fl = {
357 .fl4_src = rt->rt_spec_dst, 357 .fl4_dst = daddr,
358 .fl4_tos = RT_TOS(ip_hdr(skb)->tos), 358 .fl4_src = rt->rt_spec_dst,
359 .proto = IPPROTO_ICMP }; 359 .fl4_tos = RT_TOS(ip_hdr(skb)->tos),
360 .flowi_proto = IPPROTO_ICMP,
361 };
360 security_skb_classify_flow(skb, &fl); 362 security_skb_classify_flow(skb, &fl);
361 rt = ip_route_output_key(net, &fl); 363 rt = ip_route_output_key(net, &fl);
362 if (IS_ERR(rt)) 364 if (IS_ERR(rt))
@@ -381,7 +383,7 @@ static struct rtable *icmp_route_lookup(struct net *net, struct sk_buff *skb_in,
381 param->replyopts.faddr : iph->saddr), 383 param->replyopts.faddr : iph->saddr),
382 .fl4_src = saddr, 384 .fl4_src = saddr,
383 .fl4_tos = RT_TOS(tos), 385 .fl4_tos = RT_TOS(tos),
384 .proto = IPPROTO_ICMP, 386 .flowi_proto = IPPROTO_ICMP,
385 .fl_icmp_type = type, 387 .fl_icmp_type = type,
386 .fl_icmp_code = code, 388 .fl_icmp_code = code,
387 }; 389 };
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index e4e301a61c5b..97081702dffd 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -356,16 +356,18 @@ struct dst_entry *inet_csk_route_req(struct sock *sk,
356 struct rtable *rt; 356 struct rtable *rt;
357 const struct inet_request_sock *ireq = inet_rsk(req); 357 const struct inet_request_sock *ireq = inet_rsk(req);
358 struct ip_options *opt = inet_rsk(req)->opt; 358 struct ip_options *opt = inet_rsk(req)->opt;
359 struct flowi fl = { .oif = sk->sk_bound_dev_if, 359 struct flowi fl = {
360 .mark = sk->sk_mark, 360 .flowi_oif = sk->sk_bound_dev_if,
361 .fl4_dst = ((opt && opt->srr) ? 361 .flowi_mark = sk->sk_mark,
362 opt->faddr : ireq->rmt_addr), 362 .fl4_dst = ((opt && opt->srr) ?
363 .fl4_src = ireq->loc_addr, 363 opt->faddr : ireq->rmt_addr),
364 .fl4_tos = RT_CONN_FLAGS(sk), 364 .fl4_src = ireq->loc_addr,
365 .proto = sk->sk_protocol, 365 .fl4_tos = RT_CONN_FLAGS(sk),
366 .flags = inet_sk_flowi_flags(sk), 366 .flowi_proto = sk->sk_protocol,
367 .fl_ip_sport = inet_sk(sk)->inet_sport, 367 .flowi_flags = inet_sk_flowi_flags(sk),
368 .fl_ip_dport = ireq->rmt_port }; 368 .fl_ip_sport = inet_sk(sk)->inet_sport,
369 .fl_ip_dport = ireq->rmt_port,
370 };
369 struct net *net = sock_net(sk); 371 struct net *net = sock_net(sk);
370 372
371 security_req_classify_flow(req, &fl); 373 security_req_classify_flow(req, &fl);
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 916152dbdce4..e35ca40df03b 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1474,14 +1474,16 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
1474 } 1474 }
1475 1475
1476 { 1476 {
1477 struct flowi fl = { .oif = arg->bound_dev_if, 1477 struct flowi fl = {
1478 .fl4_dst = daddr, 1478 .flowi_oif = arg->bound_dev_if,
1479 .fl4_src = rt->rt_spec_dst, 1479 .fl4_dst = daddr,
1480 .fl4_tos = RT_TOS(ip_hdr(skb)->tos), 1480 .fl4_src = rt->rt_spec_dst,
1481 .fl_ip_sport = tcp_hdr(skb)->dest, 1481 .fl4_tos = RT_TOS(ip_hdr(skb)->tos),
1482 .fl_ip_dport = tcp_hdr(skb)->source, 1482 .fl_ip_sport = tcp_hdr(skb)->dest,
1483 .proto = sk->sk_protocol, 1483 .fl_ip_dport = tcp_hdr(skb)->source,
1484 .flags = ip_reply_arg_flowi_flags(arg) }; 1484 .flowi_proto = sk->sk_protocol,
1485 .flowi_flags = ip_reply_arg_flowi_flags(arg),
1486 };
1485 security_skb_classify_flow(skb, &fl); 1487 security_skb_classify_flow(skb, &fl);
1486 rt = ip_route_output_key(sock_net(sk), &fl); 1488 rt = ip_route_output_key(sock_net(sk), &fl);
1487 if (IS_ERR(rt)) 1489 if (IS_ERR(rt))
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 594a3004367b..3b72b0a26d7e 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -436,9 +436,9 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb, struct net_device *dev)
436 struct net *net = dev_net(dev); 436 struct net *net = dev_net(dev);
437 struct mr_table *mrt; 437 struct mr_table *mrt;
438 struct flowi fl = { 438 struct flowi fl = {
439 .oif = dev->ifindex, 439 .flowi_oif = dev->ifindex,
440 .iif = skb->skb_iif, 440 .flowi_iif = skb->skb_iif,
441 .mark = skb->mark, 441 .flowi_mark = skb->mark,
442 }; 442 };
443 int err; 443 int err;
444 444
@@ -1793,9 +1793,9 @@ static struct mr_table *ipmr_rt_fib_lookup(struct net *net, struct rtable *rt)
1793 .fl4_dst = rt->rt_key_dst, 1793 .fl4_dst = rt->rt_key_dst,
1794 .fl4_src = rt->rt_key_src, 1794 .fl4_src = rt->rt_key_src,
1795 .fl4_tos = rt->rt_tos, 1795 .fl4_tos = rt->rt_tos,
1796 .oif = rt->rt_oif, 1796 .flowi_oif = rt->rt_oif,
1797 .iif = rt->rt_iif, 1797 .flowi_iif = rt->rt_iif,
1798 .mark = rt->rt_mark, 1798 .flowi_mark = rt->rt_mark,
1799 }; 1799 };
1800 struct mr_table *mrt; 1800 struct mr_table *mrt;
1801 int err; 1801 int err;
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c
index 67bf709180de..6f40ba511c6b 100644
--- a/net/ipv4/netfilter.c
+++ b/net/ipv4/netfilter.c
@@ -35,9 +35,9 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
35 if (type == RTN_LOCAL) 35 if (type == RTN_LOCAL)
36 fl.fl4_src = iph->saddr; 36 fl.fl4_src = iph->saddr;
37 fl.fl4_tos = RT_TOS(iph->tos); 37 fl.fl4_tos = RT_TOS(iph->tos);
38 fl.oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; 38 fl.flowi_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0;
39 fl.mark = skb->mark; 39 fl.flowi_mark = skb->mark;
40 fl.flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0; 40 fl.flowi_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0;
41 rt = ip_route_output_key(net, &fl); 41 rt = ip_route_output_key(net, &fl);
42 if (IS_ERR(rt)) 42 if (IS_ERR(rt))
43 return -1; 43 return -1;
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 467d570d087a..b42b7cd56c03 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -418,7 +418,7 @@ static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
418 if (!iov) 418 if (!iov)
419 continue; 419 continue;
420 420
421 switch (fl->proto) { 421 switch (fl->flowi_proto) {
422 case IPPROTO_ICMP: 422 case IPPROTO_ICMP:
423 /* check if one-byte field is readable or not. */ 423 /* check if one-byte field is readable or not. */
424 if (iov->iov_base && iov->iov_len < 1) 424 if (iov->iov_base && iov->iov_len < 1)
@@ -548,14 +548,14 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
548 } 548 }
549 549
550 { 550 {
551 struct flowi fl = { .oif = ipc.oif, 551 struct flowi fl = { .flowi_oif = ipc.oif,
552 .mark = sk->sk_mark, 552 .flowi_mark = sk->sk_mark,
553 .fl4_dst = daddr, 553 .fl4_dst = daddr,
554 .fl4_src = saddr, 554 .fl4_src = saddr,
555 .fl4_tos = tos, 555 .fl4_tos = tos,
556 .proto = inet->hdrincl ? IPPROTO_RAW : 556 .flowi_proto = inet->hdrincl ? IPPROTO_RAW :
557 sk->sk_protocol, 557 sk->sk_protocol,
558 .flags = FLOWI_FLAG_CAN_SLEEP, 558 .flowi_flags = FLOWI_FLAG_CAN_SLEEP,
559 }; 559 };
560 if (!inet->hdrincl) { 560 if (!inet->hdrincl) {
561 err = raw_probe_proto_opt(&fl, msg); 561 err = raw_probe_proto_opt(&fl, msg);
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 9c17e32d5623..c9aa4f9effe2 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1701,9 +1701,9 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt)
1701 .fl4_dst = rt->rt_key_dst, 1701 .fl4_dst = rt->rt_key_dst,
1702 .fl4_src = rt->rt_key_src, 1702 .fl4_src = rt->rt_key_src,
1703 .fl4_tos = rt->rt_tos, 1703 .fl4_tos = rt->rt_tos,
1704 .oif = rt->rt_oif, 1704 .flowi_oif = rt->rt_oif,
1705 .iif = rt->rt_iif, 1705 .flowi_iif = rt->rt_iif,
1706 .mark = rt->rt_mark, 1706 .flowi_mark = rt->rt_mark,
1707 }; 1707 };
1708 1708
1709 rcu_read_lock(); 1709 rcu_read_lock();
@@ -1766,7 +1766,7 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi *oldflp,
1766 /* If a peer entry exists for this destination, we must hook 1766 /* If a peer entry exists for this destination, we must hook
1767 * it up in order to get at cached metrics. 1767 * it up in order to get at cached metrics.
1768 */ 1768 */
1769 if (oldflp && (oldflp->flags & FLOWI_FLAG_PRECOW_METRICS)) 1769 if (oldflp && (oldflp->flowi_flags & FLOWI_FLAG_PRECOW_METRICS))
1770 create = 1; 1770 create = 1;
1771 1771
1772 rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create); 1772 rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create);
@@ -2057,9 +2057,9 @@ static int ip_mkroute_input(struct sk_buff *skb,
2057 return err; 2057 return err;
2058 2058
2059 /* put it into the cache */ 2059 /* put it into the cache */
2060 hash = rt_hash(daddr, saddr, fl->iif, 2060 hash = rt_hash(daddr, saddr, fl->flowi_iif,
2061 rt_genid(dev_net(rth->dst.dev))); 2061 rt_genid(dev_net(rth->dst.dev)));
2062 rth = rt_intern_hash(hash, rth, skb, fl->iif); 2062 rth = rt_intern_hash(hash, rth, skb, fl->flowi_iif);
2063 if (IS_ERR(rth)) 2063 if (IS_ERR(rth))
2064 return PTR_ERR(rth); 2064 return PTR_ERR(rth);
2065 return 0; 2065 return 0;
@@ -2118,9 +2118,9 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
2118 /* 2118 /*
2119 * Now we are ready to route packet. 2119 * Now we are ready to route packet.
2120 */ 2120 */
2121 fl.oif = 0; 2121 fl.flowi_oif = 0;
2122 fl.iif = dev->ifindex; 2122 fl.flowi_iif = dev->ifindex;
2123 fl.mark = skb->mark; 2123 fl.flowi_mark = skb->mark;
2124 fl.fl4_dst = daddr; 2124 fl.fl4_dst = daddr;
2125 fl.fl4_src = saddr; 2125 fl.fl4_src = saddr;
2126 fl.fl4_tos = tos; 2126 fl.fl4_tos = tos;
@@ -2205,8 +2205,8 @@ local_input:
2205 rth->rt_flags &= ~RTCF_LOCAL; 2205 rth->rt_flags &= ~RTCF_LOCAL;
2206 } 2206 }
2207 rth->rt_type = res.type; 2207 rth->rt_type = res.type;
2208 hash = rt_hash(daddr, saddr, fl.iif, rt_genid(net)); 2208 hash = rt_hash(daddr, saddr, fl.flowi_iif, rt_genid(net));
2209 rth = rt_intern_hash(hash, rth, skb, fl.iif); 2209 rth = rt_intern_hash(hash, rth, skb, fl.flowi_iif);
2210 err = 0; 2210 err = 0;
2211 if (IS_ERR(rth)) 2211 if (IS_ERR(rth))
2212 err = PTR_ERR(rth); 2212 err = PTR_ERR(rth);
@@ -2369,7 +2369,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
2369 } else if (type == RTN_MULTICAST) { 2369 } else if (type == RTN_MULTICAST) {
2370 flags |= RTCF_MULTICAST | RTCF_LOCAL; 2370 flags |= RTCF_MULTICAST | RTCF_LOCAL;
2371 if (!ip_check_mc_rcu(in_dev, oldflp->fl4_dst, oldflp->fl4_src, 2371 if (!ip_check_mc_rcu(in_dev, oldflp->fl4_dst, oldflp->fl4_src,
2372 oldflp->proto)) 2372 oldflp->flowi_proto))
2373 flags &= ~RTCF_LOCAL; 2373 flags &= ~RTCF_LOCAL;
2374 /* If multicast route do not exist use 2374 /* If multicast route do not exist use
2375 * default one, but do not gateway in this case. 2375 * default one, but do not gateway in this case.
@@ -2387,8 +2387,8 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
2387 rth->rt_key_dst = oldflp->fl4_dst; 2387 rth->rt_key_dst = oldflp->fl4_dst;
2388 rth->rt_tos = tos; 2388 rth->rt_tos = tos;
2389 rth->rt_key_src = oldflp->fl4_src; 2389 rth->rt_key_src = oldflp->fl4_src;
2390 rth->rt_oif = oldflp->oif; 2390 rth->rt_oif = oldflp->flowi_oif;
2391 rth->rt_mark = oldflp->mark; 2391 rth->rt_mark = oldflp->flowi_mark;
2392 rth->rt_dst = fl->fl4_dst; 2392 rth->rt_dst = fl->fl4_dst;
2393 rth->rt_src = fl->fl4_src; 2393 rth->rt_src = fl->fl4_src;
2394 rth->rt_iif = 0; 2394 rth->rt_iif = 0;
@@ -2452,9 +2452,9 @@ static struct rtable *ip_route_output_slow(struct net *net,
2452 res.r = NULL; 2452 res.r = NULL;
2453#endif 2453#endif
2454 2454
2455 fl.oif = oldflp->oif; 2455 fl.flowi_oif = oldflp->flowi_oif;
2456 fl.iif = net->loopback_dev->ifindex; 2456 fl.flowi_iif = net->loopback_dev->ifindex;
2457 fl.mark = oldflp->mark; 2457 fl.flowi_mark = oldflp->flowi_mark;
2458 fl.fl4_dst = oldflp->fl4_dst; 2458 fl.fl4_dst = oldflp->fl4_dst;
2459 fl.fl4_src = oldflp->fl4_src; 2459 fl.fl4_src = oldflp->fl4_src;
2460 fl.fl4_tos = tos & IPTOS_RT_MASK; 2460 fl.fl4_tos = tos & IPTOS_RT_MASK;
@@ -2477,7 +2477,7 @@ static struct rtable *ip_route_output_slow(struct net *net,
2477 of another iface. --ANK 2477 of another iface. --ANK
2478 */ 2478 */
2479 2479
2480 if (oldflp->oif == 0 && 2480 if (oldflp->flowi_oif == 0 &&
2481 (ipv4_is_multicast(oldflp->fl4_dst) || 2481 (ipv4_is_multicast(oldflp->fl4_dst) ||
2482 ipv4_is_lbcast(oldflp->fl4_dst))) { 2482 ipv4_is_lbcast(oldflp->fl4_dst))) {
2483 /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */ 2483 /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
@@ -2500,11 +2500,11 @@ static struct rtable *ip_route_output_slow(struct net *net,
2500 Luckily, this hack is good workaround. 2500 Luckily, this hack is good workaround.
2501 */ 2501 */
2502 2502
2503 fl.oif = dev_out->ifindex; 2503 fl.flowi_oif = dev_out->ifindex;
2504 goto make_route; 2504 goto make_route;
2505 } 2505 }
2506 2506
2507 if (!(oldflp->flags & FLOWI_FLAG_ANYSRC)) { 2507 if (!(oldflp->flowi_flags & FLOWI_FLAG_ANYSRC)) {
2508 /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */ 2508 /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
2509 if (!__ip_dev_find(net, oldflp->fl4_src, false)) 2509 if (!__ip_dev_find(net, oldflp->fl4_src, false))
2510 goto out; 2510 goto out;
@@ -2512,8 +2512,8 @@ static struct rtable *ip_route_output_slow(struct net *net,
2512 } 2512 }
2513 2513
2514 2514
2515 if (oldflp->oif) { 2515 if (oldflp->flowi_oif) {
2516 dev_out = dev_get_by_index_rcu(net, oldflp->oif); 2516 dev_out = dev_get_by_index_rcu(net, oldflp->flowi_oif);
2517 rth = ERR_PTR(-ENODEV); 2517 rth = ERR_PTR(-ENODEV);
2518 if (dev_out == NULL) 2518 if (dev_out == NULL)
2519 goto out; 2519 goto out;
@@ -2545,7 +2545,7 @@ static struct rtable *ip_route_output_slow(struct net *net,
2545 if (!fl.fl4_dst) 2545 if (!fl.fl4_dst)
2546 fl.fl4_dst = fl.fl4_src = htonl(INADDR_LOOPBACK); 2546 fl.fl4_dst = fl.fl4_src = htonl(INADDR_LOOPBACK);
2547 dev_out = net->loopback_dev; 2547 dev_out = net->loopback_dev;
2548 fl.oif = net->loopback_dev->ifindex; 2548 fl.flowi_oif = net->loopback_dev->ifindex;
2549 res.type = RTN_LOCAL; 2549 res.type = RTN_LOCAL;
2550 flags |= RTCF_LOCAL; 2550 flags |= RTCF_LOCAL;
2551 goto make_route; 2551 goto make_route;
@@ -2553,7 +2553,7 @@ static struct rtable *ip_route_output_slow(struct net *net,
2553 2553
2554 if (fib_lookup(net, &fl, &res)) { 2554 if (fib_lookup(net, &fl, &res)) {
2555 res.fi = NULL; 2555 res.fi = NULL;
2556 if (oldflp->oif) { 2556 if (oldflp->flowi_oif) {
2557 /* Apparently, routing tables are wrong. Assume, 2557 /* Apparently, routing tables are wrong. Assume,
2558 that the destination is on link. 2558 that the destination is on link.
2559 2559
@@ -2590,25 +2590,25 @@ static struct rtable *ip_route_output_slow(struct net *net,
2590 fl.fl4_src = fl.fl4_dst; 2590 fl.fl4_src = fl.fl4_dst;
2591 } 2591 }
2592 dev_out = net->loopback_dev; 2592 dev_out = net->loopback_dev;
2593 fl.oif = dev_out->ifindex; 2593 fl.flowi_oif = dev_out->ifindex;
2594 res.fi = NULL; 2594 res.fi = NULL;
2595 flags |= RTCF_LOCAL; 2595 flags |= RTCF_LOCAL;
2596 goto make_route; 2596 goto make_route;
2597 } 2597 }
2598 2598
2599#ifdef CONFIG_IP_ROUTE_MULTIPATH 2599#ifdef CONFIG_IP_ROUTE_MULTIPATH
2600 if (res.fi->fib_nhs > 1 && fl.oif == 0) 2600 if (res.fi->fib_nhs > 1 && fl.flowi_oif == 0)
2601 fib_select_multipath(&res); 2601 fib_select_multipath(&res);
2602 else 2602 else
2603#endif 2603#endif
2604 if (!res.prefixlen && res.type == RTN_UNICAST && !fl.oif) 2604 if (!res.prefixlen && res.type == RTN_UNICAST && !fl.flowi_oif)
2605 fib_select_default(&res); 2605 fib_select_default(&res);
2606 2606
2607 if (!fl.fl4_src) 2607 if (!fl.fl4_src)
2608 fl.fl4_src = FIB_RES_PREFSRC(res); 2608 fl.fl4_src = FIB_RES_PREFSRC(res);
2609 2609
2610 dev_out = FIB_RES_DEV(res); 2610 dev_out = FIB_RES_DEV(res);
2611 fl.oif = dev_out->ifindex; 2611 fl.flowi_oif = dev_out->ifindex;
2612 2612
2613 2613
2614make_route: 2614make_route:
@@ -2616,9 +2616,9 @@ make_route:
2616 if (!IS_ERR(rth)) { 2616 if (!IS_ERR(rth)) {
2617 unsigned int hash; 2617 unsigned int hash;
2618 2618
2619 hash = rt_hash(oldflp->fl4_dst, oldflp->fl4_src, oldflp->oif, 2619 hash = rt_hash(oldflp->fl4_dst, oldflp->fl4_src, oldflp->flowi_oif,
2620 rt_genid(dev_net(dev_out))); 2620 rt_genid(dev_net(dev_out)));
2621 rth = rt_intern_hash(hash, rth, NULL, oldflp->oif); 2621 rth = rt_intern_hash(hash, rth, NULL, oldflp->flowi_oif);
2622 } 2622 }
2623 2623
2624out: 2624out:
@@ -2634,7 +2634,7 @@ struct rtable *__ip_route_output_key(struct net *net, const struct flowi *flp)
2634 if (!rt_caching(net)) 2634 if (!rt_caching(net))
2635 goto slow_output; 2635 goto slow_output;
2636 2636
2637 hash = rt_hash(flp->fl4_dst, flp->fl4_src, flp->oif, rt_genid(net)); 2637 hash = rt_hash(flp->fl4_dst, flp->fl4_src, flp->flowi_oif, rt_genid(net));
2638 2638
2639 rcu_read_lock_bh(); 2639 rcu_read_lock_bh();
2640 for (rth = rcu_dereference_bh(rt_hash_table[hash].chain); rth; 2640 for (rth = rcu_dereference_bh(rt_hash_table[hash].chain); rth;
@@ -2642,8 +2642,8 @@ struct rtable *__ip_route_output_key(struct net *net, const struct flowi *flp)
2642 if (rth->rt_key_dst == flp->fl4_dst && 2642 if (rth->rt_key_dst == flp->fl4_dst &&
2643 rth->rt_key_src == flp->fl4_src && 2643 rth->rt_key_src == flp->fl4_src &&
2644 rt_is_output_route(rth) && 2644 rt_is_output_route(rth) &&
2645 rth->rt_oif == flp->oif && 2645 rth->rt_oif == flp->flowi_oif &&
2646 rth->rt_mark == flp->mark && 2646 rth->rt_mark == flp->flowi_mark &&
2647 !((rth->rt_tos ^ flp->fl4_tos) & 2647 !((rth->rt_tos ^ flp->fl4_tos) &
2648 (IPTOS_RT_MASK | RTO_ONLINK)) && 2648 (IPTOS_RT_MASK | RTO_ONLINK)) &&
2649 net_eq(dev_net(rth->dst.dev), net) && 2649 net_eq(dev_net(rth->dst.dev), net) &&
@@ -2741,7 +2741,7 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi *flp,
2741 if (IS_ERR(rt)) 2741 if (IS_ERR(rt))
2742 return rt; 2742 return rt;
2743 2743
2744 if (flp->proto) { 2744 if (flp->flowi_proto) {
2745 if (!flp->fl4_src) 2745 if (!flp->fl4_src)
2746 flp->fl4_src = rt->rt_src; 2746 flp->fl4_src = rt->rt_src;
2747 if (!flp->fl4_dst) 2747 if (!flp->fl4_dst)
@@ -2917,8 +2917,8 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
2917 .fl4_dst = dst, 2917 .fl4_dst = dst,
2918 .fl4_src = src, 2918 .fl4_src = src,
2919 .fl4_tos = rtm->rtm_tos, 2919 .fl4_tos = rtm->rtm_tos,
2920 .oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0, 2920 .flowi_oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0,
2921 .mark = mark, 2921 .flowi_mark = mark,
2922 }; 2922 };
2923 rt = ip_route_output_key(net, &fl); 2923 rt = ip_route_output_key(net, &fl);
2924 2924
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 0ad6ddf638a7..98d47dc60c89 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -345,15 +345,17 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
345 * no easy way to do this. 345 * no easy way to do this.
346 */ 346 */
347 { 347 {
348 struct flowi fl = { .mark = sk->sk_mark, 348 struct flowi fl = {
349 .fl4_dst = ((opt && opt->srr) ? 349 .flowi_mark = sk->sk_mark,
350 opt->faddr : ireq->rmt_addr), 350 .fl4_dst = ((opt && opt->srr) ?
351 .fl4_src = ireq->loc_addr, 351 opt->faddr : ireq->rmt_addr),
352 .fl4_tos = RT_CONN_FLAGS(sk), 352 .fl4_src = ireq->loc_addr,
353 .proto = IPPROTO_TCP, 353 .fl4_tos = RT_CONN_FLAGS(sk),
354 .flags = inet_sk_flowi_flags(sk), 354 .flowi_proto = IPPROTO_TCP,
355 .fl_ip_sport = th->dest, 355 .flowi_flags = inet_sk_flowi_flags(sk),
356 .fl_ip_dport = th->source }; 356 .fl_ip_sport = th->dest,
357 .fl_ip_dport = th->source,
358 };
357 security_req_classify_flow(req, &fl); 359 security_req_classify_flow(req, &fl);
358 rt = ip_route_output_key(sock_net(sk), &fl); 360 rt = ip_route_output_key(sock_net(sk), &fl);
359 if (IS_ERR(rt)) { 361 if (IS_ERR(rt)) {
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index c9a73e5b26a3..e10f62e6c07c 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -908,16 +908,17 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
908 rt = (struct rtable *)sk_dst_check(sk, 0); 908 rt = (struct rtable *)sk_dst_check(sk, 0);
909 909
910 if (rt == NULL) { 910 if (rt == NULL) {
911 struct flowi fl = { .oif = ipc.oif, 911 struct flowi fl = {
912 .mark = sk->sk_mark, 912 .flowi_oif = ipc.oif,
913 .fl4_dst = faddr, 913 .flowi_mark = sk->sk_mark,
914 .fl4_src = saddr, 914 .fl4_dst = faddr,
915 .fl4_tos = tos, 915 .fl4_src = saddr,
916 .proto = sk->sk_protocol, 916 .fl4_tos = tos,
917 .flags = (inet_sk_flowi_flags(sk) | 917 .flowi_proto = sk->sk_protocol,
918 FLOWI_FLAG_CAN_SLEEP), 918 .flowi_flags = (inet_sk_flowi_flags(sk) |
919 .fl_ip_sport = inet->inet_sport, 919 FLOWI_FLAG_CAN_SLEEP),
920 .fl_ip_dport = dport 920 .fl_ip_sport = inet->inet_sport,
921 .fl_ip_dport = dport,
921 }; 922 };
922 struct net *net = sock_net(sk); 923 struct net *net = sock_net(sk);
923 924
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index c70c42e7e77b..4294f121a749 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -73,9 +73,9 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
73 rt->rt_key_dst = fl->fl4_dst; 73 rt->rt_key_dst = fl->fl4_dst;
74 rt->rt_key_src = fl->fl4_src; 74 rt->rt_key_src = fl->fl4_src;
75 rt->rt_tos = fl->fl4_tos; 75 rt->rt_tos = fl->fl4_tos;
76 rt->rt_iif = fl->iif; 76 rt->rt_iif = fl->flowi_iif;
77 rt->rt_oif = fl->oif; 77 rt->rt_oif = fl->flowi_oif;
78 rt->rt_mark = fl->mark; 78 rt->rt_mark = fl->flowi_mark;
79 79
80 xdst->u.dst.dev = dev; 80 xdst->u.dst.dev = dev;
81 dev_hold(dev); 81 dev_hold(dev);
@@ -104,7 +104,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
104 u8 *xprth = skb_network_header(skb) + iph->ihl * 4; 104 u8 *xprth = skb_network_header(skb) + iph->ihl * 4;
105 105
106 memset(fl, 0, sizeof(struct flowi)); 106 memset(fl, 0, sizeof(struct flowi));
107 fl->mark = skb->mark; 107 fl->flowi_mark = skb->mark;
108 108
109 if (!(iph->frag_off & htons(IP_MF | IP_OFFSET))) { 109 if (!(iph->frag_off & htons(IP_MF | IP_OFFSET))) {
110 switch (iph->protocol) { 110 switch (iph->protocol) {
@@ -173,7 +173,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
173 break; 173 break;
174 } 174 }
175 } 175 }
176 fl->proto = iph->protocol; 176 fl->flowi_proto = iph->protocol;
177 fl->fl4_dst = reverse ? iph->saddr : iph->daddr; 177 fl->fl4_dst = reverse ? iph->saddr : iph->daddr;
178 fl->fl4_src = reverse ? iph->daddr : iph->saddr; 178 fl->fl4_src = reverse ? iph->daddr : iph->saddr;
179 fl->fl4_tos = iph->tos; 179 fl->fl4_tos = iph->tos;
diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c
index 983eff248988..d2314348dd2a 100644
--- a/net/ipv4/xfrm4_state.c
+++ b/net/ipv4/xfrm4_state.c
@@ -32,8 +32,8 @@ __xfrm4_init_tempsel(struct xfrm_selector *sel, const struct flowi *fl)
32 sel->family = AF_INET; 32 sel->family = AF_INET;
33 sel->prefixlen_d = 32; 33 sel->prefixlen_d = 32;
34 sel->prefixlen_s = 32; 34 sel->prefixlen_s = 32;
35 sel->proto = fl->proto; 35 sel->proto = fl->flowi_proto;
36 sel->ifindex = fl->oif; 36 sel->ifindex = fl->flowi_oif;
37} 37}
38 38
39static void 39static void
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index a88b2e9d25f1..35b0be0463f9 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -655,12 +655,12 @@ int inet6_sk_rebuild_header(struct sock *sk)
655 struct flowi fl; 655 struct flowi fl;
656 656
657 memset(&fl, 0, sizeof(fl)); 657 memset(&fl, 0, sizeof(fl));
658 fl.proto = sk->sk_protocol; 658 fl.flowi_proto = sk->sk_protocol;
659 ipv6_addr_copy(&fl.fl6_dst, &np->daddr); 659 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
660 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 660 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
661 fl.fl6_flowlabel = np->flow_label; 661 fl.fl6_flowlabel = np->flow_label;
662 fl.oif = sk->sk_bound_dev_if; 662 fl.flowi_oif = sk->sk_bound_dev_if;
663 fl.mark = sk->sk_mark; 663 fl.flowi_mark = sk->sk_mark;
664 fl.fl_ip_dport = inet->inet_dport; 664 fl.fl_ip_dport = inet->inet_dport;
665 fl.fl_ip_sport = inet->inet_sport; 665 fl.fl_ip_sport = inet->inet_sport;
666 security_sk_classify_flow(sk, &fl); 666 security_sk_classify_flow(sk, &fl);
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index be3a781c0085..6c24b26f67ec 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -146,16 +146,16 @@ ipv4_connected:
146 * destination cache for it. 146 * destination cache for it.
147 */ 147 */
148 148
149 fl.proto = sk->sk_protocol; 149 fl.flowi_proto = sk->sk_protocol;
150 ipv6_addr_copy(&fl.fl6_dst, &np->daddr); 150 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
151 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 151 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
152 fl.oif = sk->sk_bound_dev_if; 152 fl.flowi_oif = sk->sk_bound_dev_if;
153 fl.mark = sk->sk_mark; 153 fl.flowi_mark = sk->sk_mark;
154 fl.fl_ip_dport = inet->inet_dport; 154 fl.fl_ip_dport = inet->inet_dport;
155 fl.fl_ip_sport = inet->inet_sport; 155 fl.fl_ip_sport = inet->inet_sport;
156 156
157 if (!fl.oif && (addr_type&IPV6_ADDR_MULTICAST)) 157 if (!fl.flowi_oif && (addr_type&IPV6_ADDR_MULTICAST))
158 fl.oif = np->mcast_oif; 158 fl.flowi_oif = np->mcast_oif;
159 159
160 security_sk_classify_flow(sk, &fl); 160 security_sk_classify_flow(sk, &fl);
161 161
@@ -299,7 +299,7 @@ void ipv6_local_rxpmtu(struct sock *sk, struct flowi *fl, u32 mtu)
299 mtu_info->ip6m_addr.sin6_family = AF_INET6; 299 mtu_info->ip6m_addr.sin6_family = AF_INET6;
300 mtu_info->ip6m_addr.sin6_port = 0; 300 mtu_info->ip6m_addr.sin6_port = 0;
301 mtu_info->ip6m_addr.sin6_flowinfo = 0; 301 mtu_info->ip6m_addr.sin6_flowinfo = 0;
302 mtu_info->ip6m_addr.sin6_scope_id = fl->oif; 302 mtu_info->ip6m_addr.sin6_scope_id = fl->flowi_oif;
303 ipv6_addr_copy(&mtu_info->ip6m_addr.sin6_addr, &ipv6_hdr(skb)->daddr); 303 ipv6_addr_copy(&mtu_info->ip6m_addr.sin6_addr, &ipv6_hdr(skb)->daddr);
304 304
305 __skb_pull(skb, skb_tail_pointer(skb) - skb->data); 305 __skb_pull(skb, skb_tail_pointer(skb) - skb->data);
@@ -629,16 +629,16 @@ int datagram_send_ctl(struct net *net,
629 src_info = (struct in6_pktinfo *)CMSG_DATA(cmsg); 629 src_info = (struct in6_pktinfo *)CMSG_DATA(cmsg);
630 630
631 if (src_info->ipi6_ifindex) { 631 if (src_info->ipi6_ifindex) {
632 if (fl->oif && src_info->ipi6_ifindex != fl->oif) 632 if (fl->flowi_oif && src_info->ipi6_ifindex != fl->flowi_oif)
633 return -EINVAL; 633 return -EINVAL;
634 fl->oif = src_info->ipi6_ifindex; 634 fl->flowi_oif = src_info->ipi6_ifindex;
635 } 635 }
636 636
637 addr_type = __ipv6_addr_type(&src_info->ipi6_addr); 637 addr_type = __ipv6_addr_type(&src_info->ipi6_addr);
638 638
639 rcu_read_lock(); 639 rcu_read_lock();
640 if (fl->oif) { 640 if (fl->flowi_oif) {
641 dev = dev_get_by_index_rcu(net, fl->oif); 641 dev = dev_get_by_index_rcu(net, fl->flowi_oif);
642 if (!dev) { 642 if (!dev) {
643 rcu_read_unlock(); 643 rcu_read_unlock();
644 return -ENODEV; 644 return -ENODEV;
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 55665956b3a8..9e123e08b9b7 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -235,7 +235,7 @@ static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct
235 sizeof(struct icmp6hdr), skb->csum); 235 sizeof(struct icmp6hdr), skb->csum);
236 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src, 236 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src,
237 &fl->fl6_dst, 237 &fl->fl6_dst,
238 len, fl->proto, 238 len, fl->flowi_proto,
239 skb->csum); 239 skb->csum);
240 } else { 240 } else {
241 __wsum tmp_csum = 0; 241 __wsum tmp_csum = 0;
@@ -248,7 +248,7 @@ static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct
248 sizeof(struct icmp6hdr), tmp_csum); 248 sizeof(struct icmp6hdr), tmp_csum);
249 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src, 249 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src,
250 &fl->fl6_dst, 250 &fl->fl6_dst,
251 len, fl->proto, 251 len, fl->flowi_proto,
252 tmp_csum); 252 tmp_csum);
253 } 253 }
254 ip6_push_pending_frames(sk); 254 ip6_push_pending_frames(sk);
@@ -443,11 +443,11 @@ void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
443 mip6_addr_swap(skb); 443 mip6_addr_swap(skb);
444 444
445 memset(&fl, 0, sizeof(fl)); 445 memset(&fl, 0, sizeof(fl));
446 fl.proto = IPPROTO_ICMPV6; 446 fl.flowi_proto = IPPROTO_ICMPV6;
447 ipv6_addr_copy(&fl.fl6_dst, &hdr->saddr); 447 ipv6_addr_copy(&fl.fl6_dst, &hdr->saddr);
448 if (saddr) 448 if (saddr)
449 ipv6_addr_copy(&fl.fl6_src, saddr); 449 ipv6_addr_copy(&fl.fl6_src, saddr);
450 fl.oif = iif; 450 fl.flowi_oif = iif;
451 fl.fl_icmp_type = type; 451 fl.fl_icmp_type = type;
452 fl.fl_icmp_code = code; 452 fl.fl_icmp_code = code;
453 security_skb_classify_flow(skb, &fl); 453 security_skb_classify_flow(skb, &fl);
@@ -465,8 +465,8 @@ void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
465 tmp_hdr.icmp6_cksum = 0; 465 tmp_hdr.icmp6_cksum = 0;
466 tmp_hdr.icmp6_pointer = htonl(info); 466 tmp_hdr.icmp6_pointer = htonl(info);
467 467
468 if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) 468 if (!fl.flowi_oif && ipv6_addr_is_multicast(&fl.fl6_dst))
469 fl.oif = np->mcast_oif; 469 fl.flowi_oif = np->mcast_oif;
470 470
471 dst = icmpv6_route_lookup(net, skb, sk, &fl); 471 dst = icmpv6_route_lookup(net, skb, sk, &fl);
472 if (IS_ERR(dst)) 472 if (IS_ERR(dst))
@@ -539,11 +539,11 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
539 tmp_hdr.icmp6_type = ICMPV6_ECHO_REPLY; 539 tmp_hdr.icmp6_type = ICMPV6_ECHO_REPLY;
540 540
541 memset(&fl, 0, sizeof(fl)); 541 memset(&fl, 0, sizeof(fl));
542 fl.proto = IPPROTO_ICMPV6; 542 fl.flowi_proto = IPPROTO_ICMPV6;
543 ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr); 543 ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr);
544 if (saddr) 544 if (saddr)
545 ipv6_addr_copy(&fl.fl6_src, saddr); 545 ipv6_addr_copy(&fl.fl6_src, saddr);
546 fl.oif = skb->dev->ifindex; 546 fl.flowi_oif = skb->dev->ifindex;
547 fl.fl_icmp_type = ICMPV6_ECHO_REPLY; 547 fl.fl_icmp_type = ICMPV6_ECHO_REPLY;
548 security_skb_classify_flow(skb, &fl); 548 security_skb_classify_flow(skb, &fl);
549 549
@@ -552,8 +552,8 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
552 return; 552 return;
553 np = inet6_sk(sk); 553 np = inet6_sk(sk);
554 554
555 if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) 555 if (!fl.flowi_oif && ipv6_addr_is_multicast(&fl.fl6_dst))
556 fl.oif = np->mcast_oif; 556 fl.flowi_oif = np->mcast_oif;
557 557
558 err = ip6_dst_lookup(sk, &dst, &fl); 558 err = ip6_dst_lookup(sk, &dst, &fl);
559 if (err) 559 if (err)
@@ -793,10 +793,10 @@ void icmpv6_flow_init(struct sock *sk, struct flowi *fl,
793 memset(fl, 0, sizeof(*fl)); 793 memset(fl, 0, sizeof(*fl));
794 ipv6_addr_copy(&fl->fl6_src, saddr); 794 ipv6_addr_copy(&fl->fl6_src, saddr);
795 ipv6_addr_copy(&fl->fl6_dst, daddr); 795 ipv6_addr_copy(&fl->fl6_dst, daddr);
796 fl->proto = IPPROTO_ICMPV6; 796 fl->flowi_proto = IPPROTO_ICMPV6;
797 fl->fl_icmp_type = type; 797 fl->fl_icmp_type = type;
798 fl->fl_icmp_code = 0; 798 fl->fl_icmp_code = 0;
799 fl->oif = oif; 799 fl->flowi_oif = oif;
800 security_sk_classify_flow(sk, fl); 800 security_sk_classify_flow(sk, fl);
801} 801}
802 802
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index d687e1397333..673f9bf28958 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -64,12 +64,12 @@ struct dst_entry *inet6_csk_route_req(struct sock *sk,
64 struct flowi fl; 64 struct flowi fl;
65 65
66 memset(&fl, 0, sizeof(fl)); 66 memset(&fl, 0, sizeof(fl));
67 fl.proto = IPPROTO_TCP; 67 fl.flowi_proto = IPPROTO_TCP;
68 ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr); 68 ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr);
69 final_p = fl6_update_dst(&fl, np->opt, &final); 69 final_p = fl6_update_dst(&fl, np->opt, &final);
70 ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr); 70 ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr);
71 fl.oif = sk->sk_bound_dev_if; 71 fl.flowi_oif = sk->sk_bound_dev_if;
72 fl.mark = sk->sk_mark; 72 fl.flowi_mark = sk->sk_mark;
73 fl.fl_ip_dport = inet_rsk(req)->rmt_port; 73 fl.fl_ip_dport = inet_rsk(req)->rmt_port;
74 fl.fl_ip_sport = inet_rsk(req)->loc_port; 74 fl.fl_ip_sport = inet_rsk(req)->loc_port;
75 security_req_classify_flow(req, &fl); 75 security_req_classify_flow(req, &fl);
@@ -213,13 +213,13 @@ int inet6_csk_xmit(struct sk_buff *skb)
213 struct in6_addr *final_p, final; 213 struct in6_addr *final_p, final;
214 214
215 memset(&fl, 0, sizeof(fl)); 215 memset(&fl, 0, sizeof(fl));
216 fl.proto = sk->sk_protocol; 216 fl.flowi_proto = sk->sk_protocol;
217 ipv6_addr_copy(&fl.fl6_dst, &np->daddr); 217 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
218 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 218 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
219 fl.fl6_flowlabel = np->flow_label; 219 fl.fl6_flowlabel = np->flow_label;
220 IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel); 220 IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
221 fl.oif = sk->sk_bound_dev_if; 221 fl.flowi_oif = sk->sk_bound_dev_if;
222 fl.mark = sk->sk_mark; 222 fl.flowi_mark = sk->sk_mark;
223 fl.fl_ip_sport = inet->inet_sport; 223 fl.fl_ip_sport = inet->inet_sport;
224 fl.fl_ip_dport = inet->inet_dport; 224 fl.fl_ip_dport = inet->inet_dport;
225 security_sk_classify_flow(sk, &fl); 225 security_sk_classify_flow(sk, &fl);
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 13654686aeab..c8fa470b174b 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -358,7 +358,7 @@ fl_create(struct net *net, struct in6_flowlabel_req *freq, char __user *optval,
358 358
359 msg.msg_controllen = olen; 359 msg.msg_controllen = olen;
360 msg.msg_control = (void*)(fl->opt+1); 360 msg.msg_control = (void*)(fl->opt+1);
361 flowi.oif = 0; 361 flowi.flowi_oif = 0;
362 362
363 err = datagram_send_ctl(net, &msg, &flowi, fl->opt, &junk, 363 err = datagram_send_ctl(net, &msg, &flowi, fl->opt, &junk,
364 &junk, &junk); 364 &junk, &junk);
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index adaffaf84555..3d0f2ac868a7 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -182,7 +182,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
182 struct in6_addr *first_hop = &fl->fl6_dst; 182 struct in6_addr *first_hop = &fl->fl6_dst;
183 struct dst_entry *dst = skb_dst(skb); 183 struct dst_entry *dst = skb_dst(skb);
184 struct ipv6hdr *hdr; 184 struct ipv6hdr *hdr;
185 u8 proto = fl->proto; 185 u8 proto = fl->flowi_proto;
186 int seg_len = skb->len; 186 int seg_len = skb->len;
187 int hlimit = -1; 187 int hlimit = -1;
188 int tclass = 0; 188 int tclass = 0;
@@ -908,7 +908,7 @@ static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
908#ifdef CONFIG_IPV6_SUBTREES 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, &fl->fl6_src, np->saddr_cache) ||
910#endif 910#endif
911 (fl->oif && fl->oif != dst->dev->ifindex)) { 911 (fl->flowi_oif && fl->flowi_oif != dst->dev->ifindex)) {
912 dst_release(dst); 912 dst_release(dst);
913 dst = NULL; 913 dst = NULL;
914 } 914 }
@@ -1026,7 +1026,7 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi *fl,
1026 if (final_dst) 1026 if (final_dst)
1027 ipv6_addr_copy(&fl->fl6_dst, final_dst); 1027 ipv6_addr_copy(&fl->fl6_dst, final_dst);
1028 if (can_sleep) 1028 if (can_sleep)
1029 fl->flags |= FLOWI_FLAG_CAN_SLEEP; 1029 fl->flowi_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, fl, sk, 0);
1032} 1032}
@@ -1062,7 +1062,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi *fl,
1062 if (final_dst) 1062 if (final_dst)
1063 ipv6_addr_copy(&fl->fl6_dst, final_dst); 1063 ipv6_addr_copy(&fl->fl6_dst, final_dst);
1064 if (can_sleep) 1064 if (can_sleep)
1065 fl->flags |= FLOWI_FLAG_CAN_SLEEP; 1065 fl->flowi_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, fl, sk, 0);
1068} 1068}
@@ -1517,7 +1517,7 @@ int ip6_push_pending_frames(struct sock *sk)
1517 struct ipv6_txoptions *opt = np->cork.opt; 1517 struct ipv6_txoptions *opt = np->cork.opt;
1518 struct rt6_info *rt = (struct rt6_info *)inet->cork.dst; 1518 struct rt6_info *rt = (struct rt6_info *)inet->cork.dst;
1519 struct flowi *fl = &inet->cork.fl; 1519 struct flowi *fl = &inet->cork.fl;
1520 unsigned char proto = fl->proto; 1520 unsigned char proto = fl->flowi_proto;
1521 int err = 0; 1521 int err = 0;
1522 1522
1523 if ((skb = __skb_dequeue(&sk->sk_write_queue)) == NULL) 1523 if ((skb = __skb_dequeue(&sk->sk_write_queue)) == NULL)
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index f199b8486120..c3fc824c24d9 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -963,7 +963,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
963 963
964 skb->transport_header = skb->network_header; 964 skb->transport_header = skb->network_header;
965 965
966 proto = fl->proto; 966 proto = fl->flowi_proto;
967 if (encap_limit >= 0) { 967 if (encap_limit >= 0) {
968 init_tel_txopt(&opt, encap_limit); 968 init_tel_txopt(&opt, encap_limit);
969 ipv6_push_nfrag_opts(skb, &opt.ops, &proto, NULL); 969 ipv6_push_nfrag_opts(skb, &opt.ops, &proto, NULL);
@@ -1020,7 +1020,7 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
1020 encap_limit = t->parms.encap_limit; 1020 encap_limit = t->parms.encap_limit;
1021 1021
1022 memcpy(&fl, &t->fl, sizeof (fl)); 1022 memcpy(&fl, &t->fl, sizeof (fl));
1023 fl.proto = IPPROTO_IPIP; 1023 fl.flowi_proto = IPPROTO_IPIP;
1024 1024
1025 dsfield = ipv4_get_dsfield(iph); 1025 dsfield = ipv4_get_dsfield(iph);
1026 1026
@@ -1070,7 +1070,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
1070 encap_limit = t->parms.encap_limit; 1070 encap_limit = t->parms.encap_limit;
1071 1071
1072 memcpy(&fl, &t->fl, sizeof (fl)); 1072 memcpy(&fl, &t->fl, sizeof (fl));
1073 fl.proto = IPPROTO_IPV6; 1073 fl.flowi_proto = IPPROTO_IPV6;
1074 1074
1075 dsfield = ipv6_get_dsfield(ipv6h); 1075 dsfield = ipv6_get_dsfield(ipv6h);
1076 if ((t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)) 1076 if ((t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS))
@@ -1149,7 +1149,7 @@ static void ip6_tnl_link_config(struct ip6_tnl *t)
1149 /* Set up flowi template */ 1149 /* Set up flowi template */
1150 ipv6_addr_copy(&fl->fl6_src, &p->laddr); 1150 ipv6_addr_copy(&fl->fl6_src, &p->laddr);
1151 ipv6_addr_copy(&fl->fl6_dst, &p->raddr); 1151 ipv6_addr_copy(&fl->fl6_dst, &p->raddr);
1152 fl->oif = p->link; 1152 fl->flowi_oif = p->link;
1153 fl->fl6_flowlabel = 0; 1153 fl->fl6_flowlabel = 0;
1154 1154
1155 if (!(p->flags&IP6_TNL_F_USE_ORIG_TCLASS)) 1155 if (!(p->flags&IP6_TNL_F_USE_ORIG_TCLASS))
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 618f67ccda31..61a8be3ac4e4 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -618,8 +618,8 @@ static int pim6_rcv(struct sk_buff *skb)
618 struct net *net = dev_net(skb->dev); 618 struct net *net = dev_net(skb->dev);
619 struct mr6_table *mrt; 619 struct mr6_table *mrt;
620 struct flowi fl = { 620 struct flowi fl = {
621 .iif = skb->dev->ifindex, 621 .flowi_iif = skb->dev->ifindex,
622 .mark = skb->mark, 622 .flowi_mark = skb->mark,
623 }; 623 };
624 int reg_vif_num; 624 int reg_vif_num;
625 625
@@ -688,9 +688,9 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb,
688 struct net *net = dev_net(dev); 688 struct net *net = dev_net(dev);
689 struct mr6_table *mrt; 689 struct mr6_table *mrt;
690 struct flowi fl = { 690 struct flowi fl = {
691 .oif = dev->ifindex, 691 .flowi_oif = dev->ifindex,
692 .iif = skb->skb_iif, 692 .flowi_iif = skb->skb_iif,
693 .mark = skb->mark, 693 .flowi_mark = skb->mark,
694 }; 694 };
695 int err; 695 int err;
696 696
@@ -1548,9 +1548,9 @@ struct sock *mroute6_socket(struct net *net, struct sk_buff *skb)
1548{ 1548{
1549 struct mr6_table *mrt; 1549 struct mr6_table *mrt;
1550 struct flowi fl = { 1550 struct flowi fl = {
1551 .iif = skb->skb_iif, 1551 .flowi_iif = skb->skb_iif,
1552 .oif = skb->dev->ifindex, 1552 .flowi_oif = skb->dev->ifindex,
1553 .mark = skb->mark, 1553 .flowi_mark= skb->mark,
1554 }; 1554 };
1555 1555
1556 if (ip6mr_fib_lookup(net, &fl, &mrt) < 0) 1556 if (ip6mr_fib_lookup(net, &fl, &mrt) < 0)
@@ -1916,7 +1916,7 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt,
1916 ipv6h = ipv6_hdr(skb); 1916 ipv6h = ipv6_hdr(skb);
1917 1917
1918 fl = (struct flowi) { 1918 fl = (struct flowi) {
1919 .oif = vif->link, 1919 .flowi_oif = vif->link,
1920 .fl6_dst = ipv6h->daddr, 1920 .fl6_dst = ipv6h->daddr,
1921 }; 1921 };
1922 1922
@@ -2044,8 +2044,8 @@ int ip6_mr_input(struct sk_buff *skb)
2044 struct net *net = dev_net(skb->dev); 2044 struct net *net = dev_net(skb->dev);
2045 struct mr6_table *mrt; 2045 struct mr6_table *mrt;
2046 struct flowi fl = { 2046 struct flowi fl = {
2047 .iif = skb->dev->ifindex, 2047 .flowi_iif = skb->dev->ifindex,
2048 .mark = skb->mark, 2048 .flowi_mark= skb->mark,
2049 }; 2049 };
2050 int err; 2050 int err;
2051 2051
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index d1770e061c08..1448c507fdff 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -448,8 +448,8 @@ sticky_done:
448 int junk; 448 int junk;
449 449
450 fl.fl6_flowlabel = 0; 450 fl.fl6_flowlabel = 0;
451 fl.oif = sk->sk_bound_dev_if; 451 fl.flowi_oif = sk->sk_bound_dev_if;
452 fl.mark = sk->sk_mark; 452 fl.flowi_mark = sk->sk_mark;
453 453
454 if (optlen == 0) 454 if (optlen == 0)
455 goto update; 455 goto update;
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index f3e3ca938a54..e2f852cd0f4e 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -214,7 +214,7 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb,
214 struct timeval stamp; 214 struct timeval stamp;
215 int err = 0; 215 int err = 0;
216 216
217 if (unlikely(fl->proto == IPPROTO_MH && 217 if (unlikely(fl->flowi_proto == IPPROTO_MH &&
218 fl->fl_mh_type <= IP6_MH_TYPE_MAX)) 218 fl->fl_mh_type <= IP6_MH_TYPE_MAX))
219 goto out; 219 goto out;
220 220
@@ -240,14 +240,14 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb,
240 sizeof(sel.saddr)); 240 sizeof(sel.saddr));
241 sel.prefixlen_s = 128; 241 sel.prefixlen_s = 128;
242 sel.family = AF_INET6; 242 sel.family = AF_INET6;
243 sel.proto = fl->proto; 243 sel.proto = fl->flowi_proto;
244 sel.dport = xfrm_flowi_dport(fl); 244 sel.dport = xfrm_flowi_dport(fl);
245 if (sel.dport) 245 if (sel.dport)
246 sel.dport_mask = htons(~0); 246 sel.dport_mask = htons(~0);
247 sel.sport = xfrm_flowi_sport(fl); 247 sel.sport = xfrm_flowi_sport(fl);
248 if (sel.sport) 248 if (sel.sport)
249 sel.sport_mask = htons(~0); 249 sel.sport_mask = htons(~0);
250 sel.ifindex = fl->oif; 250 sel.ifindex = fl->flowi_oif;
251 251
252 err = km_report(net, IPPROTO_DSTOPTS, &sel, 252 err = km_report(net, IPPROTO_DSTOPTS, &sel,
253 (hao ? (xfrm_address_t *)&hao->addr : NULL)); 253 (hao ? (xfrm_address_t *)&hao->addr : NULL));
diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c
index 8d74116ae27d..d282c62bc6f4 100644
--- a/net/ipv6/netfilter.c
+++ b/net/ipv6/netfilter.c
@@ -16,8 +16,8 @@ int ip6_route_me_harder(struct sk_buff *skb)
16 struct ipv6hdr *iph = ipv6_hdr(skb); 16 struct ipv6hdr *iph = ipv6_hdr(skb);
17 struct dst_entry *dst; 17 struct dst_entry *dst;
18 struct flowi fl = { 18 struct flowi fl = {
19 .oif = skb->sk ? skb->sk->sk_bound_dev_if : 0, 19 .flowi_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0,
20 .mark = skb->mark, 20 .flowi_mark = skb->mark,
21 .fl6_dst = iph->daddr, 21 .fl6_dst = iph->daddr,
22 .fl6_src = iph->saddr, 22 .fl6_src = iph->saddr,
23 }; 23 };
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
index 91f6a61cefab..fd3938803eb3 100644
--- a/net/ipv6/netfilter/ip6t_REJECT.c
+++ b/net/ipv6/netfilter/ip6t_REJECT.c
@@ -90,7 +90,7 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
90 } 90 }
91 91
92 memset(&fl, 0, sizeof(fl)); 92 memset(&fl, 0, sizeof(fl));
93 fl.proto = IPPROTO_TCP; 93 fl.flowi_proto = IPPROTO_TCP;
94 ipv6_addr_copy(&fl.fl6_src, &oip6h->daddr); 94 ipv6_addr_copy(&fl.fl6_src, &oip6h->daddr);
95 ipv6_addr_copy(&fl.fl6_dst, &oip6h->saddr); 95 ipv6_addr_copy(&fl.fl6_dst, &oip6h->saddr);
96 fl.fl_ip_sport = otcph.dest; 96 fl.fl_ip_sport = otcph.dest;
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index dc29b07caf42..323ad44ff775 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -588,9 +588,9 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl,
588 588
589 csum = csum_ipv6_magic(&fl->fl6_src, 589 csum = csum_ipv6_magic(&fl->fl6_src,
590 &fl->fl6_dst, 590 &fl->fl6_dst,
591 total_len, fl->proto, tmp_csum); 591 total_len, fl->flowi_proto, tmp_csum);
592 592
593 if (csum == 0 && fl->proto == IPPROTO_UDP) 593 if (csum == 0 && fl->flowi_proto == IPPROTO_UDP)
594 csum = CSUM_MANGLED_0; 594 csum = CSUM_MANGLED_0;
595 595
596 if (skb_store_bits(skb, offset, &csum, 2)) 596 if (skb_store_bits(skb, offset, &csum, 2))
@@ -679,7 +679,7 @@ static int rawv6_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
679 if (!iov) 679 if (!iov)
680 continue; 680 continue;
681 681
682 switch (fl->proto) { 682 switch (fl->flowi_proto) {
683 case IPPROTO_ICMPV6: 683 case IPPROTO_ICMPV6:
684 /* check if one-byte field is readable or not. */ 684 /* check if one-byte field is readable or not. */
685 if (iov->iov_base && iov->iov_len < 1) 685 if (iov->iov_base && iov->iov_len < 1)
@@ -758,7 +758,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
758 */ 758 */
759 memset(&fl, 0, sizeof(fl)); 759 memset(&fl, 0, sizeof(fl));
760 760
761 fl.mark = sk->sk_mark; 761 fl.flowi_mark = sk->sk_mark;
762 762
763 if (sin6) { 763 if (sin6) {
764 if (addr_len < SIN6_LEN_RFC2133) 764 if (addr_len < SIN6_LEN_RFC2133)
@@ -800,7 +800,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
800 if (addr_len >= sizeof(struct sockaddr_in6) && 800 if (addr_len >= sizeof(struct sockaddr_in6) &&
801 sin6->sin6_scope_id && 801 sin6->sin6_scope_id &&
802 ipv6_addr_type(daddr)&IPV6_ADDR_LINKLOCAL) 802 ipv6_addr_type(daddr)&IPV6_ADDR_LINKLOCAL)
803 fl.oif = sin6->sin6_scope_id; 803 fl.flowi_oif = sin6->sin6_scope_id;
804 } else { 804 } else {
805 if (sk->sk_state != TCP_ESTABLISHED) 805 if (sk->sk_state != TCP_ESTABLISHED)
806 return -EDESTADDRREQ; 806 return -EDESTADDRREQ;
@@ -810,8 +810,8 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
810 fl.fl6_flowlabel = np->flow_label; 810 fl.fl6_flowlabel = np->flow_label;
811 } 811 }
812 812
813 if (fl.oif == 0) 813 if (fl.flowi_oif == 0)
814 fl.oif = sk->sk_bound_dev_if; 814 fl.flowi_oif = sk->sk_bound_dev_if;
815 815
816 if (msg->msg_controllen) { 816 if (msg->msg_controllen) {
817 opt = &opt_space; 817 opt = &opt_space;
@@ -838,7 +838,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
838 opt = fl6_merge_options(&opt_space, flowlabel, opt); 838 opt = fl6_merge_options(&opt_space, flowlabel, opt);
839 opt = ipv6_fixup_options(&opt_space, opt); 839 opt = ipv6_fixup_options(&opt_space, opt);
840 840
841 fl.proto = proto; 841 fl.flowi_proto = proto;
842 err = rawv6_probe_proto_opt(&fl, msg); 842 err = rawv6_probe_proto_opt(&fl, msg);
843 if (err) 843 if (err)
844 goto out; 844 goto out;
@@ -852,8 +852,8 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
852 852
853 final_p = fl6_update_dst(&fl, opt, &final); 853 final_p = fl6_update_dst(&fl, opt, &final);
854 854
855 if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) 855 if (!fl.flowi_oif && ipv6_addr_is_multicast(&fl.fl6_dst))
856 fl.oif = np->mcast_oif; 856 fl.flowi_oif = np->mcast_oif;
857 security_sk_classify_flow(sk, &fl); 857 security_sk_classify_flow(sk, &fl);
858 858
859 dst = ip6_dst_lookup_flow(sk, &fl, final_p, true); 859 dst = ip6_dst_lookup_flow(sk, &fl, final_p, true);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 001276055a6b..c3b20d63921f 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -608,7 +608,7 @@ static struct rt6_info *ip6_pol_route_lookup(struct net *net,
608 fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src); 608 fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
609restart: 609restart:
610 rt = fn->leaf; 610 rt = fn->leaf;
611 rt = rt6_device_match(net, rt, &fl->fl6_src, fl->oif, flags); 611 rt = rt6_device_match(net, rt, &fl->fl6_src, fl->flowi_oif, flags);
612 BACKTRACK(net, &fl->fl6_src); 612 BACKTRACK(net, &fl->fl6_src);
613out: 613out:
614 dst_use(&rt->dst, jiffies); 614 dst_use(&rt->dst, jiffies);
@@ -621,7 +621,7 @@ struct rt6_info *rt6_lookup(struct net *net, const struct in6_addr *daddr,
621 const struct in6_addr *saddr, int oif, int strict) 621 const struct in6_addr *saddr, int oif, int strict)
622{ 622{
623 struct flowi fl = { 623 struct flowi fl = {
624 .oif = oif, 624 .flowi_oif = oif,
625 .fl6_dst = *daddr, 625 .fl6_dst = *daddr,
626 }; 626 };
627 struct dst_entry *dst; 627 struct dst_entry *dst;
@@ -825,7 +825,7 @@ out2:
825static struct rt6_info *ip6_pol_route_input(struct net *net, struct fib6_table *table, 825static struct rt6_info *ip6_pol_route_input(struct net *net, struct fib6_table *table,
826 struct flowi *fl, int flags) 826 struct flowi *fl, int flags)
827{ 827{
828 return ip6_pol_route(net, table, fl->iif, fl, flags); 828 return ip6_pol_route(net, table, fl->flowi_iif, fl, flags);
829} 829}
830 830
831void ip6_route_input(struct sk_buff *skb) 831void ip6_route_input(struct sk_buff *skb)
@@ -834,12 +834,12 @@ void ip6_route_input(struct sk_buff *skb)
834 struct net *net = dev_net(skb->dev); 834 struct net *net = dev_net(skb->dev);
835 int flags = RT6_LOOKUP_F_HAS_SADDR; 835 int flags = RT6_LOOKUP_F_HAS_SADDR;
836 struct flowi fl = { 836 struct flowi fl = {
837 .iif = skb->dev->ifindex, 837 .flowi_iif = skb->dev->ifindex,
838 .fl6_dst = iph->daddr, 838 .fl6_dst = iph->daddr,
839 .fl6_src = iph->saddr, 839 .fl6_src = iph->saddr,
840 .fl6_flowlabel = (* (__be32 *) iph)&IPV6_FLOWINFO_MASK, 840 .fl6_flowlabel = (* (__be32 *) iph)&IPV6_FLOWINFO_MASK,
841 .mark = skb->mark, 841 .flowi_mark = skb->mark,
842 .proto = iph->nexthdr, 842 .flowi_proto = iph->nexthdr,
843 }; 843 };
844 844
845 if (rt6_need_strict(&iph->daddr) && skb->dev->type != ARPHRD_PIMREG) 845 if (rt6_need_strict(&iph->daddr) && skb->dev->type != ARPHRD_PIMREG)
@@ -851,7 +851,7 @@ void ip6_route_input(struct sk_buff *skb)
851static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table, 851static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table,
852 struct flowi *fl, int flags) 852 struct flowi *fl, int flags)
853{ 853{
854 return ip6_pol_route(net, table, fl->oif, fl, flags); 854 return ip6_pol_route(net, table, fl->flowi_oif, fl, flags);
855} 855}
856 856
857struct dst_entry * ip6_route_output(struct net *net, struct sock *sk, 857struct dst_entry * ip6_route_output(struct net *net, struct sock *sk,
@@ -1484,7 +1484,7 @@ restart:
1484 continue; 1484 continue;
1485 if (!(rt->rt6i_flags & RTF_GATEWAY)) 1485 if (!(rt->rt6i_flags & RTF_GATEWAY))
1486 continue; 1486 continue;
1487 if (fl->oif != rt->rt6i_dev->ifindex) 1487 if (fl->flowi_oif != rt->rt6i_dev->ifindex)
1488 continue; 1488 continue;
1489 if (!ipv6_addr_equal(&rdfl->gateway, &rt->rt6i_gateway)) 1489 if (!ipv6_addr_equal(&rdfl->gateway, &rt->rt6i_gateway))
1490 continue; 1490 continue;
@@ -1511,7 +1511,7 @@ static struct rt6_info *ip6_route_redirect(struct in6_addr *dest,
1511 struct net *net = dev_net(dev); 1511 struct net *net = dev_net(dev);
1512 struct ip6rd_flowi rdfl = { 1512 struct ip6rd_flowi rdfl = {
1513 .fl = { 1513 .fl = {
1514 .oif = dev->ifindex, 1514 .flowi_oif = dev->ifindex,
1515 .fl6_dst = *dest, 1515 .fl6_dst = *dest,
1516 .fl6_src = *src, 1516 .fl6_src = *src,
1517 }, 1517 },
@@ -2413,7 +2413,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
2413 iif = nla_get_u32(tb[RTA_IIF]); 2413 iif = nla_get_u32(tb[RTA_IIF]);
2414 2414
2415 if (tb[RTA_OIF]) 2415 if (tb[RTA_OIF])
2416 fl.oif = nla_get_u32(tb[RTA_OIF]); 2416 fl.flowi_oif = nla_get_u32(tb[RTA_OIF]);
2417 2417
2418 if (iif) { 2418 if (iif) {
2419 struct net_device *dev; 2419 struct net_device *dev;
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index 0b4cf350631b..ca5255c08371 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -234,12 +234,12 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
234 struct in6_addr *final_p, final; 234 struct in6_addr *final_p, final;
235 struct flowi fl; 235 struct flowi fl;
236 memset(&fl, 0, sizeof(fl)); 236 memset(&fl, 0, sizeof(fl));
237 fl.proto = IPPROTO_TCP; 237 fl.flowi_proto = IPPROTO_TCP;
238 ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr); 238 ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
239 final_p = fl6_update_dst(&fl, np->opt, &final); 239 final_p = fl6_update_dst(&fl, np->opt, &final);
240 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); 240 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
241 fl.oif = sk->sk_bound_dev_if; 241 fl.flowi_oif = sk->sk_bound_dev_if;
242 fl.mark = sk->sk_mark; 242 fl.flowi_mark = sk->sk_mark;
243 fl.fl_ip_dport = inet_rsk(req)->rmt_port; 243 fl.fl_ip_dport = inet_rsk(req)->rmt_port;
244 fl.fl_ip_sport = inet_sk(sk)->inet_sport; 244 fl.fl_ip_sport = inet_sk(sk)->inet_sport;
245 security_req_classify_flow(req, &fl); 245 security_req_classify_flow(req, &fl);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index e59a31c48baf..a3d1229b4004 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -242,12 +242,12 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
242 if (!ipv6_addr_any(&np->rcv_saddr)) 242 if (!ipv6_addr_any(&np->rcv_saddr))
243 saddr = &np->rcv_saddr; 243 saddr = &np->rcv_saddr;
244 244
245 fl.proto = IPPROTO_TCP; 245 fl.flowi_proto = IPPROTO_TCP;
246 ipv6_addr_copy(&fl.fl6_dst, &np->daddr); 246 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
247 ipv6_addr_copy(&fl.fl6_src, 247 ipv6_addr_copy(&fl.fl6_src,
248 (saddr ? saddr : &np->saddr)); 248 (saddr ? saddr : &np->saddr));
249 fl.oif = sk->sk_bound_dev_if; 249 fl.flowi_oif = sk->sk_bound_dev_if;
250 fl.mark = sk->sk_mark; 250 fl.flowi_mark = sk->sk_mark;
251 fl.fl_ip_dport = usin->sin6_port; 251 fl.fl_ip_dport = usin->sin6_port;
252 fl.fl_ip_sport = inet->inet_sport; 252 fl.fl_ip_sport = inet->inet_sport;
253 253
@@ -396,11 +396,11 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
396 for now. 396 for now.
397 */ 397 */
398 memset(&fl, 0, sizeof(fl)); 398 memset(&fl, 0, sizeof(fl));
399 fl.proto = IPPROTO_TCP; 399 fl.flowi_proto = IPPROTO_TCP;
400 ipv6_addr_copy(&fl.fl6_dst, &np->daddr); 400 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
401 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 401 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
402 fl.oif = sk->sk_bound_dev_if; 402 fl.flowi_oif = sk->sk_bound_dev_if;
403 fl.mark = sk->sk_mark; 403 fl.flowi_mark = sk->sk_mark;
404 fl.fl_ip_dport = inet->inet_dport; 404 fl.fl_ip_dport = inet->inet_dport;
405 fl.fl_ip_sport = inet->inet_sport; 405 fl.fl_ip_sport = inet->inet_sport;
406 security_skb_classify_flow(skb, &fl); 406 security_skb_classify_flow(skb, &fl);
@@ -487,12 +487,12 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
487 int err; 487 int err;
488 488
489 memset(&fl, 0, sizeof(fl)); 489 memset(&fl, 0, sizeof(fl));
490 fl.proto = IPPROTO_TCP; 490 fl.flowi_proto = IPPROTO_TCP;
491 ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr); 491 ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr);
492 ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr); 492 ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr);
493 fl.fl6_flowlabel = 0; 493 fl.fl6_flowlabel = 0;
494 fl.oif = treq->iif; 494 fl.flowi_oif = treq->iif;
495 fl.mark = sk->sk_mark; 495 fl.flowi_mark = sk->sk_mark;
496 fl.fl_ip_dport = inet_rsk(req)->rmt_port; 496 fl.fl_ip_dport = inet_rsk(req)->rmt_port;
497 fl.fl_ip_sport = inet_rsk(req)->loc_port; 497 fl.fl_ip_sport = inet_rsk(req)->loc_port;
498 security_req_classify_flow(req, &fl); 498 security_req_classify_flow(req, &fl);
@@ -1055,8 +1055,8 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,
1055 1055
1056 __tcp_v6_send_check(buff, &fl.fl6_src, &fl.fl6_dst); 1056 __tcp_v6_send_check(buff, &fl.fl6_src, &fl.fl6_dst);
1057 1057
1058 fl.proto = IPPROTO_TCP; 1058 fl.flowi_proto = IPPROTO_TCP;
1059 fl.oif = inet6_iif(skb); 1059 fl.flowi_oif = inet6_iif(skb);
1060 fl.fl_ip_dport = t1->dest; 1060 fl.fl_ip_dport = t1->dest;
1061 fl.fl_ip_sport = t1->source; 1061 fl.fl_ip_sport = t1->source;
1062 security_skb_classify_flow(skb, &fl); 1062 security_skb_classify_flow(skb, &fl);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index d86d7f67a597..91f8047463ec 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -915,7 +915,7 @@ static int udp_v6_push_pending_frames(struct sock *sk)
915 915
916 /* add protocol-dependent pseudo-header */ 916 /* add protocol-dependent pseudo-header */
917 uh->check = csum_ipv6_magic(&fl->fl6_src, &fl->fl6_dst, 917 uh->check = csum_ipv6_magic(&fl->fl6_src, &fl->fl6_dst,
918 up->len, fl->proto, csum ); 918 up->len, fl->flowi_proto, csum);
919 if (uh->check == 0) 919 if (uh->check == 0)
920 uh->check = CSUM_MANGLED_0; 920 uh->check = CSUM_MANGLED_0;
921 921
@@ -1060,7 +1060,7 @@ do_udp_sendmsg:
1060 if (addr_len >= sizeof(struct sockaddr_in6) && 1060 if (addr_len >= sizeof(struct sockaddr_in6) &&
1061 sin6->sin6_scope_id && 1061 sin6->sin6_scope_id &&
1062 ipv6_addr_type(daddr)&IPV6_ADDR_LINKLOCAL) 1062 ipv6_addr_type(daddr)&IPV6_ADDR_LINKLOCAL)
1063 fl.oif = sin6->sin6_scope_id; 1063 fl.flowi_oif = sin6->sin6_scope_id;
1064 } else { 1064 } else {
1065 if (sk->sk_state != TCP_ESTABLISHED) 1065 if (sk->sk_state != TCP_ESTABLISHED)
1066 return -EDESTADDRREQ; 1066 return -EDESTADDRREQ;
@@ -1071,13 +1071,13 @@ do_udp_sendmsg:
1071 connected = 1; 1071 connected = 1;
1072 } 1072 }
1073 1073
1074 if (!fl.oif) 1074 if (!fl.flowi_oif)
1075 fl.oif = sk->sk_bound_dev_if; 1075 fl.flowi_oif = sk->sk_bound_dev_if;
1076 1076
1077 if (!fl.oif) 1077 if (!fl.flowi_oif)
1078 fl.oif = np->sticky_pktinfo.ipi6_ifindex; 1078 fl.flowi_oif = np->sticky_pktinfo.ipi6_ifindex;
1079 1079
1080 fl.mark = sk->sk_mark; 1080 fl.flowi_mark = sk->sk_mark;
1081 1081
1082 if (msg->msg_controllen) { 1082 if (msg->msg_controllen) {
1083 opt = &opt_space; 1083 opt = &opt_space;
@@ -1105,7 +1105,7 @@ do_udp_sendmsg:
1105 opt = fl6_merge_options(&opt_space, flowlabel, opt); 1105 opt = fl6_merge_options(&opt_space, flowlabel, opt);
1106 opt = ipv6_fixup_options(&opt_space, opt); 1106 opt = ipv6_fixup_options(&opt_space, opt);
1107 1107
1108 fl.proto = sk->sk_protocol; 1108 fl.flowi_proto = sk->sk_protocol;
1109 if (!ipv6_addr_any(daddr)) 1109 if (!ipv6_addr_any(daddr))
1110 ipv6_addr_copy(&fl.fl6_dst, daddr); 1110 ipv6_addr_copy(&fl.fl6_dst, daddr);
1111 else 1111 else
@@ -1118,8 +1118,8 @@ do_udp_sendmsg:
1118 if (final_p) 1118 if (final_p)
1119 connected = 0; 1119 connected = 0;
1120 1120
1121 if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) { 1121 if (!fl.flowi_oif && ipv6_addr_is_multicast(&fl.fl6_dst)) {
1122 fl.oif = np->mcast_oif; 1122 fl.flowi_oif = np->mcast_oif;
1123 connected = 0; 1123 connected = 0;
1124 } 1124 }
1125 1125
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 48ce496802fd..d62496c1a6f9 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -128,7 +128,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
128 u8 nexthdr = nh[IP6CB(skb)->nhoff]; 128 u8 nexthdr = nh[IP6CB(skb)->nhoff];
129 129
130 memset(fl, 0, sizeof(struct flowi)); 130 memset(fl, 0, sizeof(struct flowi));
131 fl->mark = skb->mark; 131 fl->flowi_mark = skb->mark;
132 132
133 ipv6_addr_copy(&fl->fl6_dst, reverse ? &hdr->saddr : &hdr->daddr); 133 ipv6_addr_copy(&fl->fl6_dst, reverse ? &hdr->saddr : &hdr->daddr);
134 ipv6_addr_copy(&fl->fl6_src, reverse ? &hdr->daddr : &hdr->saddr); 134 ipv6_addr_copy(&fl->fl6_src, reverse ? &hdr->daddr : &hdr->saddr);
@@ -161,7 +161,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
161 fl->fl_ip_sport = ports[!!reverse]; 161 fl->fl_ip_sport = ports[!!reverse];
162 fl->fl_ip_dport = ports[!reverse]; 162 fl->fl_ip_dport = ports[!reverse];
163 } 163 }
164 fl->proto = nexthdr; 164 fl->flowi_proto = nexthdr;
165 return; 165 return;
166 166
167 case IPPROTO_ICMPV6: 167 case IPPROTO_ICMPV6:
@@ -171,7 +171,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
171 fl->fl_icmp_type = icmp[0]; 171 fl->fl_icmp_type = icmp[0];
172 fl->fl_icmp_code = icmp[1]; 172 fl->fl_icmp_code = icmp[1];
173 } 173 }
174 fl->proto = nexthdr; 174 fl->flowi_proto = nexthdr;
175 return; 175 return;
176 176
177#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) 177#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
@@ -182,7 +182,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
182 182
183 fl->fl_mh_type = mh->ip6mh_type; 183 fl->fl_mh_type = mh->ip6mh_type;
184 } 184 }
185 fl->proto = nexthdr; 185 fl->flowi_proto = nexthdr;
186 return; 186 return;
187#endif 187#endif
188 188
@@ -192,7 +192,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
192 case IPPROTO_COMP: 192 case IPPROTO_COMP:
193 default: 193 default:
194 fl->fl_ipsec_spi = 0; 194 fl->fl_ipsec_spi = 0;
195 fl->proto = nexthdr; 195 fl->flowi_proto = nexthdr;
196 return; 196 return;
197 } 197 }
198 } 198 }
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index a02598e0079a..805d0e14c331 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -33,8 +33,8 @@ __xfrm6_init_tempsel(struct xfrm_selector *sel, const struct flowi *fl)
33 sel->family = AF_INET6; 33 sel->family = AF_INET6;
34 sel->prefixlen_d = 128; 34 sel->prefixlen_d = 128;
35 sel->prefixlen_s = 128; 35 sel->prefixlen_s = 128;
36 sel->proto = fl->proto; 36 sel->proto = fl->flowi_proto;
37 sel->ifindex = fl->oif; 37 sel->ifindex = fl->flowi_oif;
38} 38}
39 39
40static void 40static void
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index d69ec26b6bd4..d07a32aa07b6 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -76,7 +76,7 @@ static int __ip_vs_addr_is_local_v6(struct net *net,
76{ 76{
77 struct rt6_info *rt; 77 struct rt6_info *rt;
78 struct flowi fl = { 78 struct flowi fl = {
79 .oif = 0, 79 .flowi_oif = 0,
80 .fl6_dst = *addr, 80 .fl6_dst = *addr,
81 .fl6_src = { .s6_addr32 = {0, 0, 0, 0} }, 81 .fl6_src = { .s6_addr32 = {0, 0, 0, 0} },
82 }; 82 };
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index faf381d9da7c..cc8071f68903 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -169,7 +169,7 @@ __ip_vs_reroute_locally(struct sk_buff *skb)
169 .fl4_dst = iph->daddr, 169 .fl4_dst = iph->daddr,
170 .fl4_src = iph->saddr, 170 .fl4_src = iph->saddr,
171 .fl4_tos = RT_TOS(iph->tos), 171 .fl4_tos = RT_TOS(iph->tos),
172 .mark = skb->mark, 172 .flowi_mark = skb->mark,
173 }; 173 };
174 174
175 rt = ip_route_output_key(net, &fl); 175 rt = ip_route_output_key(net, &fl);
diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c
index 624725b5286f..cb14ae2de15d 100644
--- a/net/netfilter/xt_TEE.c
+++ b/net/netfilter/xt_TEE.c
@@ -68,7 +68,7 @@ tee_tg_route4(struct sk_buff *skb, const struct xt_tee_tginfo *info)
68 if (info->priv) { 68 if (info->priv) {
69 if (info->priv->oif == -1) 69 if (info->priv->oif == -1)
70 return false; 70 return false;
71 fl.oif = info->priv->oif; 71 fl.flowi_oif = info->priv->oif;
72 } 72 }
73 fl.fl4_dst = info->gw.ip; 73 fl.fl4_dst = info->gw.ip;
74 fl.fl4_tos = RT_TOS(iph->tos); 74 fl.fl4_tos = RT_TOS(iph->tos);
@@ -149,7 +149,7 @@ tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info)
149 if (info->priv) { 149 if (info->priv) {
150 if (info->priv->oif == -1) 150 if (info->priv->oif == -1)
151 return false; 151 return false;
152 fl.oif = info->priv->oif; 152 fl.flowi_oif = info->priv->oif;
153 } 153 }
154 fl.fl6_dst = info->gw.in6; 154 fl.fl6_dst = info->gw.in6;
155 fl.fl6_flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) | 155 fl.fl6_flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) |
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 95e0c8eda1a0..831627156884 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -205,7 +205,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)
205 205
206 memset(&fl, 0, sizeof(fl)); 206 memset(&fl, 0, sizeof(fl));
207 207
208 fl.proto = sk->sk_protocol; 208 fl.flowi_proto = sk->sk_protocol;
209 209
210 /* Fill in the dest address from the route entry passed with the skb 210 /* Fill in the dest address from the route entry passed with the skb
211 * and the source address from the transport. 211 * and the source address from the transport.
@@ -216,9 +216,9 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)
216 fl.fl6_flowlabel = np->flow_label; 216 fl.fl6_flowlabel = np->flow_label;
217 IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel); 217 IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
218 if (ipv6_addr_type(&fl.fl6_src) & IPV6_ADDR_LINKLOCAL) 218 if (ipv6_addr_type(&fl.fl6_src) & IPV6_ADDR_LINKLOCAL)
219 fl.oif = transport->saddr.v6.sin6_scope_id; 219 fl.flowi_oif = transport->saddr.v6.sin6_scope_id;
220 else 220 else
221 fl.oif = sk->sk_bound_dev_if; 221 fl.flowi_oif = sk->sk_bound_dev_if;
222 222
223 if (np->opt && np->opt->srcrt) { 223 if (np->opt && np->opt->srcrt) {
224 struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; 224 struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
@@ -250,7 +250,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
250 memset(&fl, 0, sizeof(fl)); 250 memset(&fl, 0, sizeof(fl));
251 ipv6_addr_copy(&fl.fl6_dst, &daddr->v6.sin6_addr); 251 ipv6_addr_copy(&fl.fl6_dst, &daddr->v6.sin6_addr);
252 if (ipv6_addr_type(&daddr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) 252 if (ipv6_addr_type(&daddr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL)
253 fl.oif = daddr->v6.sin6_scope_id; 253 fl.flowi_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__, &fl.fl6_dst);
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 4e55e6c49ec9..832665ac2100 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -477,10 +477,10 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
477 memset(&fl, 0x0, sizeof(struct flowi)); 477 memset(&fl, 0x0, sizeof(struct flowi));
478 fl.fl4_dst = daddr->v4.sin_addr.s_addr; 478 fl.fl4_dst = daddr->v4.sin_addr.s_addr;
479 fl.fl_ip_dport = daddr->v4.sin_port; 479 fl.fl_ip_dport = daddr->v4.sin_port;
480 fl.proto = IPPROTO_SCTP; 480 fl.flowi_proto = IPPROTO_SCTP;
481 if (asoc) { 481 if (asoc) {
482 fl.fl4_tos = RT_CONN_FLAGS(asoc->base.sk); 482 fl.fl4_tos = RT_CONN_FLAGS(asoc->base.sk);
483 fl.oif = asoc->base.sk->sk_bound_dev_if; 483 fl.flowi_oif = asoc->base.sk->sk_bound_dev_if;
484 fl.fl_ip_sport = htons(asoc->base.bind_addr.port); 484 fl.fl_ip_sport = htons(asoc->base.bind_addr.port);
485 } 485 }
486 if (saddr) { 486 if (saddr) {
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 9e4aacda26cc..dd6243f9d933 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -63,8 +63,8 @@ __xfrm4_selector_match(const struct xfrm_selector *sel, const struct flowi *fl)
63 addr_match(&fl->fl4_src, &sel->saddr, sel->prefixlen_s) && 63 addr_match(&fl->fl4_src, &sel->saddr, sel->prefixlen_s) &&
64 !((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) && 64 !((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) &&
65 !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) && 65 !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) &&
66 (fl->proto == sel->proto || !sel->proto) && 66 (fl->flowi_proto == sel->proto || !sel->proto) &&
67 (fl->oif == sel->ifindex || !sel->ifindex); 67 (fl->flowi_oif == sel->ifindex || !sel->ifindex);
68} 68}
69 69
70static inline int 70static inline int
@@ -74,8 +74,8 @@ __xfrm6_selector_match(const struct xfrm_selector *sel, const struct flowi *fl)
74 addr_match(&fl->fl6_src, &sel->saddr, sel->prefixlen_s) && 74 addr_match(&fl->fl6_src, &sel->saddr, sel->prefixlen_s) &&
75 !((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) && 75 !((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) &&
76 !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) && 76 !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) &&
77 (fl->proto == sel->proto || !sel->proto) && 77 (fl->flowi_proto == sel->proto || !sel->proto) &&
78 (fl->oif == sel->ifindex || !sel->ifindex); 78 (fl->flowi_oif == sel->ifindex || !sel->ifindex);
79} 79}
80 80
81int xfrm_selector_match(const struct xfrm_selector *sel, const struct flowi *fl, 81int xfrm_selector_match(const struct xfrm_selector *sel, const struct flowi *fl,
@@ -876,13 +876,13 @@ static int xfrm_policy_match(const struct xfrm_policy *pol,
876 int match, ret = -ESRCH; 876 int match, ret = -ESRCH;
877 877
878 if (pol->family != family || 878 if (pol->family != family ||
879 (fl->mark & pol->mark.m) != pol->mark.v || 879 (fl->flowi_mark & pol->mark.m) != pol->mark.v ||
880 pol->type != type) 880 pol->type != type)
881 return ret; 881 return ret;
882 882
883 match = xfrm_selector_match(sel, fl, family); 883 match = xfrm_selector_match(sel, fl, family);
884 if (match) 884 if (match)
885 ret = security_xfrm_policy_lookup(pol->security, fl->secid, 885 ret = security_xfrm_policy_lookup(pol->security, fl->flowi_secid,
886 dir); 886 dir);
887 887
888 return ret; 888 return ret;
@@ -1012,7 +1012,7 @@ static struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir,
1012 goto out; 1012 goto out;
1013 } 1013 }
1014 err = security_xfrm_policy_lookup(pol->security, 1014 err = security_xfrm_policy_lookup(pol->security,
1015 fl->secid, 1015 fl->flowi_secid,
1016 policy_to_flow_dir(dir)); 1016 policy_to_flow_dir(dir));
1017 if (!err) 1017 if (!err)
1018 xfrm_pol_hold(pol); 1018 xfrm_pol_hold(pol);
@@ -1848,7 +1848,7 @@ restart:
1848 1848
1849 return make_blackhole(net, family, dst_orig); 1849 return make_blackhole(net, family, dst_orig);
1850 } 1850 }
1851 if (fl->flags & FLOWI_FLAG_CAN_SLEEP) { 1851 if (fl->flowi_flags & FLOWI_FLAG_CAN_SLEEP) {
1852 DECLARE_WAITQUEUE(wait, current); 1852 DECLARE_WAITQUEUE(wait, current);
1853 1853
1854 add_wait_queue(&net->xfrm.km_waitq, &wait); 1854 add_wait_queue(&net->xfrm.km_waitq, &wait);
@@ -1990,7 +1990,7 @@ int __xfrm_decode_session(struct sk_buff *skb, struct flowi *fl,
1990 return -EAFNOSUPPORT; 1990 return -EAFNOSUPPORT;
1991 1991
1992 afinfo->decode_session(skb, fl, reverse); 1992 afinfo->decode_session(skb, fl, reverse);
1993 err = security_xfrm_decode_session(skb, &fl->secid); 1993 err = security_xfrm_decode_session(skb, &fl->flowi_secid);
1994 xfrm_policy_put_afinfo(afinfo); 1994 xfrm_policy_put_afinfo(afinfo);
1995 return err; 1995 return err;
1996} 1996}
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 81221d9cbf06..cd6be49f2ae8 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -859,7 +859,7 @@ found:
859 xfrm_init_tempstate(x, fl, tmpl, daddr, saddr, family); 859 xfrm_init_tempstate(x, fl, tmpl, daddr, saddr, family);
860 memcpy(&x->mark, &pol->mark, sizeof(x->mark)); 860 memcpy(&x->mark, &pol->mark, sizeof(x->mark));
861 861
862 error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid); 862 error = security_xfrm_state_alloc_acquire(x, pol->security, fl->flowi_secid);
863 if (error) { 863 if (error) {
864 x->km.state = XFRM_STATE_DEAD; 864 x->km.state = XFRM_STATE_DEAD;
865 to_put = x; 865 to_put = x;