ia64/81284: Unaligned Reference with pf on 5.4/IA64

Andrew Thompson thompsa at freebsd.org
Tue Jun 28 21:00:37 GMT 2005


The following reply was made to PR ia64/81284; it has been noted by GNATS.

From: Andrew Thompson <thompsa at freebsd.org>
To: bug-followup at FreeBSD.org
Cc:  
Subject: Re: ia64/81284: Unaligned Reference with pf on 5.4/IA64
Date: Wed, 29 Jun 2005 08:50:18 +1200

 A complementary patch for bridge.c using the same macros and routines as
 if_bridge. As far as I can tell ipv6 isn't filtered.
 
 
 Index: bridge.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/net/bridge.c,v
 retrieving revision 1.92
 diff -u -r1.92 bridge.c
 --- bridge.c	10 Jun 2005 16:49:18 -0000	1.92
 +++ bridge.c	28 Jun 2005 20:44:10 -0000
 @@ -1026,6 +1026,19 @@
  	m_adj(m0, ETHER_HDR_LEN);		/* temporarily strip header */
  
  	/*
 +	 * Check that the IP header is aligned before passing up to the packet
 +	 * filter.
 +	 */
 +	if (ntohs(save_eh.ether_type) == ETHERTYPE_IP && 
 +	    IP_HDR_ALIGNED_P(mtod(m0, caddr_t)) == 0) {
 +		if ((m = m_copyup(m0, sizeof(struct ip),
 +			(max_linkhdr + 3) & ~3)) == NULL) {
 +			bdg_dropped++;
 +			return NULL;
 +		}
 +	}
 +
 +	/*
  	 * NetBSD-style generic packet filter, pfil(9), hooks.
  	 * Enables ipf(8) in bridging.
  	 */


More information about the freebsd-pf mailing list