Created
April 12, 2020 01:52
-
-
Save nithu0115/f51c5388caab2372ab0d97f09a6a8da4 to your computer and use it in GitHub Desktop.
kernel patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index a79f5a89cab1..768db651373f 100644 | |
--- a/net/netfilter/nf_conntrack_core.c | |
+++ b/net/netfilter/nf_conntrack_core.c | |
@@ -750,6 +750,10 @@ static int nf_ct_resolve_clash(struct net *net, struct sk_buff *skb, | |
const struct nf_conntrack_l4proto *l4proto; | |
enum ip_conntrack_info oldinfo; | |
struct nf_conn *loser_ct = nf_ct_get(skb, &oldinfo); | |
+ | |
+ // Added by nithish | |
+ pr_debug("nf_ct_resolve_clash: %p clashes with %p\n", loser_ct, ct); | |
+ // | |
l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct)); | |
if (l4proto->allow_clash && | |
@@ -757,6 +761,11 @@ static int nf_ct_resolve_clash(struct net *net, struct sk_buff *skb, | |
atomic_inc_not_zero(&ct->ct_general.use)) { | |
if (((ct->status & IPS_NAT_DONE_MASK) == 0) || | |
nf_ct_match(ct, loser_ct)) { | |
+ | |
+ // Added by nithish | |
+ pr_debug("nf_ct_resolve_clash: %p resolved\n", loser_ct); | |
+ // | |
+ | |
nf_ct_acct_merge(ct, ctinfo, loser_ct); | |
nf_conntrack_put(&loser_ct->ct_general); | |
nf_ct_set(skb, ct, oldinfo); | |
@@ -825,6 +834,21 @@ __nf_conntrack_confirm(struct sk_buff *skb) | |
} | |
pr_debug("Confirming conntrack %p\n", ct); | |
+ | |
+ // Added by nithish | |
+ pr_debug("nf_confirm_conntrack: %p src=%pI4 (%hu) dst=%pI4 (%hu) = src=%pI4 (%hu) dst=%pI4 (%hu)\n", | |
+ ct, | |
+ &(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip), | |
+ ntohs(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u.udp.port), | |
+ &(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip), | |
+ ntohs(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u.udp.port), | |
+ &(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip), | |
+ ntohs(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u.udp.port), | |
+ &(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip), | |
+ ntohs(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u.udp.port) | |
+ ); | |
+ | |
+ // | |
/* We have to check the DYING flag after unlink to prevent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment