6.8 has been released. Time to remove the old syntax. OK?
martijn@ ? dispatcher_tm_udp.c Index: parse.y =================================================================== RCS file: /cvs/src/usr.sbin/snmpd/parse.y,v retrieving revision 1.61 diff -u -p -r1.61 parse.y --- parse.y 10 Sep 2020 17:54:47 -0000 1.61 +++ parse.y 29 Oct 2020 15:14:24 -0000 @@ -130,7 +130,7 @@ typedef struct { %token <v.number> NUMBER %type <v.string> hostcmn %type <v.string> srcaddr port -%type <v.number> optwrite yesno seclevel proto +%type <v.number> optwrite yesno seclevel %type <v.data> objtype cmd %type <v.oid> oid hostoid trapoid %type <v.auth> auth @@ -279,7 +279,7 @@ main : LISTEN ON listenproto listenproto : UDP listen_udp | TCP listen_tcp - | listen_empty + | listen_udp listen_udp : STRING port { struct sockaddr_storage ss[16]; @@ -335,34 +335,6 @@ listen_tcp : STRING port { } } -/* Remove after deprecation period and replace with listen_udp */ -listen_empty : STRING port proto { - struct sockaddr_storage ss[16]; - int nhosts, i; - - nhosts = host($1, $2, $3, ss, nitems(ss)); - if (nhosts < 1) { - yyerror("invalid address: %s", $1); - free($1); - if ($2 != snmpd_port) - free($2); - YYERROR; - } - if (nhosts > (int)nitems(ss)) - log_warn("%s:%s resolves to more than %zu hosts", - $1, $2, nitems(ss)); - - free($1); - if ($2 != snmpd_port) - free($2); - for (i = 0; i < nhosts; i++) { - if (listen_add(&(ss[i]), $3) == -1) { - yyerror("calloc"); - YYERROR; - } - } - } - port : /* empty */ { $$ = snmpd_port; } @@ -385,21 +357,6 @@ port : /* empty */ { YYERROR; } $$ = number; - } - ; - -proto : /* empty */ { - $$ = SOCK_DGRAM; - } - | UDP { - log_warnx("udp as last keyword on listen on line is " - "deprecated"); - $$ = SOCK_DGRAM; - } - | TCP { - log_warnx("tcp as last keyword on listen on line is " - "deprecated"); - $$ = SOCK_STREAM; } ;