aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@coreworks.de>2004-11-27 15:15:30 +0100
committerDavid S. Miller <davem@kernel.bkbits.net>2004-11-27 15:15:30 +0100
commit50cce6d2ae87f215f94b21760d0cba78e451419e (patch)
tree9c6df540910ce44f028fbdc0155d7fb004fc57a0
parent9a8ce58ac0161da625aeae2ef3ca91c681ca526e (diff)
downloadhistory-50cce6d2ae87f215f94b21760d0cba78e451419e.tar.gz
[NETFILTER]: Save a level of indentation in icmp_reply_translation
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r--net/ipv4/netfilter/ip_nat_core.c56
1 files changed, 26 insertions, 30 deletions
diff --git a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c
index 4b00d4886e6f2..d43b3242152b3 100644
--- a/net/ipv4/netfilter/ip_nat_core.c
+++ b/net/ipv4/netfilter/ip_nat_core.c
@@ -877,37 +877,33 @@ icmp_reply_translation(struct sk_buff **pskb,
if (info->manips[i].direction != dir)
continue;
- /* Mapping the inner packet is just like a normal
- packet, except it was never src/dst reversed, so
- where we would normally apply a dst manip, we apply
- a src, and vice versa. */
- if (info->manips[i].hooknum == hooknum) {
- DEBUGP("icmp_reply: inner %s -> %u.%u.%u.%u %u\n",
- info->manips[i].maniptype == IP_NAT_MANIP_SRC
- ? "DST" : "SRC",
- NIPQUAD(info->manips[i].manip.ip),
- ntohs(info->manips[i].manip.u.udp.port));
- if (!manip_pkt(inside->ip.protocol, pskb,
- (*pskb)->nh.iph->ihl*4
- + sizeof(inside->icmp),
- &info->manips[i].manip,
- !info->manips[i].maniptype))
- goto unlock_fail;
-
- /* Outer packet needs to have IP header NATed like
- it's a reply. */
+ /* Mapping the inner packet is just like a normal packet, except
+ * it was never src/dst reversed, so where we would normally
+ * apply a dst manip, we apply a src, and vice versa. */
+ if (info->manips[i].hooknum != hooknum)
+ continue;
- /* Use mapping to map outer packet: 0 give no
- per-proto mapping */
- DEBUGP("icmp_reply: outer %s -> %u.%u.%u.%u\n",
- info->manips[i].maniptype == IP_NAT_MANIP_SRC
- ? "SRC" : "DST",
- NIPQUAD(info->manips[i].manip.ip));
- if (!manip_pkt(0, pskb, 0,
- &info->manips[i].manip,
- info->manips[i].maniptype))
- goto unlock_fail;
- }
+ DEBUGP("icmp_reply: inner %s -> %u.%u.%u.%u %u\n",
+ info->manips[i].maniptype == IP_NAT_MANIP_SRC
+ ? "DST" : "SRC", NIPQUAD(info->manips[i].manip.ip),
+ ntohs(info->manips[i].manip.u.udp.port));
+ if (!manip_pkt(inside->ip.protocol, pskb,
+ (*pskb)->nh.iph->ihl*4 + sizeof(inside->icmp),
+ &info->manips[i].manip,
+ !info->manips[i].maniptype))
+ goto unlock_fail;
+
+ /* Outer packet needs to have IP header NATed like
+ it's a reply. */
+
+ /* Use mapping to map outer packet: 0 give no
+ per-proto mapping */
+ DEBUGP("icmp_reply: outer %s -> %u.%u.%u.%u\n",
+ info->manips[i].maniptype == IP_NAT_MANIP_SRC
+ ? "SRC" : "DST", NIPQUAD(info->manips[i].manip.ip));
+ if (!manip_pkt(0, pskb, 0, &info->manips[i].manip,
+ info->manips[i].maniptype))
+ goto unlock_fail;
}
READ_UNLOCK(&ip_nat_lock);