diff --git a/net/ipv4/netfilter/ip_conntrack_irc.c b/net/ipv4/netfilter/ip_conntrack_irc.c index 1301c02b9efa949a26a0f500c47aaf0541244c01..299950b8769e9a6f8f5c0dc099174ff8381aff2b 100644 --- a/net/ipv4/netfilter/ip_conntrack_irc.c +++ b/net/ipv4/netfilter/ip_conntrack_irc.c @@ -177,7 +177,10 @@ static int help(struct sk_buff *skb, DEBUGP("DCC bound ip/port: %u.%u.%u.%u:%u\n", HIPQUAD(dcc_ip), dcc_port); - if (ct->tuplehash[dir].tuple.src.ip != htonl(dcc_ip)) { + /* dcc_ip can be the internal OR external (NAT'ed) IP + * Tiago Sousa <mirage@kaotik.org> */ + if (ct->tuplehash[dir].tuple.src.ip != htonl(dcc_ip) + && ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip != htonl(dcc_ip)) { if (net_ratelimit()) printk(KERN_WARNING "Forged DCC command from " @@ -201,7 +204,7 @@ static int help(struct sk_buff *skb, exp->tuple = ((struct ip_conntrack_tuple) { { 0, { 0 } }, - { htonl(dcc_ip), { .tcp = { htons(dcc_port) } }, + { ct->tuplehash[dir].tuple.src.ip, { .tcp = { htons(dcc_port) } }, IPPROTO_TCP }}); exp->mask = ((struct ip_conntrack_tuple) { { 0, { 0 } },