svn commit: r278831 - head/sys/netpfil/pf
Sergey Kandaurov
pluknet at freebsd.org
Mon Feb 16 22:25:14 UTC 2015
On 16 February 2015 at 06:38, Gleb Smirnoff <glebius at 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
More information about the svn-src-head
mailing list