aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/flow.h21
-rw-r--r--include/net/route.h43
-rw-r--r--include/net/xfrm.h18
-rw-r--r--net/dccp/ipv4.c4
-rw-r--r--net/dccp/ipv6.c20
-rw-r--r--net/ipv4/icmp.c4
-rw-r--r--net/ipv4/inet_connection_sock.c4
-rw-r--r--net/ipv4/ip_output.c4
-rw-r--r--net/ipv4/netfilter/nf_nat_standalone.c4
-rw-r--r--net/ipv4/raw.c4
-rw-r--r--net/ipv4/syncookies.c4
-rw-r--r--net/ipv4/udp.c10
-rw-r--r--net/ipv4/xfrm4_policy.c18
-rw-r--r--net/ipv4/xfrm4_state.c4
-rw-r--r--net/ipv6/af_inet6.c4
-rw-r--r--net/ipv6/datagram.c6
-rw-r--r--net/ipv6/icmp.c10
-rw-r--r--net/ipv6/inet6_connection_sock.c8
-rw-r--r--net/ipv6/mip6.c6
-rw-r--r--net/ipv6/netfilter/ip6t_REJECT.c4
-rw-r--r--net/ipv6/raw.c6
-rw-r--r--net/ipv6/syncookies.c4
-rw-r--r--net/ipv6/tcp_ipv6.c16
-rw-r--r--net/ipv6/udp.c10
-rw-r--r--net/ipv6/xfrm6_policy.c12
-rw-r--r--net/ipv6/xfrm6_state.c4
-rw-r--r--net/sctp/protocol.c8
-rw-r--r--net/xfrm/xfrm_policy.c8
28 files changed, 139 insertions, 129 deletions
diff --git a/include/net/flow.h b/include/net/flow.h
index 541ac13f245a..f19f41d7dafc 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -89,13 +89,20 @@ struct flowi {
89#define fl4_scope flowi_scope 89#define fl4_scope flowi_scope
90 90
91 union flowi_uli uli_u; 91 union flowi_uli uli_u;
92#define fl_ip_sport uli_u.ports.sport 92#define fl4_sport uli_u.ports.sport
93#define fl_ip_dport uli_u.ports.dport 93#define fl4_dport uli_u.ports.dport
94#define fl_icmp_type uli_u.icmpt.type 94#define fl4_icmp_type uli_u.icmpt.type
95#define fl_icmp_code uli_u.icmpt.code 95#define fl4_icmp_code uli_u.icmpt.code
96#define fl_ipsec_spi uli_u.spi 96#define fl4_ipsec_spi uli_u.spi
97#define fl_mh_type uli_u.mht.type 97#define fl4_mh_type uli_u.mht.type
98#define fl_gre_key uli_u.gre_key 98#define fl4_gre_key uli_u.gre_key
99#define fl6_sport uli_u.ports.sport
100#define fl6_dport uli_u.ports.dport
101#define fl6_icmp_type uli_u.icmpt.type
102#define fl6_icmp_code uli_u.icmpt.code
103#define fl6_ipsec_spi uli_u.spi
104#define fl6_mh_type uli_u.mht.type
105#define fl6_gre_key uli_u.gre_key
99} __attribute__((__aligned__(BITS_PER_LONG/8))); 106} __attribute__((__aligned__(BITS_PER_LONG/8)));
100 107
101#define FLOW_DIR_IN 0 108#define FLOW_DIR_IN 0
diff --git a/include/net/route.h b/include/net/route.h
index 3d814f84abd0..4c207f9fe0cb 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -157,8 +157,8 @@ static inline struct rtable *ip_route_output_ports(struct net *net, struct sock
157 .fl4_src = saddr, 157 .fl4_src = saddr,
158 .fl4_tos = tos, 158 .fl4_tos = tos,
159 .flowi_proto = proto, 159 .flowi_proto = proto,
160 .fl_ip_dport = dport, 160 .fl4_dport = dport,
161 .fl_ip_sport = sport, 161 .fl4_sport = sport,
162 }; 162 };
163 if (sk) 163 if (sk)
164 security_sk_classify_flow(sk, &fl); 164 security_sk_classify_flow(sk, &fl);
@@ -175,7 +175,7 @@ static inline struct rtable *ip_route_output_gre(struct net *net,
175 .fl4_src = saddr, 175 .fl4_src = saddr,
176 .fl4_tos = tos, 176 .fl4_tos = tos,
177 .flowi_proto = IPPROTO_GRE, 177 .flowi_proto = IPPROTO_GRE,
178 .fl_gre_key = gre_key, 178 .fl4_gre_key = gre_key,
179 }; 179 };
180 return ip_route_output_key(net, &fl); 180 return ip_route_output_key(net, &fl);
181} 181}
@@ -228,14 +228,16 @@ static inline struct rtable *ip_route_connect(__be32 dst, __be32 src, u32 tos,
228 __be16 sport, __be16 dport, 228 __be16 sport, __be16 dport,
229 struct sock *sk, bool can_sleep) 229 struct sock *sk, bool can_sleep)
230{ 230{
231 struct flowi fl = { .flowi_oif = oif, 231 struct flowi fl = {
232 .flowi_mark = sk->sk_mark, 232 .flowi_oif = oif,
233 .fl4_dst = dst, 233 .flowi_mark = sk->sk_mark,
234 .fl4_src = src, 234 .fl4_dst = dst,
235 .fl4_tos = tos, 235 .fl4_src = src,
236 .flowi_proto = protocol, 236 .fl4_tos = tos,
237 .fl_ip_sport = sport, 237 .flowi_proto = protocol,
238 .fl_ip_dport = dport }; 238 .fl4_sport = sport,
239 .fl4_dport = dport,
240 };
239 struct net *net = sock_net(sk); 241 struct net *net = sock_net(sk);
240 struct rtable *rt; 242 struct rtable *rt;
241 243
@@ -264,15 +266,16 @@ static inline struct rtable *ip_route_newports(struct rtable *rt,
264 __be16 dport, struct sock *sk) 266 __be16 dport, struct sock *sk)
265{ 267{
266 if (sport != orig_sport || dport != orig_dport) { 268 if (sport != orig_sport || dport != orig_dport) {
267 struct flowi fl = { .flowi_oif = rt->rt_oif, 269 struct flowi fl = {
268 .flowi_mark = rt->rt_mark, 270 .flowi_oif = rt->rt_oif,
269 .fl4_dst = rt->rt_key_dst, 271 .flowi_mark = rt->rt_mark,
270 .fl4_src = rt->rt_key_src, 272 .fl4_dst = rt->rt_key_dst,
271 .fl4_tos = rt->rt_tos, 273 .fl4_src = rt->rt_key_src,
272 .flowi_proto = protocol, 274 .fl4_tos = rt->rt_tos,
273 .fl_ip_sport = sport, 275 .flowi_proto = protocol,
274 .fl_ip_dport = dport }; 276 .fl4_sport = sport,
275 277 .fl4_dport = dport
278 };
276 if (inet_sk(sk)->transparent) 279 if (inet_sk(sk)->transparent)
277 fl.flowi_flags |= FLOWI_FLAG_ANYSRC; 280 fl.flowi_flags |= FLOWI_FLAG_ANYSRC;
278 if (protocol == IPPROTO_TCP) 281 if (protocol == IPPROTO_TCP)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index d5a12d10a0d4..aa860add570b 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -800,7 +800,7 @@ static inline bool addr_match(const void *token1, const void *token2,
800} 800}
801 801
802static __inline__ 802static __inline__
803__be16 xfrm_flowi_sport(const struct flowi *fl) 803__be16 xfrm_flowi_sport(const struct flowi *fl, const union flowi_uli *uli)
804{ 804{
805 __be16 port; 805 __be16 port;
806 switch(fl->flowi_proto) { 806 switch(fl->flowi_proto) {
@@ -808,17 +808,17 @@ __be16 xfrm_flowi_sport(const struct flowi *fl)
808 case IPPROTO_UDP: 808 case IPPROTO_UDP:
809 case IPPROTO_UDPLITE: 809 case IPPROTO_UDPLITE:
810 case IPPROTO_SCTP: 810 case IPPROTO_SCTP:
811 port = fl->fl_ip_sport; 811 port = uli->ports.sport;
812 break; 812 break;
813 case IPPROTO_ICMP: 813 case IPPROTO_ICMP:
814 case IPPROTO_ICMPV6: 814 case IPPROTO_ICMPV6:
815 port = htons(fl->fl_icmp_type); 815 port = htons(uli->icmpt.type);
816 break; 816 break;
817 case IPPROTO_MH: 817 case IPPROTO_MH:
818 port = htons(fl->fl_mh_type); 818 port = htons(uli->mht.type);
819 break; 819 break;
820 case IPPROTO_GRE: 820 case IPPROTO_GRE:
821 port = htons(ntohl(fl->fl_gre_key) >> 16); 821 port = htons(ntohl(uli->gre_key) >> 16);
822 break; 822 break;
823 default: 823 default:
824 port = 0; /*XXX*/ 824 port = 0; /*XXX*/
@@ -827,7 +827,7 @@ __be16 xfrm_flowi_sport(const struct flowi *fl)
827} 827}
828 828
829static __inline__ 829static __inline__
830__be16 xfrm_flowi_dport(const struct flowi *fl) 830__be16 xfrm_flowi_dport(const struct flowi *fl, const union flowi_uli *uli)
831{ 831{
832 __be16 port; 832 __be16 port;
833 switch(fl->flowi_proto) { 833 switch(fl->flowi_proto) {
@@ -835,14 +835,14 @@ __be16 xfrm_flowi_dport(const struct flowi *fl)
835 case IPPROTO_UDP: 835 case IPPROTO_UDP:
836 case IPPROTO_UDPLITE: 836 case IPPROTO_UDPLITE:
837 case IPPROTO_SCTP: 837 case IPPROTO_SCTP:
838 port = fl->fl_ip_dport; 838 port = uli->ports.dport;
839 break; 839 break;
840 case IPPROTO_ICMP: 840 case IPPROTO_ICMP:
841 case IPPROTO_ICMPV6: 841 case IPPROTO_ICMPV6:
842 port = htons(fl->fl_icmp_code); 842 port = htons(uli->icmpt.code);
843 break; 843 break;
844 case IPPROTO_GRE: 844 case IPPROTO_GRE:
845 port = htons(ntohl(fl->fl_gre_key) & 0xffff); 845 port = htons(ntohl(uli->gre_key) & 0xffff);
846 break; 846 break;
847 default: 847 default:
848 port = 0; /*XXX*/ 848 port = 0; /*XXX*/
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 09a09911c5ea..d934b2040230 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -471,8 +471,8 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
471 .fl4_src = ip_hdr(skb)->daddr, 471 .fl4_src = ip_hdr(skb)->daddr,
472 .fl4_tos = RT_CONN_FLAGS(sk), 472 .fl4_tos = RT_CONN_FLAGS(sk),
473 .flowi_proto = sk->sk_protocol, 473 .flowi_proto = sk->sk_protocol,
474 .fl_ip_sport = dccp_hdr(skb)->dccph_dport, 474 .fl4_sport = dccp_hdr(skb)->dccph_dport,
475 .fl_ip_dport = dccp_hdr(skb)->dccph_sport, 475 .fl4_dport = dccp_hdr(skb)->dccph_sport,
476 }; 476 };
477 477
478 security_skb_classify_flow(skb, &fl); 478 security_skb_classify_flow(skb, &fl);
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 5209ee7a3dc2..2b351c6da49a 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -158,8 +158,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
158 ipv6_addr_copy(&fl.fl6_dst, &np->daddr); 158 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
159 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 159 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
160 fl.flowi_oif = sk->sk_bound_dev_if; 160 fl.flowi_oif = sk->sk_bound_dev_if;
161 fl.fl_ip_dport = inet->inet_dport; 161 fl.fl6_dport = inet->inet_dport;
162 fl.fl_ip_sport = inet->inet_sport; 162 fl.fl6_sport = inet->inet_sport;
163 security_sk_classify_flow(sk, &fl); 163 security_sk_classify_flow(sk, &fl);
164 164
165 dst = ip6_dst_lookup_flow(sk, &fl, NULL, false); 165 dst = ip6_dst_lookup_flow(sk, &fl, NULL, false);
@@ -253,8 +253,8 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
253 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); 253 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
254 fl.fl6_flowlabel = 0; 254 fl.fl6_flowlabel = 0;
255 fl.flowi_oif = ireq6->iif; 255 fl.flowi_oif = ireq6->iif;
256 fl.fl_ip_dport = inet_rsk(req)->rmt_port; 256 fl.fl6_dport = inet_rsk(req)->rmt_port;
257 fl.fl_ip_sport = inet_rsk(req)->loc_port; 257 fl.fl6_sport = inet_rsk(req)->loc_port;
258 security_req_classify_flow(req, &fl); 258 security_req_classify_flow(req, &fl);
259 259
260 opt = np->opt; 260 opt = np->opt;
@@ -323,8 +323,8 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
323 323
324 fl.flowi_proto = IPPROTO_DCCP; 324 fl.flowi_proto = IPPROTO_DCCP;
325 fl.flowi_oif = inet6_iif(rxskb); 325 fl.flowi_oif = inet6_iif(rxskb);
326 fl.fl_ip_dport = dccp_hdr(skb)->dccph_dport; 326 fl.fl6_dport = dccp_hdr(skb)->dccph_dport;
327 fl.fl_ip_sport = dccp_hdr(skb)->dccph_sport; 327 fl.fl6_sport = dccp_hdr(skb)->dccph_sport;
328 security_skb_classify_flow(rxskb, &fl); 328 security_skb_classify_flow(rxskb, &fl);
329 329
330 /* sk = NULL, but it is safe for now. RST socket required. */ 330 /* sk = NULL, but it is safe for now. RST socket required. */
@@ -535,8 +535,8 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
535 final_p = fl6_update_dst(&fl, opt, &final); 535 final_p = fl6_update_dst(&fl, opt, &final);
536 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); 536 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
537 fl.flowi_oif = sk->sk_bound_dev_if; 537 fl.flowi_oif = sk->sk_bound_dev_if;
538 fl.fl_ip_dport = inet_rsk(req)->rmt_port; 538 fl.fl6_dport = inet_rsk(req)->rmt_port;
539 fl.fl_ip_sport = inet_rsk(req)->loc_port; 539 fl.fl6_sport = inet_rsk(req)->loc_port;
540 security_sk_classify_flow(sk, &fl); 540 security_sk_classify_flow(sk, &fl);
541 541
542 dst = ip6_dst_lookup_flow(sk, &fl, final_p, false); 542 dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
@@ -957,8 +957,8 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
957 ipv6_addr_copy(&fl.fl6_dst, &np->daddr); 957 ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
958 ipv6_addr_copy(&fl.fl6_src, saddr ? saddr : &np->saddr); 958 ipv6_addr_copy(&fl.fl6_src, saddr ? saddr : &np->saddr);
959 fl.flowi_oif = sk->sk_bound_dev_if; 959 fl.flowi_oif = sk->sk_bound_dev_if;
960 fl.fl_ip_dport = usin->sin6_port; 960 fl.fl6_dport = usin->sin6_port;
961 fl.fl_ip_sport = inet->inet_sport; 961 fl.fl6_sport = inet->inet_sport;
962 security_sk_classify_flow(sk, &fl); 962 security_sk_classify_flow(sk, &fl);
963 963
964 final_p = fl6_update_dst(&fl, np->opt, &final); 964 final_p = fl6_update_dst(&fl, np->opt, &final);
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 3fde7f23c70b..8d091954625b 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -384,8 +384,8 @@ static struct rtable *icmp_route_lookup(struct net *net, struct sk_buff *skb_in,
384 .fl4_src = saddr, 384 .fl4_src = saddr,
385 .fl4_tos = RT_TOS(tos), 385 .fl4_tos = RT_TOS(tos),
386 .flowi_proto = IPPROTO_ICMP, 386 .flowi_proto = IPPROTO_ICMP,
387 .fl_icmp_type = type, 387 .fl4_icmp_type = type,
388 .fl_icmp_code = code, 388 .fl4_icmp_code = code,
389 }; 389 };
390 struct rtable *rt, *rt2; 390 struct rtable *rt, *rt2;
391 int err; 391 int err;
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 97081702dffd..10a8e9523578 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -365,8 +365,8 @@ struct dst_entry *inet_csk_route_req(struct sock *sk,
365 .fl4_tos = RT_CONN_FLAGS(sk), 365 .fl4_tos = RT_CONN_FLAGS(sk),
366 .flowi_proto = sk->sk_protocol, 366 .flowi_proto = sk->sk_protocol,
367 .flowi_flags = inet_sk_flowi_flags(sk), 367 .flowi_flags = inet_sk_flowi_flags(sk),
368 .fl_ip_sport = inet_sk(sk)->inet_sport, 368 .fl4_sport = inet_sk(sk)->inet_sport,
369 .fl_ip_dport = ireq->rmt_port, 369 .fl4_dport = ireq->rmt_port,
370 }; 370 };
371 struct net *net = sock_net(sk); 371 struct net *net = sock_net(sk);
372 372
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index e35ca40df03b..67e5f7130322 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1479,8 +1479,8 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
1479 .fl4_dst = daddr, 1479 .fl4_dst = daddr,
1480 .fl4_src = rt->rt_spec_dst, 1480 .fl4_src = rt->rt_spec_dst,
1481 .fl4_tos = RT_TOS(ip_hdr(skb)->tos), 1481 .fl4_tos = RT_TOS(ip_hdr(skb)->tos),
1482 .fl_ip_sport = tcp_hdr(skb)->dest, 1482 .fl4_sport = tcp_hdr(skb)->dest,
1483 .fl_ip_dport = tcp_hdr(skb)->source, 1483 .fl4_dport = tcp_hdr(skb)->source,
1484 .flowi_proto = sk->sk_protocol, 1484 .flowi_proto = sk->sk_protocol,
1485 .flowi_flags = ip_reply_arg_flowi_flags(arg), 1485 .flowi_flags = ip_reply_arg_flowi_flags(arg),
1486 }; 1486 };
diff --git a/net/ipv4/netfilter/nf_nat_standalone.c b/net/ipv4/netfilter/nf_nat_standalone.c
index 95481fee8bdb..1f3c695a47c8 100644
--- a/net/ipv4/netfilter/nf_nat_standalone.c
+++ b/net/ipv4/netfilter/nf_nat_standalone.c
@@ -55,7 +55,7 @@ static void nat_decode_session(struct sk_buff *skb, struct flowi *fl)
55 t->dst.protonum == IPPROTO_UDPLITE || 55 t->dst.protonum == IPPROTO_UDPLITE ||
56 t->dst.protonum == IPPROTO_DCCP || 56 t->dst.protonum == IPPROTO_DCCP ||
57 t->dst.protonum == IPPROTO_SCTP) 57 t->dst.protonum == IPPROTO_SCTP)
58 fl->fl_ip_dport = t->dst.u.tcp.port; 58 fl->fl4_dport = t->dst.u.tcp.port;
59 } 59 }
60 60
61 statusbit ^= IPS_NAT_MASK; 61 statusbit ^= IPS_NAT_MASK;
@@ -67,7 +67,7 @@ static void nat_decode_session(struct sk_buff *skb, struct flowi *fl)
67 t->dst.protonum == IPPROTO_UDPLITE || 67 t->dst.protonum == IPPROTO_UDPLITE ||
68 t->dst.protonum == IPPROTO_DCCP || 68 t->dst.protonum == IPPROTO_DCCP ||
69 t->dst.protonum == IPPROTO_SCTP) 69 t->dst.protonum == IPPROTO_SCTP)
70 fl->fl_ip_sport = t->src.u.tcp.port; 70 fl->fl4_sport = t->src.u.tcp.port;
71 } 71 }
72} 72}
73#endif 73#endif
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index b42b7cd56c03..333b826c1871 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -433,8 +433,8 @@ static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
433 code = iov->iov_base; 433 code = iov->iov_base;
434 434
435 if (type && code) { 435 if (type && code) {
436 if (get_user(fl->fl_icmp_type, type) || 436 if (get_user(fl->fl4_icmp_type, type) ||
437 get_user(fl->fl_icmp_code, code)) 437 get_user(fl->fl4_icmp_code, code))
438 return -EFAULT; 438 return -EFAULT;
439 probed = 1; 439 probed = 1;
440 } 440 }
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 98d47dc60c89..d90529d45ee6 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -353,8 +353,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
353 .fl4_tos = RT_CONN_FLAGS(sk), 353 .fl4_tos = RT_CONN_FLAGS(sk),
354 .flowi_proto = IPPROTO_TCP, 354 .flowi_proto = IPPROTO_TCP,
355 .flowi_flags = inet_sk_flowi_flags(sk), 355 .flowi_flags = inet_sk_flowi_flags(sk),
356 .fl_ip_sport = th->dest, 356 .fl4_sport = th->dest,
357 .fl_ip_dport = th->source, 357 .fl4_dport = th->source,
358 }; 358 };
359 security_req_classify_flow(req, &fl); 359 security_req_classify_flow(req, &fl);
360 rt = ip_route_output_key(sock_net(sk), &fl); 360 rt = ip_route_output_key(sock_net(sk), &fl);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index e10f62e6c07c..116e4a8bfb73 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -778,7 +778,7 @@ static int udp_push_pending_frames(struct sock *sk)
778 if (!skb) 778 if (!skb)
779 goto out; 779 goto out;
780 780
781 err = udp_send_skb(skb, fl->fl4_dst, fl->fl_ip_dport); 781 err = udp_send_skb(skb, fl->fl4_dst, fl->fl4_dport);
782 782
783out: 783out:
784 up->len = 0; 784 up->len = 0;
@@ -917,8 +917,8 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
917 .flowi_proto = sk->sk_protocol, 917 .flowi_proto = sk->sk_protocol,
918 .flowi_flags = (inet_sk_flowi_flags(sk) | 918 .flowi_flags = (inet_sk_flowi_flags(sk) |
919 FLOWI_FLAG_CAN_SLEEP), 919 FLOWI_FLAG_CAN_SLEEP),
920 .fl_ip_sport = inet->inet_sport, 920 .fl4_sport = inet->inet_sport,
921 .fl_ip_dport = dport, 921 .fl4_dport = dport,
922 }; 922 };
923 struct net *net = sock_net(sk); 923 struct net *net = sock_net(sk);
924 924
@@ -973,9 +973,9 @@ back_from_confirm:
973 * Now cork the socket to pend data. 973 * Now cork the socket to pend data.
974 */ 974 */
975 inet->cork.fl.fl4_dst = daddr; 975 inet->cork.fl.fl4_dst = daddr;
976 inet->cork.fl.fl_ip_dport = dport; 976 inet->cork.fl.fl4_dport = dport;
977 inet->cork.fl.fl4_src = saddr; 977 inet->cork.fl.fl4_src = saddr;
978 inet->cork.fl.fl_ip_sport = inet->inet_sport; 978 inet->cork.fl.fl4_sport = inet->inet_sport;
979 up->pending = AF_INET; 979 up->pending = AF_INET;
980 980
981do_append_data: 981do_append_data:
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 4294f121a749..b7b0921b425d 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -117,8 +117,8 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
117 pskb_may_pull(skb, xprth + 4 - skb->data)) { 117 pskb_may_pull(skb, xprth + 4 - skb->data)) {
118 __be16 *ports = (__be16 *)xprth; 118 __be16 *ports = (__be16 *)xprth;
119 119
120 fl->fl_ip_sport = ports[!!reverse]; 120 fl->fl4_sport = ports[!!reverse];
121 fl->fl_ip_dport = ports[!reverse]; 121 fl->fl4_dport = ports[!reverse];
122 } 122 }
123 break; 123 break;
124 124
@@ -126,8 +126,8 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
126 if (pskb_may_pull(skb, xprth + 2 - skb->data)) { 126 if (pskb_may_pull(skb, xprth + 2 - skb->data)) {
127 u8 *icmp = xprth; 127 u8 *icmp = xprth;
128 128
129 fl->fl_icmp_type = icmp[0]; 129 fl->fl4_icmp_type = icmp[0];
130 fl->fl_icmp_code = icmp[1]; 130 fl->fl4_icmp_code = icmp[1];
131 } 131 }
132 break; 132 break;
133 133
@@ -135,7 +135,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
135 if (pskb_may_pull(skb, xprth + 4 - skb->data)) { 135 if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
136 __be32 *ehdr = (__be32 *)xprth; 136 __be32 *ehdr = (__be32 *)xprth;
137 137
138 fl->fl_ipsec_spi = ehdr[0]; 138 fl->fl4_ipsec_spi = ehdr[0];
139 } 139 }
140 break; 140 break;
141 141
@@ -143,7 +143,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
143 if (pskb_may_pull(skb, xprth + 8 - skb->data)) { 143 if (pskb_may_pull(skb, xprth + 8 - skb->data)) {
144 __be32 *ah_hdr = (__be32*)xprth; 144 __be32 *ah_hdr = (__be32*)xprth;
145 145
146 fl->fl_ipsec_spi = ah_hdr[1]; 146 fl->fl4_ipsec_spi = ah_hdr[1];
147 } 147 }
148 break; 148 break;
149 149
@@ -151,7 +151,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
151 if (pskb_may_pull(skb, xprth + 4 - skb->data)) { 151 if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
152 __be16 *ipcomp_hdr = (__be16 *)xprth; 152 __be16 *ipcomp_hdr = (__be16 *)xprth;
153 153
154 fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1])); 154 fl->fl4_ipsec_spi = htonl(ntohs(ipcomp_hdr[1]));
155 } 155 }
156 break; 156 break;
157 157
@@ -163,13 +163,13 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
163 if (greflags[0] & GRE_KEY) { 163 if (greflags[0] & GRE_KEY) {
164 if (greflags[0] & GRE_CSUM) 164 if (greflags[0] & GRE_CSUM)
165 gre_hdr++; 165 gre_hdr++;
166 fl->fl_gre_key = gre_hdr[1]; 166 fl->fl4_gre_key = gre_hdr[1];
167 } 167 }
168 } 168 }
169 break; 169 break;
170 170
171 default: 171 default:
172 fl->fl_ipsec_spi = 0; 172 fl->fl4_ipsec_spi = 0;
173 break; 173 break;
174 } 174 }
175 } 175 }
diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c
index d2314348dd2a..663b5501abcd 100644
--- a/net/ipv4/xfrm4_state.c
+++ b/net/ipv4/xfrm4_state.c
@@ -25,9 +25,9 @@ __xfrm4_init_tempsel(struct xfrm_selector *sel, const struct flowi *fl)
25{ 25{
26 sel->daddr.a4 = fl->fl4_dst; 26 sel->daddr.a4 = fl->fl4_dst;
27 sel->saddr.a4 = fl->fl4_src; 27 sel->saddr.a4 = fl->fl4_src;
28 sel->dport = xfrm_flowi_dport(fl); 28 sel->dport = xfrm_flowi_dport(fl, &fl->uli_u);
29 sel->dport_mask = htons(0xffff); 29 sel->dport_mask = htons(0xffff);
30 sel->sport = xfrm_flowi_sport(fl); 30 sel->sport = xfrm_flowi_sport(fl, &fl->uli_u);
31 sel->sport_mask = htons(0xffff); 31 sel->sport_mask = htons(0xffff);
32 sel->family = AF_INET; 32 sel->family = AF_INET;
33 sel->prefixlen_d = 32; 33 sel->prefixlen_d = 32;
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 35b0be0463f9..923febea8989 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -661,8 +661,8 @@ int inet6_sk_rebuild_header(struct sock *sk)
661 fl.fl6_flowlabel = np->flow_label; 661 fl.fl6_flowlabel = np->flow_label;
662 fl.flowi_oif = sk->sk_bound_dev_if; 662 fl.flowi_oif = sk->sk_bound_dev_if;
663 fl.flowi_mark = sk->sk_mark; 663 fl.flowi_mark = sk->sk_mark;
664 fl.fl_ip_dport = inet->inet_dport; 664 fl.fl6_dport = inet->inet_dport;
665 fl.fl_ip_sport = inet->inet_sport; 665 fl.fl6_sport = inet->inet_sport;
666 security_sk_classify_flow(sk, &fl); 666 security_sk_classify_flow(sk, &fl);
667 667
668 final_p = fl6_update_dst(&fl, np->opt, &final); 668 final_p = fl6_update_dst(&fl, np->opt, &final);
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 6c24b26f67ec..07e03e68243b 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -151,8 +151,8 @@ ipv4_connected:
151 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 151 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
152 fl.flowi_oif = sk->sk_bound_dev_if; 152 fl.flowi_oif = sk->sk_bound_dev_if;
153 fl.flowi_mark = sk->sk_mark; 153 fl.flowi_mark = sk->sk_mark;
154 fl.fl_ip_dport = inet->inet_dport; 154 fl.fl6_dport = inet->inet_dport;
155 fl.fl_ip_sport = inet->inet_sport; 155 fl.fl6_sport = inet->inet_sport;
156 156
157 if (!fl.flowi_oif && (addr_type&IPV6_ADDR_MULTICAST)) 157 if (!fl.flowi_oif && (addr_type&IPV6_ADDR_MULTICAST))
158 fl.flowi_oif = np->mcast_oif; 158 fl.flowi_oif = np->mcast_oif;
@@ -261,7 +261,7 @@ void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info)
261 serr->ee.ee_info = info; 261 serr->ee.ee_info = info;
262 serr->ee.ee_data = 0; 262 serr->ee.ee_data = 0;
263 serr->addr_offset = (u8 *)&iph->daddr - skb_network_header(skb); 263 serr->addr_offset = (u8 *)&iph->daddr - skb_network_header(skb);
264 serr->port = fl->fl_ip_dport; 264 serr->port = fl->fl6_dport;
265 265
266 __skb_pull(skb, skb_tail_pointer(skb) - skb->data); 266 __skb_pull(skb, skb_tail_pointer(skb) - skb->data);
267 skb_reset_transport_header(skb); 267 skb_reset_transport_header(skb);
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 9e123e08b9b7..52ff7aa1f9fc 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -448,8 +448,8 @@ void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
448 if (saddr) 448 if (saddr)
449 ipv6_addr_copy(&fl.fl6_src, saddr); 449 ipv6_addr_copy(&fl.fl6_src, saddr);
450 fl.flowi_oif = iif; 450 fl.flowi_oif = iif;
451 fl.fl_icmp_type = type; 451 fl.fl6_icmp_type = type;
452 fl.fl_icmp_code = code; 452 fl.fl6_icmp_code = code;
453 security_skb_classify_flow(skb, &fl); 453 security_skb_classify_flow(skb, &fl);
454 454
455 sk = icmpv6_xmit_lock(net); 455 sk = icmpv6_xmit_lock(net);
@@ -544,7 +544,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
544 if (saddr) 544 if (saddr)
545 ipv6_addr_copy(&fl.fl6_src, saddr); 545 ipv6_addr_copy(&fl.fl6_src, saddr);
546 fl.flowi_oif = skb->dev->ifindex; 546 fl.flowi_oif = skb->dev->ifindex;
547 fl.fl_icmp_type = ICMPV6_ECHO_REPLY; 547 fl.fl6_icmp_type = ICMPV6_ECHO_REPLY;
548 security_skb_classify_flow(skb, &fl); 548 security_skb_classify_flow(skb, &fl);
549 549
550 sk = icmpv6_xmit_lock(net); 550 sk = icmpv6_xmit_lock(net);
@@ -794,8 +794,8 @@ void icmpv6_flow_init(struct sock *sk, struct flowi *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->flowi_proto = IPPROTO_ICMPV6; 796 fl->flowi_proto = IPPROTO_ICMPV6;
797 fl->fl_icmp_type = type; 797 fl->fl6_icmp_type = type;
798 fl->fl_icmp_code = 0; 798 fl->fl6_icmp_code = 0;
799 fl->flowi_oif = oif; 799 fl->flowi_oif = oif;
800 security_sk_classify_flow(sk, fl); 800 security_sk_classify_flow(sk, fl);
801} 801}
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 673f9bf28958..1b06a24019c6 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -70,8 +70,8 @@ struct dst_entry *inet6_csk_route_req(struct sock *sk,
70 ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr); 70 ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr);
71 fl.flowi_oif = sk->sk_bound_dev_if; 71 fl.flowi_oif = sk->sk_bound_dev_if;
72 fl.flowi_mark = sk->sk_mark; 72 fl.flowi_mark = sk->sk_mark;
73 fl.fl_ip_dport = inet_rsk(req)->rmt_port; 73 fl.fl6_dport = inet_rsk(req)->rmt_port;
74 fl.fl_ip_sport = inet_rsk(req)->loc_port; 74 fl.fl6_sport = inet_rsk(req)->loc_port;
75 security_req_classify_flow(req, &fl); 75 security_req_classify_flow(req, &fl);
76 76
77 dst = ip6_dst_lookup_flow(sk, &fl, final_p, false); 77 dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
@@ -220,8 +220,8 @@ int inet6_csk_xmit(struct sk_buff *skb)
220 IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel); 220 IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
221 fl.flowi_oif = sk->sk_bound_dev_if; 221 fl.flowi_oif = sk->sk_bound_dev_if;
222 fl.flowi_mark = sk->sk_mark; 222 fl.flowi_mark = sk->sk_mark;
223 fl.fl_ip_sport = inet->inet_sport; 223 fl.fl6_sport = inet->inet_sport;
224 fl.fl_ip_dport = inet->inet_dport; 224 fl.fl6_dport = inet->inet_dport;
225 security_sk_classify_flow(sk, &fl); 225 security_sk_classify_flow(sk, &fl);
226 226
227 final_p = fl6_update_dst(&fl, np->opt, &final); 227 final_p = fl6_update_dst(&fl, np->opt, &final);
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index e2f852cd0f4e..5038e6b2b55b 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -215,7 +215,7 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb,
215 int err = 0; 215 int err = 0;
216 216
217 if (unlikely(fl->flowi_proto == IPPROTO_MH && 217 if (unlikely(fl->flowi_proto == IPPROTO_MH &&
218 fl->fl_mh_type <= IP6_MH_TYPE_MAX)) 218 fl->fl6_mh_type <= IP6_MH_TYPE_MAX))
219 goto out; 219 goto out;
220 220
221 if (likely(opt->dsthao)) { 221 if (likely(opt->dsthao)) {
@@ -241,10 +241,10 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb,
241 sel.prefixlen_s = 128; 241 sel.prefixlen_s = 128;
242 sel.family = AF_INET6; 242 sel.family = AF_INET6;
243 sel.proto = fl->flowi_proto; 243 sel.proto = fl->flowi_proto;
244 sel.dport = xfrm_flowi_dport(fl); 244 sel.dport = xfrm_flowi_dport(fl, &fl->uli_u);
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, &fl->uli_u);
248 if (sel.sport) 248 if (sel.sport)
249 sel.sport_mask = htons(~0); 249 sel.sport_mask = htons(~0);
250 sel.ifindex = fl->flowi_oif; 250 sel.ifindex = fl->flowi_oif;
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
index fd3938803eb3..d1e905b7f563 100644
--- a/net/ipv6/netfilter/ip6t_REJECT.c
+++ b/net/ipv6/netfilter/ip6t_REJECT.c
@@ -93,8 +93,8 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
93 fl.flowi_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.fl6_sport = otcph.dest;
97 fl.fl_ip_dport = otcph.source; 97 fl.fl6_dport = otcph.source;
98 security_skb_classify_flow(oldskb, &fl); 98 security_skb_classify_flow(oldskb, &fl);
99 dst = ip6_route_output(net, NULL, &fl); 99 dst = ip6_route_output(net, NULL, &fl);
100 if (dst == NULL || dst->error) { 100 if (dst == NULL || dst->error) {
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 323ad44ff775..d061465d6827 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -694,8 +694,8 @@ static int rawv6_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
694 code = iov->iov_base; 694 code = iov->iov_base;
695 695
696 if (type && code) { 696 if (type && code) {
697 if (get_user(fl->fl_icmp_type, type) || 697 if (get_user(fl->fl6_icmp_type, type) ||
698 get_user(fl->fl_icmp_code, code)) 698 get_user(fl->fl6_icmp_code, code))
699 return -EFAULT; 699 return -EFAULT;
700 probed = 1; 700 probed = 1;
701 } 701 }
@@ -706,7 +706,7 @@ static int rawv6_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
706 /* check if type field is readable or not. */ 706 /* check if type field is readable or not. */
707 if (iov->iov_len > 2 - len) { 707 if (iov->iov_len > 2 - len) {
708 u8 __user *p = iov->iov_base; 708 u8 __user *p = iov->iov_base;
709 if (get_user(fl->fl_mh_type, &p[2 - len])) 709 if (get_user(fl->fl6_mh_type, &p[2 - len]))
710 return -EFAULT; 710 return -EFAULT;
711 probed = 1; 711 probed = 1;
712 } else 712 } else
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index ca5255c08371..5b9eded1432c 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -240,8 +240,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
240 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); 240 ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
241 fl.flowi_oif = sk->sk_bound_dev_if; 241 fl.flowi_oif = sk->sk_bound_dev_if;
242 fl.flowi_mark = sk->sk_mark; 242 fl.flowi_mark = sk->sk_mark;
243 fl.fl_ip_dport = inet_rsk(req)->rmt_port; 243 fl.fl6_dport = inet_rsk(req)->rmt_port;
244 fl.fl_ip_sport = inet_sk(sk)->inet_sport; 244 fl.fl6_sport = inet_sk(sk)->inet_sport;
245 security_req_classify_flow(req, &fl); 245 security_req_classify_flow(req, &fl);
246 246
247 dst = ip6_dst_lookup_flow(sk, &fl, final_p, false); 247 dst = ip6_dst_lookup_flow(sk, &fl, final_p, false);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index a3d1229b4004..c531ad5fbccc 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -248,8 +248,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
248 (saddr ? saddr : &np->saddr)); 248 (saddr ? saddr : &np->saddr));
249 fl.flowi_oif = sk->sk_bound_dev_if; 249 fl.flowi_oif = sk->sk_bound_dev_if;
250 fl.flowi_mark = sk->sk_mark; 250 fl.flowi_mark = sk->sk_mark;
251 fl.fl_ip_dport = usin->sin6_port; 251 fl.fl6_dport = usin->sin6_port;
252 fl.fl_ip_sport = inet->inet_sport; 252 fl.fl6_sport = inet->inet_sport;
253 253
254 final_p = fl6_update_dst(&fl, np->opt, &final); 254 final_p = fl6_update_dst(&fl, np->opt, &final);
255 255
@@ -401,8 +401,8 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
401 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 401 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
402 fl.flowi_oif = sk->sk_bound_dev_if; 402 fl.flowi_oif = sk->sk_bound_dev_if;
403 fl.flowi_mark = sk->sk_mark; 403 fl.flowi_mark = sk->sk_mark;
404 fl.fl_ip_dport = inet->inet_dport; 404 fl.fl6_dport = inet->inet_dport;
405 fl.fl_ip_sport = inet->inet_sport; 405 fl.fl6_sport = inet->inet_sport;
406 security_skb_classify_flow(skb, &fl); 406 security_skb_classify_flow(skb, &fl);
407 407
408 dst = ip6_dst_lookup_flow(sk, &fl, NULL, false); 408 dst = ip6_dst_lookup_flow(sk, &fl, NULL, false);
@@ -493,8 +493,8 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
493 fl.fl6_flowlabel = 0; 493 fl.fl6_flowlabel = 0;
494 fl.flowi_oif = treq->iif; 494 fl.flowi_oif = treq->iif;
495 fl.flowi_mark = sk->sk_mark; 495 fl.flowi_mark = sk->sk_mark;
496 fl.fl_ip_dport = inet_rsk(req)->rmt_port; 496 fl.fl6_dport = inet_rsk(req)->rmt_port;
497 fl.fl_ip_sport = inet_rsk(req)->loc_port; 497 fl.fl6_sport = inet_rsk(req)->loc_port;
498 security_req_classify_flow(req, &fl); 498 security_req_classify_flow(req, &fl);
499 499
500 opt = np->opt; 500 opt = np->opt;
@@ -1057,8 +1057,8 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,
1057 1057
1058 fl.flowi_proto = IPPROTO_TCP; 1058 fl.flowi_proto = IPPROTO_TCP;
1059 fl.flowi_oif = inet6_iif(skb); 1059 fl.flowi_oif = inet6_iif(skb);
1060 fl.fl_ip_dport = t1->dest; 1060 fl.fl6_dport = t1->dest;
1061 fl.fl_ip_sport = t1->source; 1061 fl.fl6_sport = t1->source;
1062 security_skb_classify_flow(skb, &fl); 1062 security_skb_classify_flow(skb, &fl);
1063 1063
1064 /* Pass a socket to ip6_dst_lookup either it is for RST 1064 /* Pass a socket to ip6_dst_lookup either it is for RST
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 91f8047463ec..dad035fb0afd 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -899,8 +899,8 @@ static int udp_v6_push_pending_frames(struct sock *sk)
899 * Create a UDP header 899 * Create a UDP header
900 */ 900 */
901 uh = udp_hdr(skb); 901 uh = udp_hdr(skb);
902 uh->source = fl->fl_ip_sport; 902 uh->source = fl->fl6_sport;
903 uh->dest = fl->fl_ip_dport; 903 uh->dest = fl->fl6_dport;
904 uh->len = htons(up->len); 904 uh->len = htons(up->len);
905 uh->check = 0; 905 uh->check = 0;
906 906
@@ -1036,7 +1036,7 @@ do_udp_sendmsg:
1036 if (sin6->sin6_port == 0) 1036 if (sin6->sin6_port == 0)
1037 return -EINVAL; 1037 return -EINVAL;
1038 1038
1039 fl.fl_ip_dport = sin6->sin6_port; 1039 fl.fl6_dport = sin6->sin6_port;
1040 daddr = &sin6->sin6_addr; 1040 daddr = &sin6->sin6_addr;
1041 1041
1042 if (np->sndflow) { 1042 if (np->sndflow) {
@@ -1065,7 +1065,7 @@ do_udp_sendmsg:
1065 if (sk->sk_state != TCP_ESTABLISHED) 1065 if (sk->sk_state != TCP_ESTABLISHED)
1066 return -EDESTADDRREQ; 1066 return -EDESTADDRREQ;
1067 1067
1068 fl.fl_ip_dport = inet->inet_dport; 1068 fl.fl6_dport = inet->inet_dport;
1069 daddr = &np->daddr; 1069 daddr = &np->daddr;
1070 fl.fl6_flowlabel = np->flow_label; 1070 fl.fl6_flowlabel = np->flow_label;
1071 connected = 1; 1071 connected = 1;
@@ -1112,7 +1112,7 @@ do_udp_sendmsg:
1112 fl.fl6_dst.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */ 1112 fl.fl6_dst.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */
1113 if (ipv6_addr_any(&fl.fl6_src) && !ipv6_addr_any(&np->saddr)) 1113 if (ipv6_addr_any(&fl.fl6_src) && !ipv6_addr_any(&np->saddr))
1114 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 1114 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
1115 fl.fl_ip_sport = inet->inet_sport; 1115 fl.fl6_sport = inet->inet_sport;
1116 1116
1117 final_p = fl6_update_dst(&fl, opt, &final); 1117 final_p = fl6_update_dst(&fl, opt, &final);
1118 if (final_p) 1118 if (final_p)
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index d62496c1a6f9..213c7594144b 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -158,8 +158,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
158 pskb_may_pull(skb, nh + offset + 4 - skb->data))) { 158 pskb_may_pull(skb, nh + offset + 4 - skb->data))) {
159 __be16 *ports = (__be16 *)exthdr; 159 __be16 *ports = (__be16 *)exthdr;
160 160
161 fl->fl_ip_sport = ports[!!reverse]; 161 fl->fl6_sport = ports[!!reverse];
162 fl->fl_ip_dport = ports[!reverse]; 162 fl->fl6_dport = ports[!reverse];
163 } 163 }
164 fl->flowi_proto = nexthdr; 164 fl->flowi_proto = nexthdr;
165 return; 165 return;
@@ -168,8 +168,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
168 if (!onlyproto && pskb_may_pull(skb, nh + offset + 2 - skb->data)) { 168 if (!onlyproto && pskb_may_pull(skb, nh + offset + 2 - skb->data)) {
169 u8 *icmp = (u8 *)exthdr; 169 u8 *icmp = (u8 *)exthdr;
170 170
171 fl->fl_icmp_type = icmp[0]; 171 fl->fl6_icmp_type = icmp[0];
172 fl->fl_icmp_code = icmp[1]; 172 fl->fl6_icmp_code = icmp[1];
173 } 173 }
174 fl->flowi_proto = nexthdr; 174 fl->flowi_proto = nexthdr;
175 return; 175 return;
@@ -180,7 +180,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
180 struct ip6_mh *mh; 180 struct ip6_mh *mh;
181 mh = (struct ip6_mh *)exthdr; 181 mh = (struct ip6_mh *)exthdr;
182 182
183 fl->fl_mh_type = mh->ip6mh_type; 183 fl->fl6_mh_type = mh->ip6mh_type;
184 } 184 }
185 fl->flowi_proto = nexthdr; 185 fl->flowi_proto = nexthdr;
186 return; 186 return;
@@ -191,7 +191,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
191 case IPPROTO_ESP: 191 case IPPROTO_ESP:
192 case IPPROTO_COMP: 192 case IPPROTO_COMP:
193 default: 193 default:
194 fl->fl_ipsec_spi = 0; 194 fl->fl6_ipsec_spi = 0;
195 fl->flowi_proto = nexthdr; 195 fl->flowi_proto = nexthdr;
196 return; 196 return;
197 } 197 }
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index 805d0e14c331..71277ce78590 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -26,9 +26,9 @@ __xfrm6_init_tempsel(struct xfrm_selector *sel, const struct flowi *fl)
26 * to current session. */ 26 * to current session. */
27 ipv6_addr_copy((struct in6_addr *)&sel->daddr, &fl->fl6_dst); 27 ipv6_addr_copy((struct in6_addr *)&sel->daddr, &fl->fl6_dst);
28 ipv6_addr_copy((struct in6_addr *)&sel->saddr, &fl->fl6_src); 28 ipv6_addr_copy((struct in6_addr *)&sel->saddr, &fl->fl6_src);
29 sel->dport = xfrm_flowi_dport(fl); 29 sel->dport = xfrm_flowi_dport(fl, &fl->uli_u);
30 sel->dport_mask = htons(0xffff); 30 sel->dport_mask = htons(0xffff);
31 sel->sport = xfrm_flowi_sport(fl); 31 sel->sport = xfrm_flowi_sport(fl, &fl->uli_u);
32 sel->sport_mask = htons(0xffff); 32 sel->sport_mask = htons(0xffff);
33 sel->family = AF_INET6; 33 sel->family = AF_INET6;
34 sel->prefixlen_d = 128; 34 sel->prefixlen_d = 128;
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 832665ac2100..b6fa2940e30b 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -476,16 +476,16 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
476 476
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.fl4_dport = daddr->v4.sin_port;
480 fl.flowi_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.flowi_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.fl4_sport = htons(asoc->base.bind_addr.port);
485 } 485 }
486 if (saddr) { 486 if (saddr) {
487 fl.fl4_src = saddr->v4.sin_addr.s_addr; 487 fl.fl4_src = saddr->v4.sin_addr.s_addr;
488 fl.fl_ip_sport = saddr->v4.sin_port; 488 fl.fl4_sport = saddr->v4.sin_port;
489 } 489 }
490 490
491 SCTP_DEBUG_PRINTK("%s: DST:%pI4, SRC:%pI4 - ", 491 SCTP_DEBUG_PRINTK("%s: DST:%pI4, SRC:%pI4 - ",
@@ -534,7 +534,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
534 if ((laddr->state == SCTP_ADDR_SRC) && 534 if ((laddr->state == SCTP_ADDR_SRC) &&
535 (AF_INET == laddr->a.sa.sa_family)) { 535 (AF_INET == laddr->a.sa.sa_family)) {
536 fl.fl4_src = laddr->a.v4.sin_addr.s_addr; 536 fl.fl4_src = laddr->a.v4.sin_addr.s_addr;
537 fl.fl_ip_sport = laddr->a.v4.sin_port; 537 fl.fl4_sport = laddr->a.v4.sin_port;
538 rt = ip_route_output_key(&init_net, &fl); 538 rt = ip_route_output_key(&init_net, &fl);
539 if (!IS_ERR(rt)) { 539 if (!IS_ERR(rt)) {
540 dst = &rt->dst; 540 dst = &rt->dst;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index dd6243f9d933..d54b6e7165c6 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -61,8 +61,8 @@ __xfrm4_selector_match(const struct xfrm_selector *sel, const struct flowi *fl)
61{ 61{
62 return addr_match(&fl->fl4_dst, &sel->daddr, sel->prefixlen_d) && 62 return addr_match(&fl->fl4_dst, &sel->daddr, sel->prefixlen_d) &&
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, &fl->uli_u) ^ sel->dport) & sel->dport_mask) &&
65 !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) && 65 !((xfrm_flowi_sport(fl, &fl->uli_u) ^ sel->sport) & sel->sport_mask) &&
66 (fl->flowi_proto == sel->proto || !sel->proto) && 66 (fl->flowi_proto == sel->proto || !sel->proto) &&
67 (fl->flowi_oif == sel->ifindex || !sel->ifindex); 67 (fl->flowi_oif == sel->ifindex || !sel->ifindex);
68} 68}
@@ -72,8 +72,8 @@ __xfrm6_selector_match(const struct xfrm_selector *sel, const struct flowi *fl)
72{ 72{
73 return addr_match(&fl->fl6_dst, &sel->daddr, sel->prefixlen_d) && 73 return addr_match(&fl->fl6_dst, &sel->daddr, sel->prefixlen_d) &&
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, &fl->uli_u) ^ sel->dport) & sel->dport_mask) &&
76 !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) && 76 !((xfrm_flowi_sport(fl, &fl->uli_u) ^ sel->sport) & sel->sport_mask) &&
77 (fl->flowi_proto == sel->proto || !sel->proto) && 77 (fl->flowi_proto == sel->proto || !sel->proto) &&
78 (fl->flowi_oif == sel->ifindex || !sel->ifindex); 78 (fl->flowi_oif == sel->ifindex || !sel->ifindex);
79} 79}