Date: Thu, 26 Sep 2019 03:09:45 +0000 (UTC) From: Cy Schubert <cy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352738 - head/contrib/ipfilter/tools Message-ID: <201909260309.x8Q39jLQ012545@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cy Date: Thu Sep 26 03:09:45 2019 New Revision: 352738 URL: https://svnweb.freebsd.org/changeset/base/352738 Log: Teach the ippool parser about address families. This is a precursor to implementing IPv6 support within ippool which requires reworking radix_ipf.c. MFC after: 1 month Modified: head/contrib/ipfilter/tools/ippool_y.y Modified: head/contrib/ipfilter/tools/ippool_y.y ============================================================================== --- head/contrib/ipfilter/tools/ippool_y.y Thu Sep 26 03:09:42 2019 (r352737) +++ head/contrib/ipfilter/tools/ippool_y.y Thu Sep 26 03:09:45 2019 (r352738) @@ -309,11 +309,27 @@ range: addrmask { $$ = calloc(1, sizeof(*$$)); $$->ipn_info = 0; $$->ipn_addr = $1[0]; $$->ipn_mask = $1[1]; +#ifdef USE_INET6 + if (use_inet6) + $$->ipn_addr.adf_family = + AF_INET6; + else +#endif + $$->ipn_addr.adf_family = + AF_INET; } | '!' addrmask { $$ = calloc(1, sizeof(*$$)); $$->ipn_info = 1; $$->ipn_addr = $2[0]; $$->ipn_mask = $2[1]; +#ifdef USE_INET6 + if (use_inet6) + $$->ipn_addr.adf_family = + AF_INET6; + else +#endif + $$->ipn_addr.adf_family = + AF_INET; } | YY_STR { $$ = add_poolhosts($1); free($1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909260309.x8Q39jLQ012545>