From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 23:14:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA23E88A; Thu, 19 Feb 2015 23:14:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A50282AD; Thu, 19 Feb 2015 23:14:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JNEaHj060507; Thu, 19 Feb 2015 23:14:36 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1JNEaxn060505; Thu, 19 Feb 2015 23:14:36 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502192314.t1JNEaxn060505@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Feb 2015 23:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279029 - head/contrib/ipfilter X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2015 23:14:36 -0000 Author: glebius Date: Thu Feb 19 23:14:35 2015 New Revision: 279029 URL: https://svnweb.freebsd.org/changeset/base/279029 Log: The ipftest(1) is a program that emulates ipf(4) operation and tests packets against rules. It definitely doesn't need to know about kernel internals, such as 'struct ifaddr'. What it does with ifaddr, is that it only takes ifa_addr member of it, and treats it as sockaddr, while it is only a pointer to sockaddr. Fortunately, sizeof(struct ifaddr) > sizeof(struct sockaddr_in6), so no problems arise. Fix that declaring a private struct ifaddr in ipftest(1) and stop including if_var.h. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/contrib/ipfilter/ip_fil.c head/contrib/ipfilter/ipf.h Modified: head/contrib/ipfilter/ip_fil.c ============================================================================== --- head/contrib/ipfilter/ip_fil.c Thu Feb 19 22:42:33 2015 (r279028) +++ head/contrib/ipfilter/ip_fil.c Thu Feb 19 23:14:35 2015 (r279029) @@ -44,6 +44,9 @@ static int write_output __P((struct ifne # endif #endif +struct ifaddr { + struct sockaddr_storage ifa_addr; +}; int ipfattach(softc) Modified: head/contrib/ipfilter/ipf.h ============================================================================== --- head/contrib/ipfilter/ipf.h Thu Feb 19 22:42:33 2015 (r279028) +++ head/contrib/ipfilter/ipf.h Thu Feb 19 23:14:35 2015 (r279029) @@ -43,9 +43,6 @@ struct file; #include #include -#define _WANT_IFADDR -#include - #include #include #include