diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/fib_frontend.c | 12 | ||||
-rw-r--r-- | net/ipv4/fib_semantics.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_trie.c | 2 | ||||
-rw-r--r-- | net/ipv4/icmp.c | 12 | ||||
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 22 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 18 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 12 | ||||
-rw-r--r-- | net/ipv4/netfilter.c | 6 | ||||
-rw-r--r-- | net/ipv4/raw.c | 10 | ||||
-rw-r--r-- | net/ipv4/route.c | 72 | ||||
-rw-r--r-- | net/ipv4/syncookies.c | 20 | ||||
-rw-r--r-- | net/ipv4/udp.c | 21 | ||||
-rw-r--r-- | net/ipv4/xfrm4_policy.c | 10 | ||||
-rw-r--r-- | net/ipv4/xfrm4_state.c | 4 |
14 files changed, 116 insertions, 107 deletions
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 | ||
2614 | make_route: | 2614 | make_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 | ||
2624 | out: | 2624 | out: |
@@ -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 | ||
39 | static void | 39 | static void |