Comment 16 for bug 1681847

Revision history for this message
Nick Moriarty (nick-moriarty) wrote :

I've attempted to patch this out by adding checks where snat_handler and dnat_handler are called (ip_vs_core.c and ip_vs_xmit.c), with no success. I have to surmise that either:
- My patches aren't being built correctly
- My checks don't work
- This isn't the code that's mangling the packets
- The connection table entries are being marked as MASQ connections even though they're DROUTE

The extra checks take the form (referring to the instance in the previous comment):
if (pp->snat_handler && (IP_VS_FWD_METHOD(cp) == IP_VS_CONN_F_MASQ) &&
    !pp->snat_handler(skb, pp, cp, iph))
 goto drop;

Similar guards were put on the dnat_handler calls. This should cause the NAT handler to be ignored unless the connection information (cp) is for a MASQ connection.

I should also note, in case it is useful, that in include/uapi/linux/ip_vs.h MASQ connections are marked with a value of 0 in the relevant bits of cp->flags.