*************** *** 145,150 **** #define TF_STATE_MASK 0xffff0000 struct ip_tproxy_sockref; struct ip_tproxy_hash --- 145,151 ---- #define TF_STATE_MASK 0xffff0000 + #if 0 struct ip_tproxy_sockref; struct ip_tproxy_hash *************** *** 645,650 **** hooknum, sr->laddr, sr->lport, newip, newport); } else { /* we store a reference to the sockref in the conntrack */ if (!test_and_set_bit(IPS_TPROXY_BIT, &ct->status)) { if (flags & TN_STOREREF) { --- 647,657 ---- hooknum, sr->laddr, sr->lport, newip, newport); } else { + if (test_bit(IPS_SRC_NAT_DONE_BIT, &ct->status)) + { + test_and_clear_bit(IPS_SRC_NAT_DONE_BIT, &ct->status); + } + /* we store a reference to the sockref in the conntrack */ if (!test_and_set_bit(IPS_TPROXY_BIT, &ct->status)) { if (flags & TN_STOREREF) { *************** *** 905,913 **** /* there was no matching sockref, so we consult the * TPROXY table */ - ui.changed = 0; verdict = ipt_do_table(pskb, hooknum, in, out, &tproxy_table, &ui); if (ui.changed && verdict == NF_ACCEPT) { struct ip_tproxy_sockref sr; u32 laddr; --- 916,924 ---- /* there was no matching sockref, so we consult the * TPROXY table */ ui.changed = 0; verdict = ipt_do_table(pskb, hooknum, in, out, &tproxy_table, &ui); + if (ui.changed && verdict == NF_ACCEPT) { struct ip_tproxy_sockref sr; u32 laddr;