[NETFILTER]: Save a level of indentation in icmp_reply_translation
Linux Kernel Mailing List <[email protected]>
| Newsgroups | gmane.linux.kernel.commits.2-4 |
|---|---|
| Message-ID | <[email protected]> |
ChangeSet 1.1533, 2004/12/21 17:21:57+01:00, [email protected] [NETFILTER]: Save a level of indentation in icmp_reply_translation Signed-off-by: Patrick McHardy <[email protected]> ip_nat_core.c | 51 +++++++++++++++++++++++---------------------------- 1 files changed, 23 insertions(+), 28 deletions(-) diff -Nru a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c --- a/net/ipv4/netfilter/ip_nat_core.c 2005-01-15 07:04:00 -08:00 +++ b/net/ipv4/netfilter/ip_nat_core.c 2005-01-15 07:04:00 -08:00 @@ -915,35 +915,30 @@ 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)); - manip_pkt(inner->protocol, inner, - skb->len - ((void *)inner - (void *)iph), - &info->manips[i].manip, - !info->manips[i].maniptype, - &skb->nfcache); - /* 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)); - manip_pkt(0, iph, skb->len, - &info->manips[i].manip, - info->manips[i].maniptype, - &skb->nfcache); - } + 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)); + manip_pkt(inner->protocol, inner, + skb->len - ((void *)inner - (void *)iph), + &info->manips[i].manip, !info->manips[i].maniptype, + &skb->nfcache); + /* 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)); + manip_pkt(0, iph, skb->len, &info->manips[i].manip, + info->manips[i].maniptype, &skb->nfcache); } READ_UNLOCK(&ip_nat_lock);