struct in6_addr saddr;
__be32 flowlabel;
union flowi_uli uli;
+#define fl6_sport uli.ports.sport
+#define fl6_dport uli.ports.dport
+#define fl6_icmp_type uli.icmpt.type
+#define fl6_icmp_code uli.icmpt.code
+#define fl6_ipsec_spi uli.spi
+#define fl6_mh_type uli.mht.type
+#define fl6_gre_key uli.gre_key
};
struct flowidn {
#define fld_dst u.dn.daddr
#define fld_src u.dn.saddr
-#define fl6_dst u.ip6.daddr
-#define fl6_src u.ip6.saddr
-#define fl6_flowlabel u.ip6.flowlabel
-#define fl6_sport u.ip6.uli.ports.sport
-#define fl6_dport u.ip6.uli.ports.dport
-#define fl6_icmp_type u.ip6.uli.icmpt.type
-#define fl6_icmp_code u.ip6.uli.icmpt.code
-#define fl6_ipsec_spi u.ip6.uli.spi
-#define fl6_mh_type u.ip6.uli.mht.type
-#define fl6_gre_key u.ip6.uli.gre_key
} __attribute__((__aligned__(BITS_PER_LONG/8)));
static inline struct flowi *flowi4_to_flowi(struct flowi4 *fl4)
ipv6_addr_copy(&fl6.daddr, &np->daddr);
ipv6_addr_copy(&fl6.saddr, &np->saddr);
fl6.flowi6_oif = sk->sk_bound_dev_if;
- fl6.uli.ports.dport = inet->inet_dport;
- fl6.uli.ports.sport = inet->inet_sport;
+ fl6.fl6_dport = inet->inet_dport;
+ fl6.fl6_sport = inet->inet_sport;
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
dst = ip6_dst_lookup_flow(sk, &fl6, NULL, false);
ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr);
fl6.flowlabel = 0;
fl6.flowi6_oif = ireq6->iif;
- fl6.uli.ports.dport = inet_rsk(req)->rmt_port;
- fl6.uli.ports.sport = inet_rsk(req)->loc_port;
+ fl6.fl6_dport = inet_rsk(req)->rmt_port;
+ fl6.fl6_sport = inet_rsk(req)->loc_port;
security_req_classify_flow(req, flowi6_to_flowi(&fl6));
opt = np->opt;
fl6.flowi6_proto = IPPROTO_DCCP;
fl6.flowi6_oif = inet6_iif(rxskb);
- fl6.uli.ports.dport = dccp_hdr(skb)->dccph_dport;
- fl6.uli.ports.sport = dccp_hdr(skb)->dccph_sport;
+ fl6.fl6_dport = dccp_hdr(skb)->dccph_dport;
+ fl6.fl6_sport = dccp_hdr(skb)->dccph_sport;
security_skb_classify_flow(rxskb, flowi6_to_flowi(&fl6));
/* sk = NULL, but it is safe for now. RST socket required. */
final_p = fl6_update_dst(&fl6, opt, &final);
ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr);
fl6.flowi6_oif = sk->sk_bound_dev_if;
- fl6.uli.ports.dport = inet_rsk(req)->rmt_port;
- fl6.uli.ports.sport = inet_rsk(req)->loc_port;
+ fl6.fl6_dport = inet_rsk(req)->rmt_port;
+ fl6.fl6_sport = inet_rsk(req)->loc_port;
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
ipv6_addr_copy(&fl6.daddr, &np->daddr);
ipv6_addr_copy(&fl6.saddr, saddr ? saddr : &np->saddr);
fl6.flowi6_oif = sk->sk_bound_dev_if;
- fl6.uli.ports.dport = usin->sin6_port;
- fl6.uli.ports.sport = inet->inet_sport;
+ fl6.fl6_dport = usin->sin6_port;
+ fl6.fl6_sport = inet->inet_sport;
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
final_p = fl6_update_dst(&fl6, np->opt, &final);
fl6.flowlabel = np->flow_label;
fl6.flowi6_oif = sk->sk_bound_dev_if;
fl6.flowi6_mark = sk->sk_mark;
- fl6.uli.ports.dport = inet->inet_dport;
- fl6.uli.ports.sport = inet->inet_sport;
+ fl6.fl6_dport = inet->inet_dport;
+ fl6.fl6_sport = inet->inet_sport;
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
final_p = fl6_update_dst(&fl6, np->opt, &final);
ipv6_addr_copy(&fl6.saddr, &np->saddr);
fl6.flowi6_oif = sk->sk_bound_dev_if;
fl6.flowi6_mark = sk->sk_mark;
- fl6.uli.ports.dport = inet->inet_dport;
- fl6.uli.ports.sport = inet->inet_sport;
+ fl6.fl6_dport = inet->inet_dport;
+ fl6.fl6_sport = inet->inet_sport;
if (!fl6.flowi6_oif && (addr_type&IPV6_ADDR_MULTICAST))
fl6.flowi6_oif = np->mcast_oif;
serr->ee.ee_info = info;
serr->ee.ee_data = 0;
serr->addr_offset = (u8 *)&iph->daddr - skb_network_header(skb);
- serr->port = fl6->uli.ports.dport;
+ serr->port = fl6->fl6_dport;
__skb_pull(skb, skb_tail_pointer(skb) - skb->data);
skb_reset_transport_header(skb);
if (saddr)
ipv6_addr_copy(&fl6.saddr, saddr);
fl6.flowi6_oif = iif;
- fl6.uli.icmpt.type = type;
- fl6.uli.icmpt.code = code;
+ fl6.fl6_icmp_type = type;
+ fl6.fl6_icmp_code = code;
security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
sk = icmpv6_xmit_lock(net);
if (saddr)
ipv6_addr_copy(&fl6.saddr, saddr);
fl6.flowi6_oif = skb->dev->ifindex;
- fl6.uli.icmpt.type = ICMPV6_ECHO_REPLY;
+ fl6.fl6_icmp_type = ICMPV6_ECHO_REPLY;
security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
sk = icmpv6_xmit_lock(net);
ipv6_addr_copy(&fl6->saddr, saddr);
ipv6_addr_copy(&fl6->daddr, daddr);
fl6->flowi6_proto = IPPROTO_ICMPV6;
- fl6->uli.icmpt.type = type;
- fl6->uli.icmpt.code = 0;
+ fl6->fl6_icmp_type = type;
+ fl6->fl6_icmp_code = 0;
fl6->flowi6_oif = oif;
security_sk_classify_flow(sk, flowi6_to_flowi(fl6));
}
ipv6_addr_copy(&fl6.saddr, &treq->loc_addr);
fl6.flowi6_oif = sk->sk_bound_dev_if;
fl6.flowi6_mark = sk->sk_mark;
- fl6.uli.ports.dport = inet_rsk(req)->rmt_port;
- fl6.uli.ports.sport = inet_rsk(req)->loc_port;
+ fl6.fl6_dport = inet_rsk(req)->rmt_port;
+ fl6.fl6_sport = inet_rsk(req)->loc_port;
security_req_classify_flow(req, flowi6_to_flowi(&fl6));
dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
IP6_ECN_flow_xmit(sk, fl6.flowlabel);
fl6.flowi6_oif = sk->sk_bound_dev_if;
fl6.flowi6_mark = sk->sk_mark;
- fl6.uli.ports.sport = inet->inet_sport;
- fl6.uli.ports.dport = inet->inet_dport;
+ fl6.fl6_sport = inet->inet_sport;
+ fl6.fl6_dport = inet->inet_dport;
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
final_p = fl6_update_dst(&fl6, np->opt, &final);
int err = 0;
if (unlikely(fl6->flowi6_proto == IPPROTO_MH &&
- fl6->uli.mht.type <= IP6_MH_TYPE_MAX))
+ fl6->fl6_mh_type <= IP6_MH_TYPE_MAX))
goto out;
if (likely(opt->dsthao)) {
fl6.flowi6_proto = IPPROTO_TCP;
ipv6_addr_copy(&fl6.saddr, &oip6h->daddr);
ipv6_addr_copy(&fl6.daddr, &oip6h->saddr);
- fl6.uli.ports.sport = otcph.dest;
- fl6.uli.ports.dport = otcph.source;
+ fl6.fl6_sport = otcph.dest;
+ fl6.fl6_dport = otcph.source;
security_skb_classify_flow(oldskb, flowi6_to_flowi(&fl6));
dst = ip6_route_output(net, NULL, &fl6);
if (dst == NULL || dst->error) {
code = iov->iov_base;
if (type && code) {
- if (get_user(fl6->uli.icmpt.type, type) ||
- get_user(fl6->uli.icmpt.code, code))
+ if (get_user(fl6->fl6_icmp_type, type) ||
+ get_user(fl6->fl6_icmp_code, code))
return -EFAULT;
probed = 1;
}
/* check if type field is readable or not. */
if (iov->iov_len > 2 - len) {
u8 __user *p = iov->iov_base;
- if (get_user(fl6->uli.mht.type, &p[2 - len]))
+ if (get_user(fl6->fl6_mh_type, &p[2 - len]))
return -EFAULT;
probed = 1;
} else
ipv6_addr_copy(&fl6.saddr, &ireq6->loc_addr);
fl6.flowi6_oif = sk->sk_bound_dev_if;
fl6.flowi6_mark = sk->sk_mark;
- fl6.uli.ports.dport = inet_rsk(req)->rmt_port;
- fl6.uli.ports.sport = inet_sk(sk)->inet_sport;
+ fl6.fl6_dport = inet_rsk(req)->rmt_port;
+ fl6.fl6_sport = inet_sk(sk)->inet_sport;
security_req_classify_flow(req, flowi6_to_flowi(&fl6));
dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
(saddr ? saddr : &np->saddr));
fl6.flowi6_oif = sk->sk_bound_dev_if;
fl6.flowi6_mark = sk->sk_mark;
- fl6.uli.ports.dport = usin->sin6_port;
- fl6.uli.ports.sport = inet->inet_sport;
+ fl6.fl6_dport = usin->sin6_port;
+ fl6.fl6_sport = inet->inet_sport;
final_p = fl6_update_dst(&fl6, np->opt, &final);
ipv6_addr_copy(&fl6.saddr, &np->saddr);
fl6.flowi6_oif = sk->sk_bound_dev_if;
fl6.flowi6_mark = sk->sk_mark;
- fl6.uli.ports.dport = inet->inet_dport;
- fl6.uli.ports.sport = inet->inet_sport;
+ fl6.fl6_dport = inet->inet_dport;
+ fl6.fl6_sport = inet->inet_sport;
security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
dst = ip6_dst_lookup_flow(sk, &fl6, NULL, false);
fl6.flowlabel = 0;
fl6.flowi6_oif = treq->iif;
fl6.flowi6_mark = sk->sk_mark;
- fl6.uli.ports.dport = inet_rsk(req)->rmt_port;
- fl6.uli.ports.sport = inet_rsk(req)->loc_port;
+ fl6.fl6_dport = inet_rsk(req)->rmt_port;
+ fl6.fl6_sport = inet_rsk(req)->loc_port;
security_req_classify_flow(req, flowi6_to_flowi(&fl6));
opt = np->opt;
fl6.flowi6_proto = IPPROTO_TCP;
fl6.flowi6_oif = inet6_iif(skb);
- fl6.uli.ports.dport = t1->dest;
- fl6.uli.ports.sport = t1->source;
+ fl6.fl6_dport = t1->dest;
+ fl6.fl6_sport = t1->source;
security_skb_classify_flow(skb, flowi6_to_flowi(&fl6));
/* Pass a socket to ip6_dst_lookup either it is for RST
* Create a UDP header
*/
uh = udp_hdr(skb);
- uh->source = fl6->uli.ports.sport;
- uh->dest = fl6->uli.ports.dport;
+ uh->source = fl6->fl6_sport;
+ uh->dest = fl6->fl6_dport;
uh->len = htons(up->len);
uh->check = 0;
if (sin6->sin6_port == 0)
return -EINVAL;
- fl6.uli.ports.dport = sin6->sin6_port;
+ fl6.fl6_dport = sin6->sin6_port;
daddr = &sin6->sin6_addr;
if (np->sndflow) {
if (sk->sk_state != TCP_ESTABLISHED)
return -EDESTADDRREQ;
- fl6.uli.ports.dport = inet->inet_dport;
+ fl6.fl6_dport = inet->inet_dport;
daddr = &np->daddr;
fl6.flowlabel = np->flow_label;
connected = 1;
fl6.daddr.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */
if (ipv6_addr_any(&fl6.saddr) && !ipv6_addr_any(&np->saddr))
ipv6_addr_copy(&fl6.saddr, &np->saddr);
- fl6.uli.ports.sport = inet->inet_sport;
+ fl6.fl6_sport = inet->inet_sport;
final_p = fl6_update_dst(&fl6, opt, &final);
if (final_p)
pskb_may_pull(skb, nh + offset + 4 - skb->data))) {
__be16 *ports = (__be16 *)exthdr;
- fl6->uli.ports.sport = ports[!!reverse];
- fl6->uli.ports.dport = ports[!reverse];
+ fl6->fl6_sport = ports[!!reverse];
+ fl6->fl6_dport = ports[!reverse];
}
fl6->flowi6_proto = nexthdr;
return;
if (!onlyproto && pskb_may_pull(skb, nh + offset + 2 - skb->data)) {
u8 *icmp = (u8 *)exthdr;
- fl6->uli.icmpt.type = icmp[0];
- fl6->uli.icmpt.code = icmp[1];
+ fl6->fl6_icmp_type = icmp[0];
+ fl6->fl6_icmp_code = icmp[1];
}
fl6->flowi6_proto = nexthdr;
return;
struct ip6_mh *mh;
mh = (struct ip6_mh *)exthdr;
- fl6->uli.mht.type = mh->ip6mh_type;
+ fl6->fl6_mh_type = mh->ip6mh_type;
}
fl6->flowi6_proto = nexthdr;
return;
case IPPROTO_ESP:
case IPPROTO_COMP:
default:
- fl6->uli.spi = 0;
+ fl6->fl6_ipsec_spi = 0;
fl6->flowi6_proto = nexthdr;
return;
}