Commit 5811662b authored by Changli Gao's avatar Changli Gao Committed by David S. Miller

net: use the macros defined for the members of flowi

Use the macros defined for the members of flowi to clean the code up.
Signed-off-by: default avatarChangli Gao <xiaosuo@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dd68ad22
...@@ -169,14 +169,12 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, ...@@ -169,14 +169,12 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
{ {
struct flowi fl = { .oif = oif, struct flowi fl = { .oif = oif,
.mark = sk->sk_mark, .mark = sk->sk_mark,
.nl_u = { .ip4_u = { .daddr = dst, .fl4_dst = dst,
.saddr = src, .fl4_src = src,
.tos = tos } }, .fl4_tos = tos,
.proto = protocol, .proto = protocol,
.uli_u = { .ports = .fl_ip_sport = sport,
{ .sport = sport, .fl_ip_dport = dport };
.dport = dport } } };
int err; int err;
struct net *net = sock_net(sk); struct net *net = sock_net(sk);
......
...@@ -502,7 +502,8 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip) ...@@ -502,7 +502,8 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
struct atmarp_entry *entry; struct atmarp_entry *entry;
int error; int error;
struct clip_vcc *clip_vcc; struct clip_vcc *clip_vcc;
struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip, .tos = 1}} }; struct flowi fl = { .fl4_dst = ip,
.fl4_tos = 1 };
struct rtable *rt; struct rtable *rt;
if (vcc->push != clip_push) { if (vcc->push != clip_push) {
......
...@@ -413,13 +413,8 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb) ...@@ -413,13 +413,8 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
if (dnat_took_place(skb)) { if (dnat_took_place(skb)) {
if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) { if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {
struct flowi fl = { struct flowi fl = {
.nl_u = { .fl4_dst = iph->daddr,
.ip4_u = { .fl4_tos = RT_TOS(iph->tos),
.daddr = iph->daddr,
.saddr = 0,
.tos = RT_TOS(iph->tos) },
},
.proto = 0,
}; };
struct in_device *in_dev = __in_dev_get_rcu(dev); struct in_device *in_dev = __in_dev_get_rcu(dev);
......
...@@ -462,15 +462,12 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk, ...@@ -462,15 +462,12 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
{ {
struct rtable *rt; struct rtable *rt;
struct flowi fl = { .oif = skb_rtable(skb)->rt_iif, struct flowi fl = { .oif = skb_rtable(skb)->rt_iif,
.nl_u = { .ip4_u = .fl4_dst = ip_hdr(skb)->saddr,
{ .daddr = ip_hdr(skb)->saddr, .fl4_src = ip_hdr(skb)->daddr,
.saddr = ip_hdr(skb)->daddr, .fl4_tos = RT_CONN_FLAGS(sk),
.tos = RT_CONN_FLAGS(sk) } },
.proto = sk->sk_protocol, .proto = sk->sk_protocol,
.uli_u = { .ports = .fl_ip_sport = dccp_hdr(skb)->dccph_dport,
{ .sport = dccp_hdr(skb)->dccph_dport, .fl_ip_dport = dccp_hdr(skb)->dccph_sport
.dport = dccp_hdr(skb)->dccph_sport }
}
}; };
security_skb_classify_flow(skb, &fl); security_skb_classify_flow(skb, &fl);
......
...@@ -271,10 +271,10 @@ static void dn_dst_link_failure(struct sk_buff *skb) ...@@ -271,10 +271,10 @@ static void dn_dst_link_failure(struct sk_buff *skb)
static inline int compare_keys(struct flowi *fl1, struct flowi *fl2) static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
{ {
return ((fl1->nl_u.dn_u.daddr ^ fl2->nl_u.dn_u.daddr) | return ((fl1->fld_dst ^ fl2->fld_dst) |
(fl1->nl_u.dn_u.saddr ^ fl2->nl_u.dn_u.saddr) | (fl1->fld_src ^ fl2->fld_src) |
(fl1->mark ^ fl2->mark) | (fl1->mark ^ fl2->mark) |
(fl1->nl_u.dn_u.scope ^ fl2->nl_u.dn_u.scope) | (fl1->fld_scope ^ fl2->fld_scope) |
(fl1->oif ^ fl2->oif) | (fl1->oif ^ fl2->oif) |
(fl1->iif ^ fl2->iif)) == 0; (fl1->iif ^ fl2->iif)) == 0;
} }
...@@ -882,11 +882,9 @@ static inline __le16 dn_fib_rules_map_destination(__le16 daddr, struct dn_fib_re ...@@ -882,11 +882,9 @@ static inline __le16 dn_fib_rules_map_destination(__le16 daddr, struct dn_fib_re
static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *oldflp, int try_hard) static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *oldflp, int try_hard)
{ {
struct flowi fl = { .nl_u = { .dn_u = struct flowi fl = { .fld_dst = oldflp->fld_dst,
{ .daddr = oldflp->fld_dst, .fld_src = oldflp->fld_src,
.saddr = oldflp->fld_src, .fld_scope = RT_SCOPE_UNIVERSE,
.scope = RT_SCOPE_UNIVERSE,
} },
.mark = oldflp->mark, .mark = oldflp->mark,
.iif = init_net.loopback_dev->ifindex, .iif = init_net.loopback_dev->ifindex,
.oif = oldflp->oif }; .oif = oldflp->oif };
...@@ -1230,11 +1228,9 @@ static int dn_route_input_slow(struct sk_buff *skb) ...@@ -1230,11 +1228,9 @@ static int dn_route_input_slow(struct sk_buff *skb)
int flags = 0; int flags = 0;
__le16 gateway = 0; __le16 gateway = 0;
__le16 local_src = 0; __le16 local_src = 0;
struct flowi fl = { .nl_u = { .dn_u = struct flowi fl = { .fld_dst = cb->dst,
{ .daddr = cb->dst, .fld_src = cb->src,
.saddr = cb->src, .fld_scope = RT_SCOPE_UNIVERSE,
.scope = RT_SCOPE_UNIVERSE,
} },
.mark = skb->mark, .mark = skb->mark,
.iif = skb->dev->ifindex }; .iif = skb->dev->ifindex };
struct dn_fib_res res = { .fi = NULL, .type = RTN_UNREACHABLE }; struct dn_fib_res res = { .fi = NULL, .type = RTN_UNREACHABLE };
......
...@@ -175,7 +175,7 @@ static int dn_fib_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh, ...@@ -175,7 +175,7 @@ static int dn_fib_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
unsigned dnet_addr_type(__le16 addr) unsigned dnet_addr_type(__le16 addr)
{ {
struct flowi fl = { .nl_u = { .dn_u = { .daddr = addr } } }; struct flowi fl = { .fld_dst = addr };
struct dn_fib_res res; struct dn_fib_res res;
unsigned ret = RTN_UNICAST; unsigned ret = RTN_UNICAST;
struct dn_fib_table *tb = dn_fib_get_table(RT_TABLE_LOCAL, 0); struct dn_fib_table *tb = dn_fib_get_table(RT_TABLE_LOCAL, 0);
......
...@@ -1148,21 +1148,13 @@ int inet_sk_rebuild_header(struct sock *sk) ...@@ -1148,21 +1148,13 @@ int inet_sk_rebuild_header(struct sock *sk)
struct flowi fl = { struct flowi fl = {
.oif = sk->sk_bound_dev_if, .oif = sk->sk_bound_dev_if,
.mark = sk->sk_mark, .mark = sk->sk_mark,
.nl_u = { .fl4_dst = daddr,
.ip4_u = { .fl4_src = inet->inet_saddr,
.daddr = daddr, .fl4_tos = RT_CONN_FLAGS(sk),
.saddr = inet->inet_saddr,
.tos = RT_CONN_FLAGS(sk),
},
},
.proto = sk->sk_protocol, .proto = sk->sk_protocol,
.flags = inet_sk_flowi_flags(sk), .flags = inet_sk_flowi_flags(sk),
.uli_u = { .fl_ip_sport = inet->inet_sport,
.ports = { .fl_ip_dport = inet->inet_dport,
.sport = inet->inet_sport,
.dport = inet->inet_dport,
},
},
}; };
security_sk_classify_flow(sk, &fl); security_sk_classify_flow(sk, &fl);
......
...@@ -433,8 +433,8 @@ static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip) ...@@ -433,8 +433,8 @@ static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip)
static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev) static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev)
{ {
struct flowi fl = { .nl_u = { .ip4_u = { .daddr = sip, struct flowi fl = { .fl4_dst = sip,
.saddr = tip } } }; .fl4_src = tip };
struct rtable *rt; struct rtable *rt;
int flag = 0; int flag = 0;
/*unsigned long now; */ /*unsigned long now; */
...@@ -1061,8 +1061,8 @@ static int arp_req_set(struct net *net, struct arpreq *r, ...@@ -1061,8 +1061,8 @@ static int arp_req_set(struct net *net, struct arpreq *r,
if (r->arp_flags & ATF_PERM) if (r->arp_flags & ATF_PERM)
r->arp_flags |= ATF_COM; r->arp_flags |= ATF_COM;
if (dev == NULL) { if (dev == NULL) {
struct flowi fl = { .nl_u.ip4_u = { .daddr = ip, struct flowi fl = { .fl4_dst = ip,
.tos = RTO_ONLINK } }; .fl4_tos = RTO_ONLINK };
struct rtable *rt; struct rtable *rt;
err = ip_route_output_key(net, &rt, &fl); err = ip_route_output_key(net, &rt, &fl);
if (err != 0) if (err != 0)
...@@ -1169,8 +1169,8 @@ static int arp_req_delete(struct net *net, struct arpreq *r, ...@@ -1169,8 +1169,8 @@ static int arp_req_delete(struct net *net, struct arpreq *r,
ip = ((struct sockaddr_in *)&r->arp_pa)->sin_addr.s_addr; ip = ((struct sockaddr_in *)&r->arp_pa)->sin_addr.s_addr;
if (dev == NULL) { if (dev == NULL) {
struct flowi fl = { .nl_u.ip4_u = { .daddr = ip, struct flowi fl = { .fl4_dst = ip,
.tos = RTO_ONLINK } }; .fl4_tos = RTO_ONLINK };
struct rtable *rt; struct rtable *rt;
err = ip_route_output_key(net, &rt, &fl); err = ip_route_output_key(net, &rt, &fl);
if (err != 0) if (err != 0)
......
...@@ -158,11 +158,7 @@ static void fib_flush(struct net *net) ...@@ -158,11 +158,7 @@ static void fib_flush(struct net *net)
struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref) struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref)
{ {
struct flowi fl = { struct flowi fl = {
.nl_u = { .fl4_dst = addr,
.ip4_u = {
.daddr = addr
}
},
.flags = FLOWI_FLAG_MATCH_ANY_IIF .flags = FLOWI_FLAG_MATCH_ANY_IIF
}; };
struct fib_result res = { 0 }; struct fib_result res = { 0 };
...@@ -193,7 +189,7 @@ static inline unsigned __inet_dev_addr_type(struct net *net, ...@@ -193,7 +189,7 @@ static inline unsigned __inet_dev_addr_type(struct net *net,
const struct net_device *dev, const struct net_device *dev,
__be32 addr) __be32 addr)
{ {
struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } }; struct flowi fl = { .fl4_dst = addr };
struct fib_result res; struct fib_result res;
unsigned ret = RTN_BROADCAST; unsigned ret = RTN_BROADCAST;
struct fib_table *local_table; struct fib_table *local_table;
...@@ -247,13 +243,9 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, ...@@ -247,13 +243,9 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
{ {
struct in_device *in_dev; struct in_device *in_dev;
struct flowi fl = { struct flowi fl = {
.nl_u = { .fl4_dst = src,
.ip4_u = { .fl4_src = dst,
.daddr = src, .fl4_tos = tos,
.saddr = dst,
.tos = tos
}
},
.mark = mark, .mark = mark,
.iif = oif .iif = oif
}; };
...@@ -853,13 +845,9 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb) ...@@ -853,13 +845,9 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb)
struct fib_result res; struct fib_result res;
struct flowi fl = { struct flowi fl = {
.mark = frn->fl_mark, .mark = frn->fl_mark,
.nl_u = { .fl4_dst = frn->fl_addr,
.ip4_u = { .fl4_tos = frn->fl_tos,
.daddr = frn->fl_addr, .fl4_scope = frn->fl_scope,
.tos = frn->fl_tos,
.scope = frn->fl_scope
}
}
}; };
#ifdef CONFIG_IP_MULTIPLE_TABLES #ifdef CONFIG_IP_MULTIPLE_TABLES
......
...@@ -563,12 +563,8 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi, ...@@ -563,12 +563,8 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
rcu_read_lock(); rcu_read_lock();
{ {
struct flowi fl = { struct flowi fl = {
.nl_u = { .fl4_dst = nh->nh_gw,
.ip4_u = { .fl4_scope = cfg->fc_scope + 1,
.daddr = nh->nh_gw,
.scope = cfg->fc_scope + 1,
},
},
.oif = nh->nh_oif, .oif = nh->nh_oif,
}; };
......
...@@ -386,10 +386,9 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) ...@@ -386,10 +386,9 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
daddr = icmp_param->replyopts.faddr; daddr = icmp_param->replyopts.faddr;
} }
{ {
struct flowi fl = { .nl_u = { .ip4_u = struct flowi fl = { .fl4_dst= daddr,
{ .daddr = daddr, .fl4_src = rt->rt_spec_dst,
.saddr = rt->rt_spec_dst, .fl4_tos = RT_TOS(ip_hdr(skb)->tos),
.tos = RT_TOS(ip_hdr(skb)->tos) } },
.proto = IPPROTO_ICMP }; .proto = IPPROTO_ICMP };
security_skb_classify_flow(skb, &fl); security_skb_classify_flow(skb, &fl);
if (ip_route_output_key(net, &rt, &fl)) if (ip_route_output_key(net, &rt, &fl))
...@@ -542,22 +541,13 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) ...@@ -542,22 +541,13 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
{ {
struct flowi fl = { struct flowi fl = {
.nl_u = { .fl4_dst = icmp_param.replyopts.srr ?
.ip4_u = { icmp_param.replyopts.faddr : iph->saddr,
.daddr = icmp_param.replyopts.srr ? .fl4_src = saddr,
icmp_param.replyopts.faddr : .fl4_tos = RT_TOS(tos),
iph->saddr,
.saddr = saddr,
.tos = RT_TOS(tos)
}
},
.proto = IPPROTO_ICMP, .proto = IPPROTO_ICMP,
.uli_u = { .fl_icmp_type = type,
.icmpt = { .fl_icmp_code = code,
.type = type,
.code = code
}
}
}; };
int err; int err;
struct rtable *rt2; struct rtable *rt2;
......
...@@ -314,8 +314,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) ...@@ -314,8 +314,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
{ {
struct flowi fl = { .oif = dev->ifindex, struct flowi fl = { .oif = dev->ifindex,
.nl_u = { .ip4_u = { .fl4_dst = IGMPV3_ALL_MCR,
.daddr = IGMPV3_ALL_MCR } },
.proto = IPPROTO_IGMP }; .proto = IPPROTO_IGMP };
if (ip_route_output_key(net, &rt, &fl)) { if (ip_route_output_key(net, &rt, &fl)) {
kfree_skb(skb); kfree_skb(skb);
...@@ -660,7 +659,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, ...@@ -660,7 +659,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
{ {
struct flowi fl = { .oif = dev->ifindex, struct flowi fl = { .oif = dev->ifindex,
.nl_u = { .ip4_u = { .daddr = dst } }, .fl4_dst = dst,
.proto = IPPROTO_IGMP }; .proto = IPPROTO_IGMP };
if (ip_route_output_key(net, &rt, &fl)) if (ip_route_output_key(net, &rt, &fl))
return -1; return -1;
...@@ -1425,8 +1424,7 @@ void ip_mc_destroy_dev(struct in_device *in_dev) ...@@ -1425,8 +1424,7 @@ void ip_mc_destroy_dev(struct in_device *in_dev)
/* RTNL is locked */ /* RTNL is locked */
static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr) static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr)
{ {
struct flowi fl = { .nl_u = { .ip4_u = struct flowi fl = { .fl4_dst = imr->imr_multiaddr.s_addr };
{ .daddr = imr->imr_multiaddr.s_addr } } };
struct rtable *rt; struct rtable *rt;
struct net_device *dev = NULL; struct net_device *dev = NULL;
struct in_device *idev = NULL; struct in_device *idev = NULL;
......
...@@ -358,17 +358,14 @@ struct dst_entry *inet_csk_route_req(struct sock *sk, ...@@ -358,17 +358,14 @@ struct dst_entry *inet_csk_route_req(struct sock *sk,
struct ip_options *opt = inet_rsk(req)->opt; struct ip_options *opt = inet_rsk(req)->opt;
struct flowi fl = { .oif = sk->sk_bound_dev_if, struct flowi fl = { .oif = sk->sk_bound_dev_if,
.mark = sk->sk_mark, .mark = sk->sk_mark,
.nl_u = { .ip4_u = .fl4_dst = ((opt && opt->srr) ?
{ .daddr = ((opt && opt->srr) ? opt->faddr : ireq->rmt_addr),
opt->faddr : .fl4_src = ireq->loc_addr,
ireq->rmt_addr), .fl4_tos = RT_CONN_FLAGS(sk),
.saddr = ireq->loc_addr,
.tos = RT_CONN_FLAGS(sk) } },
.proto = sk->sk_protocol, .proto = sk->sk_protocol,
.flags = inet_sk_flowi_flags(sk), .flags = inet_sk_flowi_flags(sk),
.uli_u = { .ports = .fl_ip_sport = inet_sk(sk)->inet_sport,
{ .sport = inet_sk(sk)->inet_sport, .fl_ip_dport = ireq->rmt_port };
.dport = ireq->rmt_port } } };
struct net *net = sock_net(sk); struct net *net = sock_net(sk);
security_req_classify_flow(req, &fl); security_req_classify_flow(req, &fl);
......
...@@ -772,14 +772,9 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev ...@@ -772,14 +772,9 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
{ {
struct flowi fl = { struct flowi fl = {
.oif = tunnel->parms.link, .oif = tunnel->parms.link,
.nl_u = { .fl4_dst = dst,
.ip4_u = { .fl4_src = tiph->saddr,
.daddr = dst, .fl4_tos = RT_TOS(tos),
.saddr = tiph->saddr,
.tos = RT_TOS(tos)
}
},
.proto = IPPROTO_GRE,
.fl_gre_key = tunnel->parms.o_key .fl_gre_key = tunnel->parms.o_key
}; };
if (ip_route_output_key(dev_net(dev), &rt, &fl)) { if (ip_route_output_key(dev_net(dev), &rt, &fl)) {
...@@ -951,13 +946,9 @@ static int ipgre_tunnel_bind_dev(struct net_device *dev) ...@@ -951,13 +946,9 @@ static int ipgre_tunnel_bind_dev(struct net_device *dev)
if (iph->daddr) { if (iph->daddr) {
struct flowi fl = { struct flowi fl = {
.oif = tunnel->parms.link, .oif = tunnel->parms.link,
.nl_u = { .fl4_dst = iph->daddr,
.ip4_u = { .fl4_src = iph->saddr,
.daddr = iph->daddr, .fl4_tos = RT_TOS(iph->tos),
.saddr = iph->saddr,
.tos = RT_TOS(iph->tos)
}
},
.proto = IPPROTO_GRE, .proto = IPPROTO_GRE,
.fl_gre_key = tunnel->parms.o_key .fl_gre_key = tunnel->parms.o_key
}; };
...@@ -1217,13 +1208,9 @@ static int ipgre_open(struct net_device *dev) ...@@ -1217,13 +1208,9 @@ static int ipgre_open(struct net_device *dev)
if (ipv4_is_multicast(t->parms.iph.daddr)) { if (ipv4_is_multicast(t->parms.iph.daddr)) {
struct flowi fl = { struct flowi fl = {
.oif = t->parms.link, .oif = t->parms.link,
.nl_u = { .fl4_dst = t->parms.iph.daddr,
.ip4_u = { .fl4_src = t->parms.iph.saddr,
.daddr = t->parms.iph.daddr, .fl4_tos = RT_TOS(t->parms.iph.tos),
.saddr = t->parms.iph.saddr,
.tos = RT_TOS(t->parms.iph.tos)
}
},
.proto = IPPROTO_GRE, .proto = IPPROTO_GRE,
.fl_gre_key = t->parms.o_key .fl_gre_key = t->parms.o_key
}; };
......
...@@ -341,15 +341,13 @@ int ip_queue_xmit(struct sk_buff *skb) ...@@ -341,15 +341,13 @@ int ip_queue_xmit(struct sk_buff *skb)
{ {
struct flowi fl = { .oif = sk->sk_bound_dev_if, struct flowi fl = { .oif = sk->sk_bound_dev_if,
.mark = sk->sk_mark, .mark = sk->sk_mark,
.nl_u = { .ip4_u = .fl4_dst = daddr,
{ .daddr = daddr, .fl4_src = inet->inet_saddr,
.saddr = inet->inet_saddr, .fl4_tos = RT_CONN_FLAGS(sk),
.tos = RT_CONN_FLAGS(sk) } },
.proto = sk->sk_protocol, .proto = sk->sk_protocol,
.flags = inet_sk_flowi_flags(sk), .flags = inet_sk_flowi_flags(sk),
.uli_u = { .ports = .fl_ip_sport = inet->inet_sport,
{ .sport = inet->inet_sport, .fl_ip_dport = inet->inet_dport };
.dport = inet->inet_dport } } };
/* If this fails, retransmit mechanism of transport layer will /* If this fails, retransmit mechanism of transport layer will
* keep trying until route appears or the connection times * keep trying until route appears or the connection times
...@@ -1404,14 +1402,11 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar ...@@ -1404,14 +1402,11 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
{ {
struct flowi fl = { .oif = arg->bound_dev_if, struct flowi fl = { .oif = arg->bound_dev_if,
.nl_u = { .ip4_u = .fl4_dst = daddr,
{ .daddr = daddr, .fl4_src = rt->rt_spec_dst,
.saddr = rt->rt_spec_dst, .fl4_tos = RT_TOS(ip_hdr(skb)->tos),
.tos = RT_TOS(ip_hdr(skb)->tos) } }, .fl_ip_sport = tcp_hdr(skb)->dest,
/* Not quite clean, but right. */ .fl_ip_dport = tcp_hdr(skb)->source,
.uli_u = { .ports =
{ .sport = tcp_hdr(skb)->dest,
.dport = tcp_hdr(skb)->source } },
.proto = sk->sk_protocol, .proto = sk->sk_protocol,
.flags = ip_reply_arg_flowi_flags(arg) }; .flags = ip_reply_arg_flowi_flags(arg) };
security_skb_classify_flow(skb, &fl); security_skb_classify_flow(skb, &fl);
......
...@@ -463,13 +463,9 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -463,13 +463,9 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct flowi fl = { struct flowi fl = {
.oif = tunnel->parms.link, .oif = tunnel->parms.link,
.nl_u = { .fl4_dst = dst,
.ip4_u = { .fl4_src= tiph->saddr,
.daddr = dst, .fl4_tos = RT_TOS(tos),
.saddr = tiph->saddr,
.tos = RT_TOS(tos)
}
},
.proto = IPPROTO_IPIP .proto = IPPROTO_IPIP
}; };
...@@ -589,13 +585,9 @@ static void ipip_tunnel_bind_dev(struct net_device *dev) ...@@ -589,13 +585,9 @@ static void ipip_tunnel_bind_dev(struct net_device *dev)
if (iph->daddr) { if (iph->daddr) {
struct flowi fl = { struct flowi fl = {
.oif = tunnel->parms.link, .oif = tunnel->parms.link,
.nl_u = { .fl4_dst = iph->daddr,
.ip4_u = { .fl4_src = iph->saddr,
.daddr = iph->daddr, .fl4_tos = RT_TOS(iph->tos),
.saddr = iph->saddr,
.tos = RT_TOS(iph->tos)
}
},
.proto = IPPROTO_IPIP .proto = IPPROTO_IPIP
}; };
struct rtable *rt; struct rtable *rt;
......
...@@ -1537,13 +1537,9 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt, ...@@ -1537,13 +1537,9 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
if (vif->flags & VIFF_TUNNEL) { if (vif->flags & VIFF_TUNNEL) {
struct flowi fl = { struct flowi fl = {
.oif = vif->link, .oif = vif->link,
.nl_u = { .fl4_dst = vif->remote,
.ip4_u = { .fl4_src = vif->local,
.daddr = vif->remote, .fl4_tos = RT_TOS(iph->tos),
.saddr = vif->local,
.tos = RT_TOS(iph->tos)
}
},
.proto = IPPROTO_IPIP .proto = IPPROTO_IPIP
}; };
...@@ -1553,12 +1549,8 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt, ...@@ -1553,12 +1549,8 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
} else { } else {
struct flowi fl = { struct flowi fl = {
.oif = vif->link, .oif = vif->link,
.nl_u = { .fl4_dst = iph->daddr,
.ip4_u = { .fl4_tos = RT_TOS(iph->tos),
.daddr = iph->daddr,
.tos = RT_TOS(iph->tos)
}
},
.proto = IPPROTO_IPIP .proto = IPPROTO_IPIP
}; };
......
...@@ -31,10 +31,10 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) ...@@ -31,10 +31,10 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
* packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook. * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook.
*/ */
if (addr_type == RTN_LOCAL) { if (addr_type == RTN_LOCAL) {
fl.nl_u.ip4_u.daddr = iph->daddr; fl.fl4_dst = iph->daddr;
if (type == RTN_LOCAL) if (type == RTN_LOCAL)
fl.nl_u.ip4_u.saddr = iph->saddr; fl.fl4_src = iph->saddr;
fl.nl_u.ip4_u.tos = RT_TOS(iph->tos); fl.fl4_tos = RT_TOS(iph->tos);
fl.oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; fl.oif = skb->sk ? skb->sk->sk_bound_dev_if : 0;
fl.mark = skb->mark; fl.mark = skb->mark;
fl.flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0; fl.flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0;
...@@ -47,7 +47,7 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) ...@@ -47,7 +47,7 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
} else { } else {
/* non-local src, find valid iif to satisfy /* non-local src, find valid iif to satisfy
* rp-filter when calling ip_route_input. */ * rp-filter when calling ip_route_input. */
fl.nl_u.ip4_u.daddr = iph->saddr; fl.fl4_dst = iph->saddr;
if (ip_route_output_key(net, &rt, &fl) != 0) if (ip_route_output_key(net, &rt, &fl) != 0)
return -1; return -1;
......
...@@ -549,10 +549,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -549,10 +549,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
{ {
struct flowi fl = { .oif = ipc.oif, struct flowi fl = { .oif = ipc.oif,
.mark = sk->sk_mark, .mark = sk->sk_mark,
.nl_u = { .ip4_u = .fl4_dst = daddr,
{ .daddr = daddr, .fl4_src = saddr,
.saddr = saddr, .fl4_tos = tos,
.tos = tos } },
.proto = inet->hdrincl ? IPPROTO_RAW : .proto = inet->hdrincl ? IPPROTO_RAW :
sk->sk_protocol, sk->sk_protocol,
}; };
......
...@@ -684,17 +684,17 @@ static inline bool rt_caching(const struct net *net) ...@@ -684,17 +684,17 @@ static inline bool rt_caching(const struct net *net)
static inline bool compare_hash_inputs(const struct flowi *fl1, static inline bool compare_hash_inputs(const struct flowi *fl1,
const struct flowi *fl2) const struct flowi *fl2)
{ {
return ((((__force u32)fl1->nl_u.ip4_u.daddr ^ (__force u32)fl2->nl_u.ip4_u.daddr) | return ((((__force u32)fl1->fl4_dst ^ (__force u32)fl2->fl4_dst) |
((__force u32)fl1->nl_u.ip4_u.saddr ^ (__force u32)fl2->nl_u.ip4_u.saddr) | ((__force u32)fl1->fl4_src ^ (__force u32)fl2->fl4_src) |
(fl1->iif ^ fl2->iif)) == 0); (fl1->iif ^ fl2->iif)) == 0);
} }
static inline int compare_keys(struct flowi *fl1, struct flowi *fl2) static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
{ {
return (((__force u32)fl1->nl_u.ip4_u.daddr ^ (__force u32)fl2->nl_u.ip4_u.daddr) | return (((__force u32)fl1->fl4_dst ^ (__force u32)fl2->fl4_dst) |
((__force u32)fl1->nl_u.ip4_u.saddr ^ (__force u32)fl2->nl_u.ip4_u.saddr) | ((__force u32)fl1->fl4_src ^ (__force u32)fl2->fl4_src) |
(fl1->mark ^ fl2->mark) | (fl1->mark ^ fl2->mark) |
(*(u16 *)&fl1->nl_u.ip4_u.tos ^ *(u16 *)&fl2->nl_u.ip4_u.tos) | (*(u16 *)&fl1->fl4_tos ^ *(u16 *)&fl2->fl4_tos) |
(fl1->oif ^ fl2->oif) | (fl1->oif ^ fl2->oif) |
(fl1->iif ^ fl2->iif)) == 0; (fl1->iif ^ fl2->iif)) == 0;
} }
...@@ -2089,12 +2089,10 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr, ...@@ -2089,12 +2089,10 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
{ {
struct fib_result res; struct fib_result res;
struct in_device *in_dev = __in_dev_get_rcu(dev); struct in_device *in_dev = __in_dev_get_rcu(dev);
struct flowi fl = { .nl_u = { .ip4_u = struct flowi fl = { .fl4_dst = daddr,
{ .daddr = daddr, .fl4_src = saddr,
.saddr = saddr, .fl4_tos = tos,
.tos = tos, .fl4_scope = RT_SCOPE_UNIVERSE,
.scope = RT_SCOPE_UNIVERSE,
} },
.mark = skb->mark, .mark = skb->mark,
.iif = dev->ifindex }; .iif = dev->ifindex };
unsigned flags = 0; unsigned flags = 0;
...@@ -2480,14 +2478,11 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp, ...@@ -2480,14 +2478,11 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
const struct flowi *oldflp) const struct flowi *oldflp)
{ {
u32 tos = RT_FL_TOS(oldflp); u32 tos = RT_FL_TOS(oldflp);
struct flowi fl = { .nl_u = { .ip4_u = struct flowi fl = { .fl4_dst = oldflp->fl4_dst,
{ .daddr = oldflp->fl4_dst, .fl4_src = oldflp->fl4_src,
.saddr = oldflp->fl4_src, .fl4_tos = tos & IPTOS_RT_MASK,
.tos = tos & IPTOS_RT_MASK, .fl4_scope = ((tos & RTO_ONLINK) ?
.scope = ((tos & RTO_ONLINK) ? RT_SCOPE_LINK : RT_SCOPE_UNIVERSE),
RT_SCOPE_LINK :
RT_SCOPE_UNIVERSE),
} },
.mark = oldflp->mark, .mark = oldflp->mark,
.iif = net->loopback_dev->ifindex, .iif = net->loopback_dev->ifindex,
.oif = oldflp->oif }; .oif = oldflp->oif };
...@@ -2944,13 +2939,9 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void ...@@ -2944,13 +2939,9 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
err = -rt->dst.error; err = -rt->dst.error;
} else { } else {
struct flowi fl = { struct flowi fl = {
.nl_u = { .fl4_dst = dst,
.ip4_u = { .fl4_src = src,
.daddr = dst, .fl4_tos = rtm->rtm_tos,
.saddr = src,
.tos = rtm->rtm_tos,
},
},
.oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0, .oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0,
.mark = mark, .mark = mark,
}; };
......
...@@ -346,17 +346,14 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, ...@@ -346,17 +346,14 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
*/ */
{ {
struct flowi fl = { .mark = sk->sk_mark, struct flowi fl = { .mark = sk->sk_mark,
.nl_u = { .ip4_u = .fl4_dst = ((opt && opt->srr) ?
{ .daddr = ((opt && opt->srr) ? opt->faddr : ireq->rmt_addr),
opt->faddr : .fl4_src = ireq->loc_addr,
ireq->rmt_addr), .fl4_tos = RT_CONN_FLAGS(sk),
.saddr = ireq->loc_addr,
.tos = RT_CONN_FLAGS(sk) } },
.proto = IPPROTO_TCP, .proto = IPPROTO_TCP,
.flags = inet_sk_flowi_flags(sk), .flags = inet_sk_flowi_flags(sk),
.uli_u = { .ports = .fl_ip_sport = th->dest,
{ .sport = th->dest, .fl_ip_dport = th->source };
.dport = th->source } } };
security_req_classify_flow(req, &fl); security_req_classify_flow(req, &fl);
if (ip_route_output_key(sock_net(sk), &rt, &fl)) { if (ip_route_output_key(sock_net(sk), &rt, &fl)) {
reqsk_free(req); reqsk_free(req);
......
...@@ -890,15 +890,13 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -890,15 +890,13 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (rt == NULL) { if (rt == NULL) {
struct flowi fl = { .oif = ipc.oif, struct flowi fl = { .oif = ipc.oif,
.mark = sk->sk_mark, .mark = sk->sk_mark,
.nl_u = { .ip4_u = .fl4_dst = faddr,
{ .daddr = faddr, .fl4_src = saddr,
.saddr = saddr, .fl4_tos = tos,
.tos = tos } },
.proto = sk->sk_protocol, .proto = sk->sk_protocol,
.flags = inet_sk_flowi_flags(sk), .flags = inet_sk_flowi_flags(sk),
.uli_u = { .ports = .fl_ip_sport = inet->inet_sport,
{ .sport = inet->inet_sport, .fl_ip_dport = dport };
.dport = dport } } };
struct net *net = sock_net(sk); struct net *net = sock_net(sk);
security_sk_classify_flow(sk, &fl); security_sk_classify_flow(sk, &fl);
......
...@@ -23,12 +23,8 @@ static struct dst_entry *xfrm4_dst_lookup(struct net *net, int tos, ...@@ -23,12 +23,8 @@ static struct dst_entry *xfrm4_dst_lookup(struct net *net, int tos,
xfrm_address_t *daddr) xfrm_address_t *daddr)
{ {
struct flowi fl = { struct flowi fl = {
.nl_u = { .fl4_dst = daddr->a4,
.ip4_u = { .fl4_tos = tos,
.tos = tos,
.daddr = daddr->a4,
},
},
}; };
struct dst_entry *dst; struct dst_entry *dst;
struct rtable *rt; struct rtable *rt;
......
...@@ -1843,9 +1843,7 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt, ...@@ -1843,9 +1843,7 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt,
fl = (struct flowi) { fl = (struct flowi) {
.oif = vif->link, .oif = vif->link,
.nl_u = { .ip6_u = .fl6_dst = ipv6h->daddr,
{ .daddr = ipv6h->daddr, }
}
}; };
dst = ip6_route_output(net, NULL, &fl); dst = ip6_route_output(net, NULL, &fl);
......
...@@ -18,10 +18,8 @@ int ip6_route_me_harder(struct sk_buff *skb) ...@@ -18,10 +18,8 @@ int ip6_route_me_harder(struct sk_buff *skb)
struct flowi fl = { struct flowi fl = {
.oif = skb->sk ? skb->sk->sk_bound_dev_if : 0, .oif = skb->sk ? skb->sk->sk_bound_dev_if : 0,
.mark = skb->mark, .mark = skb->mark,
.nl_u = .fl6_dst = iph->daddr,
{ .ip6_u = .fl6_src = iph->saddr,
{ .daddr = iph->daddr,
.saddr = iph->saddr, } },
}; };
dst = ip6_route_output(net, skb->sk, &fl); dst = ip6_route_output(net, skb->sk, &fl);
......
...@@ -558,11 +558,7 @@ struct rt6_info *rt6_lookup(struct net *net, const struct in6_addr *daddr, ...@@ -558,11 +558,7 @@ struct rt6_info *rt6_lookup(struct net *net, const struct in6_addr *daddr,
{ {
struct flowi fl = { struct flowi fl = {
.oif = oif, .oif = oif,
.nl_u = { .fl6_dst = *daddr,
.ip6_u = {
.daddr = *daddr,
},
},
}; };
struct dst_entry *dst; struct dst_entry *dst;
int flags = strict ? RT6_LOOKUP_F_IFACE : 0; int flags = strict ? RT6_LOOKUP_F_IFACE : 0;
...@@ -778,13 +774,9 @@ void ip6_route_input(struct sk_buff *skb) ...@@ -778,13 +774,9 @@ void ip6_route_input(struct sk_buff *skb)
int flags = RT6_LOOKUP_F_HAS_SADDR; int flags = RT6_LOOKUP_F_HAS_SADDR;
struct flowi fl = { struct flowi fl = {
.iif = skb->dev->ifindex, .iif = skb->dev->ifindex,
.nl_u = { .fl6_dst = iph->daddr,
.ip6_u = { .fl6_src = iph->saddr,
.daddr = iph->daddr, .fl6_flowlabel = (* (__be32 *) iph)&IPV6_FLOWINFO_MASK,
.saddr = iph->saddr,
.flowlabel = (* (__be32 *) iph)&IPV6_FLOWINFO_MASK,
},
},
.mark = skb->mark, .mark = skb->mark,
.proto = iph->nexthdr, .proto = iph->nexthdr,
}; };
...@@ -1463,12 +1455,8 @@ static struct rt6_info *ip6_route_redirect(struct in6_addr *dest, ...@@ -1463,12 +1455,8 @@ static struct rt6_info *ip6_route_redirect(struct in6_addr *dest,
struct ip6rd_flowi rdfl = { struct ip6rd_flowi rdfl = {
.fl = { .fl = {
.oif = dev->ifindex, .oif = dev->ifindex,
.nl_u = { .fl6_dst = *dest,
.ip6_u = { .fl6_src = *src,
.daddr = *dest,
.saddr = *src,
},
},
}, },
}; };
......
...@@ -730,10 +730,9 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, ...@@ -730,10 +730,9 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
} }
{ {
struct flowi fl = { .nl_u = { .ip4_u = struct flowi fl = { .fl4_dst = dst,
{ .daddr = dst, .fl4_src = tiph->saddr,
.saddr = tiph->saddr, .fl4_tos = RT_TOS(tos),
.tos = RT_TOS(tos) } },
.oif = tunnel->parms.link, .oif = tunnel->parms.link,
.proto = IPPROTO_IPV6 }; .proto = IPPROTO_IPV6 };
if (ip_route_output_key(dev_net(dev), &rt, &fl)) { if (ip_route_output_key(dev_net(dev), &rt, &fl)) {
...@@ -855,10 +854,9 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev) ...@@ -855,10 +854,9 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev)
iph = &tunnel->parms.iph; iph = &tunnel->parms.iph;
if (iph->daddr) { if (iph->daddr) {
struct flowi fl = { .nl_u = { .ip4_u = struct flowi fl = { .fl4_dst = iph->daddr,
{ .daddr = iph->daddr, .fl4_src = iph->saddr,
.saddr = iph->saddr, .fl4_tos = RT_TOS(iph->tos),
.tos = RT_TOS(iph->tos) } },
.oif = tunnel->parms.link, .oif = tunnel->parms.link,
.proto = IPPROTO_IPV6 }; .proto = IPPROTO_IPV6 };
struct rtable *rt; struct rtable *rt;
......
...@@ -476,15 +476,13 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m ...@@ -476,15 +476,13 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
{ {
struct flowi fl = { .oif = sk->sk_bound_dev_if, struct flowi fl = { .oif = sk->sk_bound_dev_if,
.nl_u = { .ip4_u = { .fl4_dst = daddr,
.daddr = daddr, .fl4_src = inet->inet_saddr,
.saddr = inet->inet_saddr, .fl4_tos = RT_CONN_FLAGS(sk),
.tos = RT_CONN_FLAGS(sk) } },
.proto = sk->sk_protocol, .proto = sk->sk_protocol,
.flags = inet_sk_flowi_flags(sk), .flags = inet_sk_flowi_flags(sk),
.uli_u = { .ports = { .fl_ip_sport = inet->inet_sport,
.sport = inet->inet_sport, .fl_ip_dport = inet->inet_dport };
.dport = inet->inet_dport } } };
/* If this fails, retransmit mechanism of transport layer will /* If this fails, retransmit mechanism of transport layer will
* keep trying until route appears or the connection times * keep trying until route appears or the connection times
......
...@@ -110,10 +110,8 @@ static int __ip_vs_addr_is_local_v6(const struct in6_addr *addr) ...@@ -110,10 +110,8 @@ static int __ip_vs_addr_is_local_v6(const struct in6_addr *addr)
struct rt6_info *rt; struct rt6_info *rt;
struct flowi fl = { struct flowi fl = {
.oif = 0, .oif = 0,
.nl_u = { .fl6_dst = *addr,
.ip6_u = { .fl6_src = { .s6_addr32 = {0, 0, 0, 0} },
.daddr = *addr,
.saddr = { .s6_addr32 = {0, 0, 0, 0} }, } },
}; };
rt = (struct rt6_info *)ip6_route_output(&init_net, NULL, &fl); rt = (struct rt6_info *)ip6_route_output(&init_net, NULL, &fl);
......
...@@ -96,12 +96,8 @@ __ip_vs_get_out_rt(struct sk_buff *skb, struct ip_vs_dest *dest, ...@@ -96,12 +96,8 @@ __ip_vs_get_out_rt(struct sk_buff *skb, struct ip_vs_dest *dest,
if (!(rt = (struct rtable *) if (!(rt = (struct rtable *)
__ip_vs_dst_check(dest, rtos))) { __ip_vs_dst_check(dest, rtos))) {
struct flowi fl = { struct flowi fl = {
.oif = 0, .fl4_dst = dest->addr.ip,
.nl_u = { .fl4_tos = rtos,
.ip4_u = {
.daddr = dest->addr.ip,
.saddr = 0,
.tos = rtos, } },
}; };
if (ip_route_output_key(net, &rt, &fl)) { if (ip_route_output_key(net, &rt, &fl)) {
...@@ -118,12 +114,8 @@ __ip_vs_get_out_rt(struct sk_buff *skb, struct ip_vs_dest *dest, ...@@ -118,12 +114,8 @@ __ip_vs_get_out_rt(struct sk_buff *skb, struct ip_vs_dest *dest,
spin_unlock(&dest->dst_lock); spin_unlock(&dest->dst_lock);
} else { } else {
struct flowi fl = { struct flowi fl = {
.oif = 0, .fl4_dst = daddr,
.nl_u = { .fl4_tos = rtos,
.ip4_u = {
.daddr = daddr,
.saddr = 0,
.tos = rtos, } },
}; };
if (ip_route_output_key(net, &rt, &fl)) { if (ip_route_output_key(net, &rt, &fl)) {
...@@ -178,14 +170,9 @@ __ip_vs_reroute_locally(struct sk_buff *skb) ...@@ -178,14 +170,9 @@ __ip_vs_reroute_locally(struct sk_buff *skb)
refdst_drop(orefdst); refdst_drop(orefdst);
} else { } else {
struct flowi fl = { struct flowi fl = {
.oif = 0, .fl4_dst = iph->daddr,
.nl_u = { .fl4_src = iph->saddr,
.ip4_u = { .fl4_tos = RT_TOS(iph->tos),
.daddr = iph->daddr,
.saddr = iph->saddr,
.tos = RT_TOS(iph->tos),
}
},
.mark = skb->mark, .mark = skb->mark,
}; };
struct rtable *rt; struct rtable *rt;
...@@ -216,12 +203,7 @@ __ip_vs_route_output_v6(struct net *net, struct in6_addr *daddr, ...@@ -216,12 +203,7 @@ __ip_vs_route_output_v6(struct net *net, struct in6_addr *daddr,
{ {
struct dst_entry *dst; struct dst_entry *dst;
struct flowi fl = { struct flowi fl = {
.oif = 0, .fl6_dst = *daddr,
.nl_u = {
.ip6_u = {
.daddr = *daddr,
},
},
}; };
dst = ip6_route_output(net, NULL, &fl); dst = ip6_route_output(net, NULL, &fl);
......
...@@ -70,9 +70,9 @@ tee_tg_route4(struct sk_buff *skb, const struct xt_tee_tginfo *info) ...@@ -70,9 +70,9 @@ tee_tg_route4(struct sk_buff *skb, const struct xt_tee_tginfo *info)
return false; return false;
fl.oif = info->priv->oif; fl.oif = info->priv->oif;
} }
fl.nl_u.ip4_u.daddr = info->gw.ip; fl.fl4_dst = info->gw.ip;
fl.nl_u.ip4_u.tos = RT_TOS(iph->tos); fl.fl4_tos = RT_TOS(iph->tos);
fl.nl_u.ip4_u.scope = RT_SCOPE_UNIVERSE; fl.fl4_scope = RT_SCOPE_UNIVERSE;
if (ip_route_output_key(net, &rt, &fl) != 0) if (ip_route_output_key(net, &rt, &fl) != 0)
return false; return false;
...@@ -150,9 +150,9 @@ tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info) ...@@ -150,9 +150,9 @@ tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info)
return false; return false;
fl.oif = info->priv->oif; fl.oif = info->priv->oif;
} }
fl.nl_u.ip6_u.daddr = info->gw.in6; fl.fl6_dst = info->gw.in6;
fl.nl_u.ip6_u.flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) | fl.fl6_flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) |
(iph->flow_lbl[1] << 8) | iph->flow_lbl[2]; (iph->flow_lbl[1] << 8) | iph->flow_lbl[2];
dst = ip6_route_output(net, NULL, &fl); dst = ip6_route_output(net, NULL, &fl);
if (dst == NULL) if (dst == NULL)
return false; return false;
......
...@@ -47,12 +47,12 @@ static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer) ...@@ -47,12 +47,12 @@ static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer)
case AF_INET: case AF_INET:
fl.oif = 0; fl.oif = 0;
fl.proto = IPPROTO_UDP, fl.proto = IPPROTO_UDP,
fl.nl_u.ip4_u.saddr = 0; fl.fl4_dst = peer->srx.transport.sin.sin_addr.s_addr;
fl.nl_u.ip4_u.daddr = peer->srx.transport.sin.sin_addr.s_addr; fl.fl4_src = 0;
fl.nl_u.ip4_u.tos = 0; fl.fl4_tos = 0;
/* assume AFS.CM talking to AFS.FS */ /* assume AFS.CM talking to AFS.FS */
fl.uli_u.ports.sport = htons(7001); fl.fl_ip_sport = htons(7001);
fl.uli_u.ports.dport = htons(7000); fl.fl_ip_dport = htons(7000);
break; break;
default: default:
BUG(); BUG();
......
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