Commit 73ee6aab authored by David S. Miller's avatar David S. Miller

Merge nuts.ninka.net:/home/davem/src/BK/network-2.5

into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents d475dd45 345b4943
...@@ -50,6 +50,10 @@ struct flowi { ...@@ -50,6 +50,10 @@ struct flowi {
__u32 spi; __u32 spi;
} uli_u; } uli_u;
#define fl_ip_sport uli_u.ports.sport
#define fl_ip_dport uli_u.ports.dport
#define fl_icmp_type uli_u.icmpt.type
#define fl_icmp_code uli_u.icmpt.code
#define fl_ipsec_spi uli_u.spi
}; };
#endif #endif
...@@ -173,13 +173,13 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst, ...@@ -173,13 +173,13 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst,
static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport, static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport,
struct sock *sk) struct sock *sk)
{ {
if (sport != (*rp)->fl.uli_u.ports.sport || if (sport != (*rp)->fl.fl_ip_sport ||
dport != (*rp)->fl.uli_u.ports.dport) { dport != (*rp)->fl.fl_ip_dport) {
struct flowi fl; struct flowi fl;
memcpy(&fl, &(*rp)->fl, sizeof(fl)); memcpy(&fl, &(*rp)->fl, sizeof(fl));
fl.uli_u.ports.sport = sport; fl.fl_ip_sport = sport;
fl.uli_u.ports.dport = dport; fl.fl_ip_dport = dport;
ip_rt_put(*rp); ip_rt_put(*rp);
*rp = NULL; *rp = NULL;
return ip_route_output_flow(rp, &fl, sk, 0); return ip_route_output_flow(rp, &fl, sk, 0);
......
...@@ -295,11 +295,11 @@ extern int xfrm_unregister_km(struct xfrm_mgr *km); ...@@ -295,11 +295,11 @@ extern int xfrm_unregister_km(struct xfrm_mgr *km);
static inline u32 __flow_hash4(struct flowi *fl) static inline u32 __flow_hash4(struct flowi *fl)
{ {
u32 hash = fl->fl4_src ^ fl->uli_u.ports.sport; u32 hash = fl->fl4_src ^ fl->fl_ip_sport;
hash = ((hash & 0xF0F0F0F0) >> 4) | ((hash & 0x0F0F0F0F) << 4); hash = ((hash & 0xF0F0F0F0) >> 4) | ((hash & 0x0F0F0F0F) << 4);
hash ^= fl->fl4_dst ^ fl->uli_u.ports.dport; hash ^= fl->fl4_dst ^ fl->fl_ip_dport;
hash ^= (hash >> 10); hash ^= (hash >> 10);
hash ^= (hash >> 20); hash ^= (hash >> 20);
return hash & (XFRM_FLOWCACHE_HASH_SIZE-1); return hash & (XFRM_FLOWCACHE_HASH_SIZE-1);
...@@ -309,13 +309,13 @@ static inline u32 __flow_hash6(struct flowi *fl) ...@@ -309,13 +309,13 @@ static inline u32 __flow_hash6(struct flowi *fl)
{ {
u32 hash = fl->fl6_src->s6_addr32[2] ^ u32 hash = fl->fl6_src->s6_addr32[2] ^
fl->fl6_src->s6_addr32[3] ^ fl->fl6_src->s6_addr32[3] ^
fl->uli_u.ports.sport; fl->fl_ip_sport;
hash = ((hash & 0xF0F0F0F0) >> 4) | ((hash & 0x0F0F0F0F) << 4); hash = ((hash & 0xF0F0F0F0) >> 4) | ((hash & 0x0F0F0F0F) << 4);
hash ^= fl->fl6_dst->s6_addr32[2] ^ hash ^= fl->fl6_dst->s6_addr32[2] ^
fl->fl6_dst->s6_addr32[3] ^ fl->fl6_dst->s6_addr32[3] ^
fl->uli_u.ports.dport; fl->fl_ip_dport;
hash ^= (hash >> 10); hash ^= (hash >> 10);
hash ^= (hash >> 20); hash ^= (hash >> 20);
return hash & (XFRM_FLOWCACHE_HASH_SIZE-1); return hash & (XFRM_FLOWCACHE_HASH_SIZE-1);
...@@ -454,8 +454,8 @@ __xfrm4_selector_match(struct xfrm_selector *sel, struct flowi *fl) ...@@ -454,8 +454,8 @@ __xfrm4_selector_match(struct xfrm_selector *sel, struct flowi *fl)
{ {
return addr_match(&fl->fl4_dst, &sel->daddr, sel->prefixlen_d) && return addr_match(&fl->fl4_dst, &sel->daddr, sel->prefixlen_d) &&
addr_match(&fl->fl4_src, &sel->saddr, sel->prefixlen_s) && addr_match(&fl->fl4_src, &sel->saddr, sel->prefixlen_s) &&
!((fl->uli_u.ports.dport^sel->dport)&sel->dport_mask) && !((fl->fl_ip_dport^sel->dport)&sel->dport_mask) &&
!((fl->uli_u.ports.sport^sel->sport)&sel->sport_mask) && !((fl->fl_ip_sport^sel->sport)&sel->sport_mask) &&
(fl->proto == sel->proto || !sel->proto) && (fl->proto == sel->proto || !sel->proto) &&
(fl->oif == sel->ifindex || !sel->ifindex); (fl->oif == sel->ifindex || !sel->ifindex);
} }
...@@ -465,8 +465,8 @@ __xfrm6_selector_match(struct xfrm_selector *sel, struct flowi *fl) ...@@ -465,8 +465,8 @@ __xfrm6_selector_match(struct xfrm_selector *sel, struct flowi *fl)
{ {
return addr_match(fl->fl6_dst, &sel->daddr, sel->prefixlen_d) && return addr_match(fl->fl6_dst, &sel->daddr, sel->prefixlen_d) &&
addr_match(fl->fl6_src, &sel->saddr, sel->prefixlen_s) && addr_match(fl->fl6_src, &sel->saddr, sel->prefixlen_s) &&
!((fl->uli_u.ports.dport^sel->dport)&sel->dport_mask) && !((fl->fl_ip_dport^sel->dport)&sel->dport_mask) &&
!((fl->uli_u.ports.sport^sel->sport)&sel->sport_mask) && !((fl->fl_ip_sport^sel->sport)&sel->sport_mask) &&
(fl->proto == sel->proto || !sel->proto) && (fl->proto == sel->proto || !sel->proto) &&
(fl->oif == sel->ifindex || !sel->ifindex); (fl->oif == sel->ifindex || !sel->ifindex);
} }
......
...@@ -180,8 +180,8 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) ...@@ -180,8 +180,8 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
if (pskb_may_pull(skb, xprth + 4 - skb->data)) { if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
u16 *ports = (u16 *)xprth; u16 *ports = (u16 *)xprth;
fl->uli_u.ports.sport = ports[0]; fl->fl_ip_sport = ports[0];
fl->uli_u.ports.dport = ports[1]; fl->fl_ip_dport = ports[1];
} }
break; break;
...@@ -189,7 +189,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) ...@@ -189,7 +189,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
if (pskb_may_pull(skb, xprth + 4 - skb->data)) { if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
u32 *ehdr = (u32 *)xprth; u32 *ehdr = (u32 *)xprth;
fl->uli_u.spi = ehdr[0]; fl->fl_ipsec_spi = ehdr[0];
} }
break; break;
...@@ -197,7 +197,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) ...@@ -197,7 +197,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
if (pskb_may_pull(skb, xprth + 8 - skb->data)) { if (pskb_may_pull(skb, xprth + 8 - skb->data)) {
u32 *ah_hdr = (u32*)xprth; u32 *ah_hdr = (u32*)xprth;
fl->uli_u.spi = ah_hdr[1]; fl->fl_ipsec_spi = ah_hdr[1];
} }
break; break;
...@@ -205,11 +205,11 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) ...@@ -205,11 +205,11 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
if (pskb_may_pull(skb, xprth + 4 - skb->data)) { if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
u16 *ipcomp_hdr = (u16 *)xprth; u16 *ipcomp_hdr = (u16 *)xprth;
fl->uli_u.spi = ntohl(ntohs(ipcomp_hdr[1])); fl->fl_ipsec_spi = ntohl(ntohs(ipcomp_hdr[1]));
} }
break; break;
default: default:
fl->uli_u.spi = 0; fl->fl_ipsec_spi = 0;
break; break;
}; };
} else { } else {
......
...@@ -20,9 +20,9 @@ __xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl, ...@@ -20,9 +20,9 @@ __xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl,
{ {
x->sel.daddr.a4 = fl->fl4_dst; x->sel.daddr.a4 = fl->fl4_dst;
x->sel.saddr.a4 = fl->fl4_src; x->sel.saddr.a4 = fl->fl4_src;
x->sel.dport = fl->uli_u.ports.dport; x->sel.dport = fl->fl_ip_dport;
x->sel.dport_mask = ~0; x->sel.dport_mask = ~0;
x->sel.sport = fl->uli_u.ports.sport; x->sel.sport = fl->fl_ip_sport;
x->sel.sport_mask = ~0; x->sel.sport_mask = ~0;
x->sel.prefixlen_d = 32; x->sel.prefixlen_d = 32;
x->sel.prefixlen_s = 32; x->sel.prefixlen_s = 32;
......
...@@ -91,7 +91,7 @@ void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info) ...@@ -91,7 +91,7 @@ void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info)
serr->ee.ee_info = info; serr->ee.ee_info = info;
serr->ee.ee_data = 0; serr->ee.ee_data = 0;
serr->addr_offset = (u8*)&iph->daddr - skb->nh.raw; serr->addr_offset = (u8*)&iph->daddr - skb->nh.raw;
serr->port = fl->uli_u.ports.dport; serr->port = fl->fl_ip_dport;
skb->h.raw = skb->tail; skb->h.raw = skb->tail;
__skb_pull(skb, skb->tail - skb->data); __skb_pull(skb, skb->tail - skb->data);
......
...@@ -313,12 +313,12 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, ...@@ -313,12 +313,12 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
} }
fl.proto = IPPROTO_ICMPV6; fl.proto = IPPROTO_ICMPV6;
fl.nl_u.ip6_u.daddr = &hdr->saddr; fl.fl6_dst = &hdr->saddr;
fl.nl_u.ip6_u.saddr = saddr; fl.fl6_src = saddr;
fl.oif = iif; fl.oif = iif;
fl.fl6_flowlabel = 0; fl.fl6_flowlabel = 0;
fl.uli_u.icmpt.type = type; fl.fl_icmp_type = type;
fl.uli_u.icmpt.code = code; fl.fl_icmp_code = code;
icmpv6_xmit_lock(); icmpv6_xmit_lock();
...@@ -387,12 +387,12 @@ static void icmpv6_echo_reply(struct sk_buff *skb) ...@@ -387,12 +387,12 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
msg.daddr = &skb->nh.ipv6h->saddr; msg.daddr = &skb->nh.ipv6h->saddr;
fl.proto = IPPROTO_ICMPV6; fl.proto = IPPROTO_ICMPV6;
fl.nl_u.ip6_u.daddr = msg.daddr; fl.fl6_dst = msg.daddr;
fl.nl_u.ip6_u.saddr = saddr; fl.fl6_src = saddr;
fl.oif = skb->dev->ifindex; fl.oif = skb->dev->ifindex;
fl.fl6_flowlabel = 0; fl.fl6_flowlabel = 0;
fl.uli_u.icmpt.type = ICMPV6_ECHO_REPLY; fl.fl_icmp_type = ICMPV6_ECHO_REPLY;
fl.uli_u.icmpt.code = 0; fl.fl_icmp_code = 0;
icmpv6_xmit_lock(); icmpv6_xmit_lock();
......
...@@ -147,8 +147,8 @@ int ip6_route_me_harder(struct sk_buff *skb) ...@@ -147,8 +147,8 @@ int ip6_route_me_harder(struct sk_buff *skb)
fl.fl6_src = &iph->saddr; fl.fl6_src = &iph->saddr;
fl.oif = skb->sk ? skb->sk->bound_dev_if : 0; fl.oif = skb->sk ? skb->sk->bound_dev_if : 0;
fl.fl6_flowlabel = 0; fl.fl6_flowlabel = 0;
fl.uli_u.ports.dport = 0; fl.fl_ip_dport = 0;
fl.uli_u.ports.sport = 0; fl.fl_ip_sport = 0;
dst = ip6_route_output(skb->sk, &fl); dst = ip6_route_output(skb->sk, &fl);
...@@ -188,7 +188,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl, ...@@ -188,7 +188,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
struct ipv6_txoptions *opt) struct ipv6_txoptions *opt)
{ {
struct ipv6_pinfo *np = sk ? inet6_sk(sk) : NULL; struct ipv6_pinfo *np = sk ? inet6_sk(sk) : NULL;
struct in6_addr *first_hop = fl->nl_u.ip6_u.daddr; struct in6_addr *first_hop = fl->fl6_dst;
struct dst_entry *dst = skb->dst; struct dst_entry *dst = skb->dst;
struct ipv6hdr *hdr; struct ipv6hdr *hdr;
u8 proto = fl->proto; u8 proto = fl->proto;
...@@ -243,7 +243,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl, ...@@ -243,7 +243,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
hdr->nexthdr = proto; hdr->nexthdr = proto;
hdr->hop_limit = hlimit; hdr->hop_limit = hlimit;
ipv6_addr_copy(&hdr->saddr, fl->nl_u.ip6_u.saddr); ipv6_addr_copy(&hdr->saddr, fl->fl6_src);
ipv6_addr_copy(&hdr->daddr, first_hop); ipv6_addr_copy(&hdr->daddr, first_hop);
mtu = dst_pmtu(dst); mtu = dst_pmtu(dst);
...@@ -308,8 +308,8 @@ static struct ipv6hdr * ip6_bld_1(struct sock *sk, struct sk_buff *skb, struct f ...@@ -308,8 +308,8 @@ static struct ipv6hdr * ip6_bld_1(struct sock *sk, struct sk_buff *skb, struct f
hdr->hop_limit = hlimit; hdr->hop_limit = hlimit;
hdr->nexthdr = fl->proto; hdr->nexthdr = fl->proto;
ipv6_addr_copy(&hdr->saddr, fl->nl_u.ip6_u.saddr); ipv6_addr_copy(&hdr->saddr, fl->fl6_src);
ipv6_addr_copy(&hdr->daddr, fl->nl_u.ip6_u.daddr); ipv6_addr_copy(&hdr->daddr, fl->fl6_dst);
return hdr; return hdr;
} }
...@@ -526,7 +526,7 @@ int ip6_build_xmit(struct sock *sk, inet_getfrag_t getfrag, const void *data, ...@@ -526,7 +526,7 @@ int ip6_build_xmit(struct sock *sk, inet_getfrag_t getfrag, const void *data,
fl->fl6_dst = rt0->addr; fl->fl6_dst = rt0->addr;
} }
if (!fl->oif && ipv6_addr_is_multicast(fl->nl_u.ip6_u.daddr)) if (!fl->oif && ipv6_addr_is_multicast(fl->fl6_dst))
fl->oif = np->mcast_oif; fl->oif = np->mcast_oif;
dst = __sk_dst_check(sk, np->dst_cookie); dst = __sk_dst_check(sk, np->dst_cookie);
...@@ -703,7 +703,7 @@ int ip6_build_xmit(struct sock *sk, inet_getfrag_t getfrag, const void *data, ...@@ -703,7 +703,7 @@ int ip6_build_xmit(struct sock *sk, inet_getfrag_t getfrag, const void *data,
* cleanup * cleanup
*/ */
out: out:
ip6_dst_store(sk, dst, fl->nl_u.ip6_u.daddr == &np->daddr ? &np->daddr : NULL); ip6_dst_store(sk, dst, fl->fl6_dst == &np->daddr ? &np->daddr : NULL);
if (err > 0) if (err > 0)
err = np->recverr ? net_xmit_errno(err) : 0; err = np->recverr ? net_xmit_errno(err) : 0;
return err; return err;
......
...@@ -405,8 +405,8 @@ static inline void ndisc_flow_init(struct flowi *fl, u8 type, ...@@ -405,8 +405,8 @@ static inline void ndisc_flow_init(struct flowi *fl, u8 type,
fl->fl6_src = saddr; fl->fl6_src = saddr;
fl->fl6_dst = daddr; fl->fl6_dst = daddr;
fl->proto = IPPROTO_ICMPV6; fl->proto = IPPROTO_ICMPV6;
fl->uli_u.icmpt.type = type; fl->fl_icmp_type = type;
fl->uli_u.icmpt.code = 0; fl->fl_icmp_code = 0;
} }
static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
......
...@@ -622,8 +622,8 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg ...@@ -622,8 +622,8 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg
fl.fl6_dst = daddr; fl.fl6_dst = daddr;
if (fl.fl6_src == NULL && !ipv6_addr_any(&np->saddr)) if (fl.fl6_src == NULL && !ipv6_addr_any(&np->saddr))
fl.fl6_src = &np->saddr; fl.fl6_src = &np->saddr;
fl.uli_u.icmpt.type = 0; fl.fl_icmp_type = 0;
fl.uli_u.icmpt.code = 0; fl.fl_icmp_code = 0;
if (raw_opt->checksum) { if (raw_opt->checksum) {
struct rawv6_fakehdr hdr; struct rawv6_fakehdr hdr;
......
...@@ -449,13 +449,12 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl) ...@@ -449,13 +449,12 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)
int strict; int strict;
int attempts = 3; int attempts = 3;
strict = ipv6_addr_type(fl->nl_u.ip6_u.daddr) & (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL); strict = ipv6_addr_type(fl->fl6_dst) & (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL);
relookup: relookup:
read_lock_bh(&rt6_lock); read_lock_bh(&rt6_lock);
fn = fib6_lookup(&ip6_routing_table, fl->nl_u.ip6_u.daddr, fn = fib6_lookup(&ip6_routing_table, fl->fl6_dst, fl->fl6_src);
fl->nl_u.ip6_u.saddr);
restart: restart:
rt = fn->leaf; rt = fn->leaf;
...@@ -477,8 +476,7 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl) ...@@ -477,8 +476,7 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)
if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) { if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) {
read_unlock_bh(&rt6_lock); read_unlock_bh(&rt6_lock);
rt = rt6_cow(rt, fl->nl_u.ip6_u.daddr, rt = rt6_cow(rt, fl->fl6_dst, fl->fl6_src);
fl->nl_u.ip6_u.saddr);
if (rt->u.dst.error != -EEXIST || --attempts <= 0) if (rt->u.dst.error != -EEXIST || --attempts <= 0)
goto out2; goto out2;
...@@ -1585,15 +1583,11 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) ...@@ -1585,15 +1583,11 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
skb->mac.raw = skb->data; skb->mac.raw = skb->data;
skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr)); skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr));
fl.proto = 0; memset(&fl, 0, sizeof(fl));
fl.nl_u.ip6_u.daddr = NULL;
fl.nl_u.ip6_u.saddr = NULL;
fl.uli_u.icmpt.type = 0;
fl.uli_u.icmpt.code = 0;
if (rta[RTA_SRC-1]) if (rta[RTA_SRC-1])
fl.nl_u.ip6_u.saddr = (struct in6_addr*)RTA_DATA(rta[RTA_SRC-1]); fl.fl6_src = (struct in6_addr*)RTA_DATA(rta[RTA_SRC-1]);
if (rta[RTA_DST-1]) if (rta[RTA_DST-1])
fl.nl_u.ip6_u.daddr = (struct in6_addr*)RTA_DATA(rta[RTA_DST-1]); fl.fl6_dst = (struct in6_addr*)RTA_DATA(rta[RTA_DST-1]);
if (rta[RTA_IIF-1]) if (rta[RTA_IIF-1])
memcpy(&iif, RTA_DATA(rta[RTA_IIF-1]), sizeof(int)); memcpy(&iif, RTA_DATA(rta[RTA_IIF-1]), sizeof(int));
...@@ -1617,8 +1611,7 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) ...@@ -1617,8 +1611,7 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
NETLINK_CB(skb).dst_pid = NETLINK_CB(in_skb).pid; NETLINK_CB(skb).dst_pid = NETLINK_CB(in_skb).pid;
err = rt6_fill_node(skb, rt, err = rt6_fill_node(skb, rt,
fl.nl_u.ip6_u.daddr, fl.fl6_dst, fl.fl6_src,
fl.nl_u.ip6_u.saddr,
iif, iif,
RTM_NEWROUTE, NETLINK_CB(in_skb).pid, RTM_NEWROUTE, NETLINK_CB(in_skb).pid,
nlh->nlmsg_seq, nlh); nlh->nlmsg_seq, nlh);
......
...@@ -670,12 +670,12 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, ...@@ -670,12 +670,12 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
fl.fl6_dst = &np->daddr; fl.fl6_dst = &np->daddr;
fl.fl6_src = saddr; fl.fl6_src = saddr;
fl.oif = sk->bound_dev_if; fl.oif = sk->bound_dev_if;
fl.uli_u.ports.dport = usin->sin6_port; fl.fl_ip_dport = usin->sin6_port;
fl.uli_u.ports.sport = inet->sport; fl.fl_ip_sport = inet->sport;
if (np->opt && np->opt->srcrt) { if (np->opt && np->opt->srcrt) {
struct rt0_hdr *rt0 = (struct rt0_hdr *)np->opt->srcrt; struct rt0_hdr *rt0 = (struct rt0_hdr *)np->opt->srcrt;
fl.nl_u.ip6_u.daddr = rt0->addr; fl.fl6_dst = rt0->addr;
} }
if (!fl.fl6_src) if (!fl.fl6_src)
...@@ -796,11 +796,11 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -796,11 +796,11 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
for now. for now.
*/ */
fl.proto = IPPROTO_TCP; fl.proto = IPPROTO_TCP;
fl.nl_u.ip6_u.daddr = &np->daddr; fl.fl6_dst = &np->daddr;
fl.nl_u.ip6_u.saddr = &np->saddr; fl.fl6_src = &np->saddr;
fl.oif = sk->bound_dev_if; fl.oif = sk->bound_dev_if;
fl.uli_u.ports.dport = inet->dport; fl.fl_ip_dport = inet->dport;
fl.uli_u.ports.sport = inet->sport; fl.fl_ip_sport = inet->sport;
dst = ip6_route_output(sk, &fl); dst = ip6_route_output(sk, &fl);
} else } else
...@@ -881,12 +881,12 @@ static int tcp_v6_send_synack(struct sock *sk, struct open_request *req, ...@@ -881,12 +881,12 @@ static int tcp_v6_send_synack(struct sock *sk, struct open_request *req,
int err = -1; int err = -1;
fl.proto = IPPROTO_TCP; fl.proto = IPPROTO_TCP;
fl.nl_u.ip6_u.daddr = &req->af.v6_req.rmt_addr; fl.fl6_dst = &req->af.v6_req.rmt_addr;
fl.nl_u.ip6_u.saddr = &req->af.v6_req.loc_addr; fl.fl6_src = &req->af.v6_req.loc_addr;
fl.fl6_flowlabel = 0; fl.fl6_flowlabel = 0;
fl.oif = req->af.v6_req.iif; fl.oif = req->af.v6_req.iif;
fl.uli_u.ports.dport = req->rmt_port; fl.fl_ip_dport = req->rmt_port;
fl.uli_u.ports.sport = inet_sk(sk)->sport; fl.fl_ip_sport = inet_sk(sk)->sport;
if (dst == NULL) { if (dst == NULL) {
opt = np->opt; opt = np->opt;
...@@ -901,7 +901,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct open_request *req, ...@@ -901,7 +901,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct open_request *req,
if (opt && opt->srcrt) { if (opt && opt->srcrt) {
struct rt0_hdr *rt0 = (struct rt0_hdr *) opt->srcrt; struct rt0_hdr *rt0 = (struct rt0_hdr *) opt->srcrt;
fl.nl_u.ip6_u.daddr = rt0->addr; fl.fl6_dst = rt0->addr;
} }
dst = ip6_route_output(sk, &fl); dst = ip6_route_output(sk, &fl);
...@@ -917,7 +917,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct open_request *req, ...@@ -917,7 +917,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct open_request *req,
&req->af.v6_req.loc_addr, &req->af.v6_req.rmt_addr, &req->af.v6_req.loc_addr, &req->af.v6_req.rmt_addr,
csum_partial((char *)th, skb->len, skb->csum)); csum_partial((char *)th, skb->len, skb->csum));
fl.nl_u.ip6_u.daddr = &req->af.v6_req.rmt_addr; fl.fl6_dst = &req->af.v6_req.rmt_addr;
err = ip6_xmit(sk, skb, &fl, opt); err = ip6_xmit(sk, skb, &fl, opt);
if (err == NET_XMIT_CN) if (err == NET_XMIT_CN)
err = 0; err = 0;
...@@ -1019,19 +1019,18 @@ static void tcp_v6_send_reset(struct sk_buff *skb) ...@@ -1019,19 +1019,18 @@ static void tcp_v6_send_reset(struct sk_buff *skb)
buff->csum = csum_partial((char *)t1, sizeof(*t1), 0); buff->csum = csum_partial((char *)t1, sizeof(*t1), 0);
fl.nl_u.ip6_u.daddr = &skb->nh.ipv6h->saddr; fl.fl6_dst = &skb->nh.ipv6h->saddr;
fl.nl_u.ip6_u.saddr = &skb->nh.ipv6h->daddr; fl.fl6_src = &skb->nh.ipv6h->daddr;
fl.fl6_flowlabel = 0; fl.fl6_flowlabel = 0;
t1->check = csum_ipv6_magic(fl.nl_u.ip6_u.saddr, t1->check = csum_ipv6_magic(fl.fl6_src, fl.fl6_dst,
fl.nl_u.ip6_u.daddr,
sizeof(*t1), IPPROTO_TCP, sizeof(*t1), IPPROTO_TCP,
buff->csum); buff->csum);
fl.proto = IPPROTO_TCP; fl.proto = IPPROTO_TCP;
fl.oif = tcp_v6_iif(skb); fl.oif = tcp_v6_iif(skb);
fl.uli_u.ports.dport = t1->dest; fl.fl_ip_dport = t1->dest;
fl.uli_u.ports.sport = t1->source; fl.fl_ip_sport = t1->source;
/* sk = NULL, but it is safe for now. RST socket required. */ /* sk = NULL, but it is safe for now. RST socket required. */
buff->dst = ip6_route_output(NULL, &fl); buff->dst = ip6_route_output(NULL, &fl);
...@@ -1084,19 +1083,18 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32 ...@@ -1084,19 +1083,18 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32
buff->csum = csum_partial((char *)t1, tot_len, 0); buff->csum = csum_partial((char *)t1, tot_len, 0);
fl.nl_u.ip6_u.daddr = &skb->nh.ipv6h->saddr; fl.fl6_dst = &skb->nh.ipv6h->saddr;
fl.nl_u.ip6_u.saddr = &skb->nh.ipv6h->daddr; fl.fl6_src = &skb->nh.ipv6h->daddr;
fl.fl6_flowlabel = 0; fl.fl6_flowlabel = 0;
t1->check = csum_ipv6_magic(fl.nl_u.ip6_u.saddr, t1->check = csum_ipv6_magic(fl.fl6_src, fl.fl6_dst,
fl.nl_u.ip6_u.daddr,
tot_len, IPPROTO_TCP, tot_len, IPPROTO_TCP,
buff->csum); buff->csum);
fl.proto = IPPROTO_TCP; fl.proto = IPPROTO_TCP;
fl.oif = tcp_v6_iif(skb); fl.oif = tcp_v6_iif(skb);
fl.uli_u.ports.dport = t1->dest; fl.fl_ip_dport = t1->dest;
fl.uli_u.ports.sport = t1->source; fl.fl_ip_sport = t1->source;
buff->dst = ip6_route_output(NULL, &fl); buff->dst = ip6_route_output(NULL, &fl);
...@@ -1335,16 +1333,16 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ...@@ -1335,16 +1333,16 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
if (dst == NULL) { if (dst == NULL) {
fl.proto = IPPROTO_TCP; fl.proto = IPPROTO_TCP;
fl.nl_u.ip6_u.daddr = &req->af.v6_req.rmt_addr; fl.fl6_dst = &req->af.v6_req.rmt_addr;
if (opt && opt->srcrt) { if (opt && opt->srcrt) {
struct rt0_hdr *rt0 = (struct rt0_hdr *) opt->srcrt; struct rt0_hdr *rt0 = (struct rt0_hdr *) opt->srcrt;
fl.nl_u.ip6_u.daddr = rt0->addr; fl.fl6_dst = rt0->addr;
} }
fl.nl_u.ip6_u.saddr = &req->af.v6_req.loc_addr; fl.fl6_src = &req->af.v6_req.loc_addr;
fl.fl6_flowlabel = 0; fl.fl6_flowlabel = 0;
fl.oif = sk->bound_dev_if; fl.oif = sk->bound_dev_if;
fl.uli_u.ports.dport = req->rmt_port; fl.fl_ip_dport = req->rmt_port;
fl.uli_u.ports.sport = inet_sk(sk)->sport; fl.fl_ip_sport = inet_sk(sk)->sport;
dst = ip6_route_output(sk, &fl); dst = ip6_route_output(sk, &fl);
} }
...@@ -1732,16 +1730,16 @@ static int tcp_v6_rebuild_header(struct sock *sk) ...@@ -1732,16 +1730,16 @@ static int tcp_v6_rebuild_header(struct sock *sk)
struct flowi fl; struct flowi fl;
fl.proto = IPPROTO_TCP; fl.proto = IPPROTO_TCP;
fl.nl_u.ip6_u.daddr = &np->daddr; fl.fl6_dst = &np->daddr;
fl.nl_u.ip6_u.saddr = &np->saddr; fl.fl6_src = &np->saddr;
fl.fl6_flowlabel = np->flow_label; fl.fl6_flowlabel = np->flow_label;
fl.oif = sk->bound_dev_if; fl.oif = sk->bound_dev_if;
fl.uli_u.ports.dport = inet->dport; fl.fl_ip_dport = inet->dport;
fl.uli_u.ports.sport = inet->sport; fl.fl_ip_sport = inet->sport;
if (np->opt && np->opt->srcrt) { if (np->opt && np->opt->srcrt) {
struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
fl.nl_u.ip6_u.daddr = rt0->addr; fl.fl6_dst = rt0->addr;
} }
dst = ip6_route_output(sk, &fl); dst = ip6_route_output(sk, &fl);
...@@ -1774,12 +1772,12 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok) ...@@ -1774,12 +1772,12 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok)
fl.fl6_flowlabel = np->flow_label; fl.fl6_flowlabel = np->flow_label;
IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel); IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
fl.oif = sk->bound_dev_if; fl.oif = sk->bound_dev_if;
fl.uli_u.ports.sport = inet->sport; fl.fl_ip_sport = inet->sport;
fl.uli_u.ports.dport = inet->dport; fl.fl_ip_dport = inet->dport;
if (np->opt && np->opt->srcrt) { if (np->opt && np->opt->srcrt) {
struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
fl.nl_u.ip6_u.daddr = rt0->addr; fl.fl6_dst = rt0->addr;
} }
dst = __sk_dst_check(sk, np->dst_cookie); dst = __sk_dst_check(sk, np->dst_cookie);
...@@ -1799,7 +1797,7 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok) ...@@ -1799,7 +1797,7 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok)
skb->dst = dst_clone(dst); skb->dst = dst_clone(dst);
/* Restore final destination back after routing done */ /* Restore final destination back after routing done */
fl.nl_u.ip6_u.daddr = &np->daddr; fl.fl6_dst = &np->daddr;
return ip6_xmit(sk, skb, &fl, np->opt); return ip6_xmit(sk, skb, &fl, np->opt);
} }
......
...@@ -352,8 +352,8 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -352,8 +352,8 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
fl.fl6_dst = &np->daddr; fl.fl6_dst = &np->daddr;
fl.fl6_src = &saddr; fl.fl6_src = &saddr;
fl.oif = sk->bound_dev_if; fl.oif = sk->bound_dev_if;
fl.uli_u.ports.dport = inet->dport; fl.fl_ip_dport = inet->dport;
fl.uli_u.ports.sport = inet->sport; fl.fl_ip_sport = inet->sport;
if (!fl.oif && (addr_type&IPV6_ADDR_MULTICAST)) if (!fl.oif && (addr_type&IPV6_ADDR_MULTICAST))
fl.oif = np->mcast_oif; fl.oif = np->mcast_oif;
...@@ -936,8 +936,8 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg ...@@ -936,8 +936,8 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg
fl.fl6_dst = daddr; fl.fl6_dst = daddr;
if (fl.fl6_src == NULL && !ipv6_addr_any(&np->saddr)) if (fl.fl6_src == NULL && !ipv6_addr_any(&np->saddr))
fl.fl6_src = &np->saddr; fl.fl6_src = &np->saddr;
fl.uli_u.ports.dport = udh.uh.dest; fl.fl_ip_dport = udh.uh.dest;
fl.uli_u.ports.sport = udh.uh.source; fl.fl_ip_sport = udh.uh.source;
err = ip6_build_xmit(sk, udpv6_getfrag, &udh, &fl, len, opt, hlimit, err = ip6_build_xmit(sk, udpv6_getfrag, &udh, &fl, len, opt, hlimit,
msg->msg_flags); msg->msg_flags);
......
...@@ -195,8 +195,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl) ...@@ -195,8 +195,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl)
if (pskb_may_pull(skb, skb->nh.raw + offset + 4 - skb->data)) { if (pskb_may_pull(skb, skb->nh.raw + offset + 4 - skb->data)) {
u16 *ports = (u16 *)exthdr; u16 *ports = (u16 *)exthdr;
fl->uli_u.ports.sport = ports[0]; fl->fl_ip_sport = ports[0];
fl->uli_u.ports.dport = ports[1]; fl->fl_ip_dport = ports[1];
} }
return; return;
...@@ -205,7 +205,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl) ...@@ -205,7 +205,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl)
case IPPROTO_ESP: case IPPROTO_ESP:
case IPPROTO_COMP: case IPPROTO_COMP:
default: default:
fl->uli_u.spi = 0; fl->fl_ipsec_spi = 0;
return; return;
}; };
} }
......
...@@ -27,9 +27,9 @@ __xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl, ...@@ -27,9 +27,9 @@ __xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl,
* to current session. */ * to current session. */
memcpy(&x->sel.daddr, fl->fl6_dst, sizeof(struct in6_addr)); memcpy(&x->sel.daddr, fl->fl6_dst, sizeof(struct in6_addr));
memcpy(&x->sel.saddr, fl->fl6_src, sizeof(struct in6_addr)); memcpy(&x->sel.saddr, fl->fl6_src, sizeof(struct in6_addr));
x->sel.dport = fl->uli_u.ports.dport; x->sel.dport = fl->fl_ip_dport;
x->sel.dport_mask = ~0; x->sel.dport_mask = ~0;
x->sel.sport = fl->uli_u.ports.sport; x->sel.sport = fl->fl_ip_sport;
x->sel.sport_mask = ~0; x->sel.sport_mask = ~0;
x->sel.prefixlen_d = 128; x->sel.prefixlen_d = 128;
x->sel.prefixlen_s = 128; x->sel.prefixlen_s = 128;
......
...@@ -165,8 +165,8 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport, ...@@ -165,8 +165,8 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
fl.oif = transport->saddr.v6.sin6_scope_id; fl.oif = transport->saddr.v6.sin6_scope_id;
else else
fl.oif = sk->bound_dev_if; fl.oif = sk->bound_dev_if;
fl.uli_u.ports.sport = inet_sk(sk)->sport; fl.fl_ip_sport = inet_sk(sk)->sport;
fl.uli_u.ports.dport = transport->ipaddr.v6.sin6_port; fl.fl_ip_dport = transport->ipaddr.v6.sin6_port;
if (np->opt && np->opt->srcrt) { if (np->opt && np->opt->srcrt) {
struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment