Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 2015 02:25:12 +0400
From:      Sergey Kandaurov <pluknet@freebsd.org>
To:        Gleb Smirnoff <glebius@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r278831 - head/sys/netpfil/pf
Message-ID:  <CAE-mSOKD3anc0a8YfRvsGhYhfDHPCJF6bBOjL9-kOVRoLS7JPw@mail.gmail.com>
In-Reply-To: <201502160338.t1G3cRlX042385@svn.freebsd.org>
References:  <201502160338.t1G3cRlX042385@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 16 February 2015 at 06:38, Gleb Smirnoff <glebius@freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE-mSOKD3anc0a8YfRvsGhYhfDHPCJF6bBOjL9-kOVRoLS7JPw>