Skip to content

Commit

Permalink
Fix crash when more than 4k sockets are used. Closes andrsharaev#10
Browse files Browse the repository at this point in the history
  • Loading branch information
scamp committed Nov 2, 2024
1 parent a6407de commit 9150a62
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xt_NAT.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ static unsigned int nat_tg(struct sk_buff *skb, const struct xt_action_param *pa
session = create_nat_session(ip, tcp->source, tcp->dest, nat_addr);
if (session == NULL)
{
printk(KERN_NOTICE "xt_NAT SNAT: Cannot create new session. Dropping packet\n");
//printk(KERN_NOTICE "xt_NAT SNAT: Cannot create new session. Dropping packet\n");
return NF_DROP;
}

Expand Down Expand Up @@ -986,7 +986,7 @@ static unsigned int nat_tg(struct sk_buff *skb, const struct xt_action_param *pa
session = create_nat_session(ip, udp->source, udp->dest, nat_addr);
if (session == NULL)
{
printk(KERN_NOTICE "xt_NAT SNAT: Cannot create new session. Dropping packet\n");
//printk(KERN_NOTICE "xt_NAT SNAT: Cannot create new session. Dropping packet\n");
return NF_DROP;
}

Expand Down Expand Up @@ -1057,7 +1057,7 @@ static unsigned int nat_tg(struct sk_buff *skb, const struct xt_action_param *pa
session = create_nat_session(ip, nat_port, 0, nat_addr);
if (session == NULL)
{
printk(KERN_NOTICE "xt_NAT SNAT: Cannot create new session. Dropping packet\n");
//printk(KERN_NOTICE "xt_NAT SNAT: Cannot create new session. Dropping packet\n");
return NF_DROP;
}

Expand Down Expand Up @@ -1100,7 +1100,7 @@ static unsigned int nat_tg(struct sk_buff *skb, const struct xt_action_param *pa
session = create_nat_session(ip, 0, 0, nat_addr);
if (session == NULL)
{
printk(KERN_NOTICE "xt_NAT SNAT: Cannot create new session. Dropping packet\n");
//printk(KERN_NOTICE "xt_NAT SNAT: Cannot create new session. Dropping packet\n");
return NF_DROP;
}

Expand Down

0 comments on commit 9150a62

Please sign in to comment.