64-bit firewall fix for pre-patch-2.0.31-4

Rob van Nieuwkerk (robn@verdi.et.tudelft.nl)
Tue, 12 Aug 1997 00:14:52 +0200 (MET DST)


Hi Linus,

I just saw that pre-patch-2.0.31-4 does not fix a 64-bit firewall problem
yet. Below is a patch against 2.0.30 that we use on our Alpha to get the
firewall code working.

Greetings,
Rob van Nieuwkerk

---------------------------------------------------------------------------
diff -uNr linux-2.0.30.orig/net/ipv4/ip_fw.c linux/net/ipv4/ip_fw.c
--- linux-2.0.30.orig/net/ipv4/ip_fw.c Tue Apr 8 17:47:47 1997
+++ linux/net/ipv4/ip_fw.c Fri Jul 18 12:15:24 1997
@@ -206,9 +206,9 @@
int ip_fw_chk(struct iphdr *ip, struct device *rif, __u16 *redirport, struct ip_fw *chain, int policy, int mode)
{
struct ip_fw *f;
- struct tcphdr *tcp=(struct tcphdr *)((unsigned long *)ip+ip->ihl);
- struct udphdr *udp=(struct udphdr *)((unsigned long *)ip+ip->ihl);
- struct icmphdr *icmp=(struct icmphdr *)((unsigned long *)ip+ip->ihl);
+ struct tcphdr *tcp=(struct tcphdr *)((__u32 *)ip+ip->ihl);
+ struct udphdr *udp=(struct udphdr *)((__u32 *)ip+ip->ihl);
+ struct icmphdr *icmp=(struct icmphdr *)((__u32 *)ip+ip->ihl);
__u32 src, dst;
__u16 src_port=0xFFFF, dst_port=0xFFFF, icmp_type=0xFF;
unsigned short f_prt=0, prt;