[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipfilter
Subject:    Solved: NAT panics with ICMP.
From:       Darren Reed <avalon () coombs ! anu ! edu ! au>
Date:       1996-08-17 8:17:56
[Download RAW message or body]


The following patch will stop ICMP packets going through the NAT from
causing kernel panics (crashes).

-Darren

Index: ip_nat.c
===================================================================
RCS file: /devel/CVS/IP-Filter/ip_nat.c,v
retrieving revision 1.2
diff -c -r1.2 ip_nat.c
*** 1.2	1996/07/04 13:17:33
--- ip_nat.c	1996/08/17 08:15:31
***************
*** 452,460 ****
  tcphdr_t *tcp;
  {
  	struct in_addr ipaddr;
! 	u_short port = tcp->th_dport;
  	nat_t *nat;
  
  	ipaddr.s_addr = ip->ip_dst.s_addr;
  	nat = nat_table[1][ipaddr.s_addr % NAT_SIZE];
  
--- 454,464 ----
  tcphdr_t *tcp;
  {
  	struct in_addr ipaddr;
! 	u_short port = 0;
  	nat_t *nat;
  
+ 	if (np->in_flags & (IPN_TCP|IPN_UDP))
+ 		 port = tcp->th_dport;
  	ipaddr.s_addr = ip->ip_dst.s_addr;
  	nat = nat_table[1][ipaddr.s_addr % NAT_SIZE];


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic