From owner-freebsd-net@FreeBSD.ORG Mon Mar 29 17:56:04 2010 Return-Path: Delivered-To: net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 970E6106566C for ; Mon, 29 Mar 2010 17:56:04 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 55DC58FC15 for ; Mon, 29 Mar 2010 17:56:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o2THpBPY067304 for ; Mon, 29 Mar 2010 11:51:12 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 29 Mar 2010 11:51:16 -0600 (MDT) Message-Id: <20100329.115116.385399974524554540.imp@bsdimp.com> To: net@FreeBSD.org From: "M. Warner Losh" X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Small patch to ipfilter for arm X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 17:56:04 -0000 OK. I'd like to propose the following patch for ipfilter: Index: sys/contrib/ipfilter/netinet/ip_compat.h =================================================================== --- sys/contrib/ipfilter/netinet/ip_compat.h (revision 205838) +++ sys/contrib/ipfilter/netinet/ip_compat.h (working copy) @@ -975,7 +975,6 @@ # define SPL_NET(x) ; # define SPL_IMP(x) ; # define SPL_SCHED(x) ; -extern int in_cksum __P((struct mbuf *, int)); # else # define SPL_SCHED(x) x = splhigh() # endif /* __FreeBSD_version >= 500043 */ This declaration is wrong, and it prevents arm from building ipfilter. Why is it wrong? Because we have: # if (__FreeBSD_version >= 500002) # include # include # include # endif # if (__FreeBSD_version >= 500043) ... ... # endif So, we have in_cksum.h being included *AND* we're defining this function. However, in_cksum.h is supposed to do this. Why don't we see problems today? No architecture except arm has an assembler in_cksum in the tree. All the other architectures have #define in_cksum(a, b) in_cksum_skip(a, b, 0) in their headers. Since the above extern uses __P to hide the args, in_cksum doesn't expand the macro, so we don't see any problems or conflicts. On arm, where we define in_cksum() correctly to return u_short, there's a conflict. So, it would best if we just dropped this one line from ip_compat.h, since it was always wrong anyway. Comments? Warner