Re: snmpd: remove filter-pf-addresses support

2023-10-19 Thread Theo Buehler
On Thu, Oct 19, 2023 at 04:13:41PM +0200, Martijn van Duren wrote:
> OpenBSD 7.4 is here. upgrade72.html already mentions it's deprecation.
> 
> OK?

ok

> 
> martijn@
> 
> Index: parse.y
> ===
> RCS file: /cvs/src/usr.sbin/snmpd/parse.y,v
> retrieving revision 1.78
> diff -u -p -r1.78 parse.y
> --- parse.y   6 Oct 2022 14:41:08 -   1.78
> +++ parse.y   19 Oct 2023 14:12:55 -
> @@ -140,7 +140,7 @@ typedef struct {
>  %token   SYSTEM CONTACT DESCR LOCATION NAME OBJECTID SERVICES RTFILTER
>  %token   READONLY READWRITE OCTETSTRING INTEGER COMMUNITY TRAP RECEIVER
>  %token   SECLEVEL NONE AUTH ENC USER AUTHKEY ENCKEY ERROR
> -%token   HANDLE DEFAULT SRCADDR TCP UDP PFADDRFILTER BLOCKLIST PORT
> +%token   HANDLE DEFAULT SRCADDR TCP UDP BLOCKLIST PORT
>  %token STRING
>  %token NUMBER
>  %type  usmuser community optcommunity
> @@ -336,26 +336,6 @@ main : LISTEN ON listen_udptcp
>   else
>   conf->sc_rtfilter = 0;
>   }
> - /* XXX Remove after 7.4 */
> - | PFADDRFILTER yesno{
> - struct ber_oid *blocklist;
> -
> - log_warnx("filter-pf-addresses is deprecated. "
> - "Please use blocklist pfTblAddrTable instead.");
> - if ($2) {
> - blocklist = recallocarray(conf->sc_blocklist,
> - conf->sc_nblocklist,
> - conf->sc_nblocklist + 1,
> - sizeof(*blocklist));
> - if (blocklist == NULL) {
> - yyerror("malloc");
> - YYERROR;
> - }
> - conf->sc_blocklist = blocklist;
> - smi_string2oid("pfTblAddrTable",
> - &(blocklist[conf->sc_nblocklist++]));
> - }
> - }
>   | seclevel {
>   conf->sc_min_seclevel = $1;
>   }
> @@ -1195,7 +1175,6 @@ lookup(char *s)
>   { "enc",ENC },
>   { "enckey", ENCKEY },
>   { "engineid",   ENGINEID },
> - { "filter-pf-addresses",PFADDRFILTER },
>   { "filter-routes",  RTFILTER },
>   { "group",  GROUP },
>   { "handle", HANDLE },
> 



snmpd: remove filter-pf-addresses support

2023-10-19 Thread Martijn van Duren
OpenBSD 7.4 is here. upgrade72.html already mentions it's deprecation.

OK?

martijn@

Index: parse.y
===
RCS file: /cvs/src/usr.sbin/snmpd/parse.y,v
retrieving revision 1.78
diff -u -p -r1.78 parse.y
--- parse.y 6 Oct 2022 14:41:08 -   1.78
+++ parse.y 19 Oct 2023 14:12:55 -
@@ -140,7 +140,7 @@ typedef struct {
 %token SYSTEM CONTACT DESCR LOCATION NAME OBJECTID SERVICES RTFILTER
 %token READONLY READWRITE OCTETSTRING INTEGER COMMUNITY TRAP RECEIVER
 %token SECLEVEL NONE AUTH ENC USER AUTHKEY ENCKEY ERROR
-%token HANDLE DEFAULT SRCADDR TCP UDP PFADDRFILTER BLOCKLIST PORT
+%token HANDLE DEFAULT SRCADDR TCP UDP BLOCKLIST PORT
 %token   STRING
 %token   NUMBER
 %typeusmuser community optcommunity
@@ -336,26 +336,6 @@ main   : LISTEN ON listen_udptcp
else
conf->sc_rtfilter = 0;
}
-   /* XXX Remove after 7.4 */
-   | PFADDRFILTER yesno{
-   struct ber_oid *blocklist;
-
-   log_warnx("filter-pf-addresses is deprecated. "
-   "Please use blocklist pfTblAddrTable instead.");
-   if ($2) {
-   blocklist = recallocarray(conf->sc_blocklist,
-   conf->sc_nblocklist,
-   conf->sc_nblocklist + 1,
-   sizeof(*blocklist));
-   if (blocklist == NULL) {
-   yyerror("malloc");
-   YYERROR;
-   }
-   conf->sc_blocklist = blocklist;
-   smi_string2oid("pfTblAddrTable",
-   &(blocklist[conf->sc_nblocklist++]));
-   }
-   }
| seclevel {
conf->sc_min_seclevel = $1;
}
@@ -1195,7 +1175,6 @@ lookup(char *s)
{ "enc",ENC },
{ "enckey", ENCKEY },
{ "engineid",   ENGINEID },
-   { "filter-pf-addresses",PFADDRFILTER },
{ "filter-routes",  RTFILTER },
{ "group",  GROUP },
{ "handle", HANDLE },