ipv4: Use flowi4 in public route lookup interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2011-03-12 01:12:47 -05:00
parent 68a5e3dd0a
commit 9d6ec93801
14 changed files with 231 additions and 224 deletions

View File

@@ -165,14 +165,14 @@ __ip_vs_reroute_locally(struct sk_buff *skb)
return 0;
refdst_drop(orefdst);
} else {
struct flowi fl = {
.fl4_dst = iph->daddr,
.fl4_src = iph->saddr,
.fl4_tos = RT_TOS(iph->tos),
.flowi_mark = skb->mark,
struct flowi4 fl4 = {
.daddr = iph->daddr,
.saddr = iph->saddr,
.flowi4_tos = RT_TOS(iph->tos),
.flowi4_mark = skb->mark,
};
rt = ip_route_output_key(net, &fl);
rt = ip_route_output_key(net, &fl4);
if (IS_ERR(rt))
return 0;
if (!(rt->rt_flags & RTCF_LOCAL)) {

View File

@@ -62,18 +62,18 @@ tee_tg_route4(struct sk_buff *skb, const struct xt_tee_tginfo *info)
const struct iphdr *iph = ip_hdr(skb);
struct net *net = pick_net(skb);
struct rtable *rt;
struct flowi fl;
struct flowi4 fl4;
memset(&fl, 0, sizeof(fl));
memset(&fl4, 0, sizeof(fl4));
if (info->priv) {
if (info->priv->oif == -1)
return false;
fl.flowi_oif = info->priv->oif;
fl4.flowi4_oif = info->priv->oif;
}
fl.fl4_dst = info->gw.ip;
fl.fl4_tos = RT_TOS(iph->tos);
fl.fl4_scope = RT_SCOPE_UNIVERSE;
rt = ip_route_output_key(net, &fl);
fl4.daddr = info->gw.ip;
fl4.flowi4_tos = RT_TOS(iph->tos);
fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
rt = ip_route_output_key(net, &fl4);
if (IS_ERR(rt))
return false;