diff options
author | David S. Miller <davem@davemloft.net> | 2010-11-11 20:07:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-11 20:07:48 -0500 |
commit | c753796769e4fb0cd813b6e5801b3c01f4681d4f (patch) | |
tree | f137ec0b76593a2aa1a6a263bcc1e4cf82bdf7b5 /net/netfilter | |
parent | ed1deb7021b4dfee1d544b91edff4ef92f5c3b54 (diff) |
ipv4: Make rt->fl.iif tests lest obscure.
When we test rt->fl.iif against zero, we're seeing if it's
an output or an input route.
Make that explicit with some helper functions.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_xmit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c index de04ea39cde..10bd39c0ae2 100644 --- a/net/netfilter/ipvs/ip_vs_xmit.c +++ b/net/netfilter/ipvs/ip_vs_xmit.c | |||
@@ -169,7 +169,7 @@ __ip_vs_reroute_locally(struct sk_buff *skb) | |||
169 | struct net *net = dev_net(dev); | 169 | struct net *net = dev_net(dev); |
170 | struct iphdr *iph = ip_hdr(skb); | 170 | struct iphdr *iph = ip_hdr(skb); |
171 | 171 | ||
172 | if (rt->fl.iif) { | 172 | if (rt_is_input_route(rt)) { |
173 | unsigned long orefdst = skb->_skb_refdst; | 173 | unsigned long orefdst = skb->_skb_refdst; |
174 | 174 | ||
175 | if (ip_route_input(skb, iph->daddr, iph->saddr, | 175 | if (ip_route_input(skb, iph->daddr, iph->saddr, |
@@ -552,7 +552,8 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
552 | #endif | 552 | #endif |
553 | 553 | ||
554 | /* From world but DNAT to loopback address? */ | 554 | /* From world but DNAT to loopback address? */ |
555 | if (local && ipv4_is_loopback(rt->rt_dst) && skb_rtable(skb)->fl.iif) { | 555 | if (local && ipv4_is_loopback(rt->rt_dst) && |
556 | rt_is_input_route(skb_rtable(skb))) { | ||
556 | IP_VS_DBG_RL_PKT(1, AF_INET, pp, skb, 0, "ip_vs_nat_xmit(): " | 557 | IP_VS_DBG_RL_PKT(1, AF_INET, pp, skb, 0, "ip_vs_nat_xmit(): " |
557 | "stopping DNAT to loopback address"); | 558 | "stopping DNAT to loopback address"); |
558 | goto tx_error_put; | 559 | goto tx_error_put; |
@@ -1165,7 +1166,8 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
1165 | #endif | 1166 | #endif |
1166 | 1167 | ||
1167 | /* From world but DNAT to loopback address? */ | 1168 | /* From world but DNAT to loopback address? */ |
1168 | if (local && ipv4_is_loopback(rt->rt_dst) && skb_rtable(skb)->fl.iif) { | 1169 | if (local && ipv4_is_loopback(rt->rt_dst) && |
1170 | rt_is_input_route(skb_rtable(skb))) { | ||
1169 | IP_VS_DBG(1, "%s(): " | 1171 | IP_VS_DBG(1, "%s(): " |
1170 | "stopping DNAT to loopback %pI4\n", | 1172 | "stopping DNAT to loopback %pI4\n", |
1171 | __func__, &cp->daddr.ip); | 1173 | __func__, &cp->daddr.ip); |