feat(tcp,conntrack): drop DNAT/SNAT conntrack entries#44
Conversation
Kimchi Code Review
Summary📊 Review Score: 80/100 (overall code quality — 0 lowest, 100 highest) 🧪 Tests: yes — A dedicated ZDTM test 📝 Found 4 issue(s). See inline comments for details. What to expectKimchi will analyze the changes in this pull request and post:
The review typically completes within a few minutes. This comment will be updated once the review is ready. Interact with Kimchi
ConfigurationReviews are configured by your organization admin. Powered by Kimchi — AI-powered code review by CAST AI |
c9e3532 to
793813c
Compare
Remove redundant checks for tuple reply and original tuple.
Kimchi Summary
What changed
Skip netfilter conntrack entries that have source or destination NAT flags during checkpoint dump. These entries cannot be faithfully restored, so they are now excluded from the image instead of being saved and incorrectly recreated as non-NAT flows.
Why
The kernel strips
IPS_SRC_NATandIPS_DST_NATstatus flags when conntrack entries are restored. As a result, previously NATed connections would be resurrected as plain non-NAT entries, breaking those connections rather than preserving them.Key changes
criu/net.c: Addedis_nf_dsnat()helper to parse NFNETLINK conntrack messages and detectIPS_SRC_NATorIPS_DST_NATstatus flags.criu/net.c: Modifieddump_one_nf()to callis_nf_dsnat()and skip matching entries, emitting a warning viapr_warn()instead of writing them to the checkpoint image.<arpa/inet.h>and<linux/netfilter/nf_conntrack_common.h>includes forntohl()and NAT flag definitions.Impact