From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 22:25:14 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 73EEEBEA; Mon, 16 Feb 2015 22:25:14 +0000 (UTC) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06C81B9E; Mon, 16 Feb 2015 22:25:14 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id k14so22065337wgh.3; Mon, 16 Feb 2015 14:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kQqQK++gMi4LDCt5+wGUzY1n25auk6PQEfKUJ5FeM3A=; b=BnMUrFow9NLoYrerL9tOEprURtTCtLRiNnxt4CFwMtZGKs7nAj2cexs+s6VrP4Iovv +4WrV6XMCb0Bqty8wZDIAFWtgcZVyPVY44vvuD8gRCqAR4i0ioh8bwWvLLSMz07RI5HH +VH44ZPi7RTeFrvhHJtLA3ZI56073d7Pnx0CBgn+p3b3VqGLPSyqPFKQsZKHawwA7yXi fz7CD7bz5JtGKdSnBIJCSbmf0EeMkPtdGl/OceN396Mf7omPEJ3nVrOP+WkIh55ugfYh peU150D4QHdr/fVtbY2epEOS9GaM9eOPVesetv7EC3jpBLpATXbM3L2DqeqLryOSqw24 IO0w== MIME-Version: 1.0 X-Received: by 10.194.205.228 with SMTP id lj4mr54183277wjc.77.1424125512522; Mon, 16 Feb 2015 14:25:12 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.27.84.206 with HTTP; Mon, 16 Feb 2015 14:25:12 -0800 (PST) In-Reply-To: <201502160338.t1G3cRlX042385@svn.freebsd.org> References: <201502160338.t1G3cRlX042385@svn.freebsd.org> Date: Tue, 17 Feb 2015 02:25:12 +0400 X-Google-Sender-Auth: Y3ENrEtdQxiG_-jkrmqKxfiWPq0 Message-ID: Subject: Re: svn commit: r278831 - head/sys/netpfil/pf From: Sergey Kandaurov To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org 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: Mon, 16 Feb 2015 22:25:14 -0000 On 16 February 2015 at 06:38, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Feb 16 03:38:27 2015 > New Revision: 278831 > URL: https://svnweb.freebsd.org/changeset/base/278831 > > Log: > Update the pf fragment handling code to closer match recent OpenBSD. > That partially fixes IPv6 fragment handling. Thanks to Kristof for > working on that. > [...] > @@ -125,15 +140,25 @@ static void pf_remove_fragment(struct > static int pf_normalize_tcpopt(struct pf_rule *, struct mbuf *, > struct tcphdr *, int, sa_family_t); > #ifdef INET > -static void pf_ip2key(struct pf_fragment *, struct ip *); It's still called under #ifdef INET only. [...] > @@ -145,6 +170,18 @@ static void pf_scrub_ip6(struct mbuf * > } \ > } while(0) > > +static void > +pf_ip2key(struct ip *ip, int dir, struct pf_fragment_cmp *key) > +{ > + > + key->frc_src.v4 = ip->ip_src; > + key->frc_dst.v4 = ip->ip_dst; > + key->frc_af = AF_INET; > + key->frc_proto = ip->ip_p; > + key->frc_id = ip->ip_id; > + key->frc_direction = dir; > +} > + > void > pf_normalize_init(void) > { [...] > @@ -296,26 +331,14 @@ pf_free_fragment(struct pf_fragment *fra > } > > #ifdef INET > -static void > -pf_ip2key(struct pf_fragment *key, struct ip *ip) > -{ > - key->fr_p = ip->ip_p; > - key->fr_id = ip->ip_id; > - key->fr_src.s_addr = ip->ip_src.s_addr; > - key->fr_dst.s_addr = ip->ip_dst.s_addr; > -} > - You seem to move pf_ip2key out of INET scope intentionally (why?). But this breaks gcc w/INET6 only kernel. netpfil/pf/pf_norm.c:176: warning: 'pf_ip2key' defined but not used -- wbr, pluknet