Commit 50cce6d2 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NETFILTER]: Save a level of indentation in icmp_reply_translation

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 9a8ce58a
...@@ -877,19 +877,18 @@ icmp_reply_translation(struct sk_buff **pskb, ...@@ -877,19 +877,18 @@ icmp_reply_translation(struct sk_buff **pskb,
if (info->manips[i].direction != dir) if (info->manips[i].direction != dir)
continue; continue;
/* Mapping the inner packet is just like a normal /* Mapping the inner packet is just like a normal packet, except
packet, except it was never src/dst reversed, so * it was never src/dst reversed, so where we would normally
where we would normally apply a dst manip, we apply * apply a dst manip, we apply a src, and vice versa. */
a src, and vice versa. */ if (info->manips[i].hooknum != hooknum)
if (info->manips[i].hooknum == hooknum) { continue;
DEBUGP("icmp_reply: inner %s -> %u.%u.%u.%u %u\n", DEBUGP("icmp_reply: inner %s -> %u.%u.%u.%u %u\n",
info->manips[i].maniptype == IP_NAT_MANIP_SRC info->manips[i].maniptype == IP_NAT_MANIP_SRC
? "DST" : "SRC", ? "DST" : "SRC", NIPQUAD(info->manips[i].manip.ip),
NIPQUAD(info->manips[i].manip.ip),
ntohs(info->manips[i].manip.u.udp.port)); ntohs(info->manips[i].manip.u.udp.port));
if (!manip_pkt(inside->ip.protocol, pskb, if (!manip_pkt(inside->ip.protocol, pskb,
(*pskb)->nh.iph->ihl*4 (*pskb)->nh.iph->ihl*4 + sizeof(inside->icmp),
+ sizeof(inside->icmp),
&info->manips[i].manip, &info->manips[i].manip,
!info->manips[i].maniptype)) !info->manips[i].maniptype))
goto unlock_fail; goto unlock_fail;
...@@ -901,14 +900,11 @@ icmp_reply_translation(struct sk_buff **pskb, ...@@ -901,14 +900,11 @@ icmp_reply_translation(struct sk_buff **pskb,
per-proto mapping */ per-proto mapping */
DEBUGP("icmp_reply: outer %s -> %u.%u.%u.%u\n", DEBUGP("icmp_reply: outer %s -> %u.%u.%u.%u\n",
info->manips[i].maniptype == IP_NAT_MANIP_SRC info->manips[i].maniptype == IP_NAT_MANIP_SRC
? "SRC" : "DST", ? "SRC" : "DST", NIPQUAD(info->manips[i].manip.ip));
NIPQUAD(info->manips[i].manip.ip)); if (!manip_pkt(0, pskb, 0, &info->manips[i].manip,
if (!manip_pkt(0, pskb, 0,
&info->manips[i].manip,
info->manips[i].maniptype)) info->manips[i].maniptype))
goto unlock_fail; goto unlock_fail;
} }
}
READ_UNLOCK(&ip_nat_lock); READ_UNLOCK(&ip_nat_lock);
hdrlen = (*pskb)->nh.iph->ihl * 4; hdrlen = (*pskb)->nh.iph->ihl * 4;
......
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