# HG changeset patch # User Roy Marples # Date 1604336611 0 # Node ID e6620d8e18bb39ba6dc879fedba48e867f70e6b7 # Parent 68571e2fc30d2ce1dd47d415879f84fd17bdfdee options: Don't log unknown option errors when printing the pidfile diff -r 68571e2fc30d -r e6620d8e18bb src/if-options.c --- a/src/if-options.c Sun Nov 01 14:07:38 2020 +0000 +++ b/src/if-options.c Mon Nov 02 17:03:31 2020 +0000 @@ -782,6 +782,8 @@ break; case 'o': ARG_REQUIRED; + if (ctx->options & DHCPCD_PRINT_PIDFILE) + break; set_option_space(ctx, arg, &d, &dl, &od, &odl, ifo, &request, &require, &no, &reject); if (make_option_mask(d, dl, od, odl, request, arg, 1) != 0 || @@ -794,6 +796,8 @@ break; case O_REJECT: ARG_REQUIRED; + if (ctx->options & DHCPCD_PRINT_PIDFILE) + break; set_option_space(ctx, arg, &d, &dl, &od, &odl, ifo, &request, &require, &no, &reject); if (make_option_mask(d, dl, od, odl, reject, arg, 1) != 0 || @@ -1057,6 +1061,8 @@ break; case 'O': ARG_REQUIRED; + if (ctx->options & DHCPCD_PRINT_PIDFILE) + break; set_option_space(ctx, arg, &d, &dl, &od, &odl, ifo, &request, &require, &no, &reject); if (make_option_mask(d, dl, od, odl, request, arg, -1) != 0 || @@ -1069,6 +1075,8 @@ break; case 'Q': ARG_REQUIRED; + if (ctx->options & DHCPCD_PRINT_PIDFILE) + break; set_option_space(ctx, arg, &d, &dl, &od, &odl, ifo, &request, &require, &no, &reject); if (make_option_mask(d, dl, od, odl, require, arg, 1) != 0 || @@ -1307,6 +1315,8 @@ break; case O_DESTINATION: ARG_REQUIRED; + if (ctx->options & DHCPCD_PRINT_PIDFILE) + break; set_option_space(ctx, arg, &d, &dl, &od, &odl, ifo, &request, &require, &no, &reject); if (make_option_mask(d, dl, od, odl, @@ -2269,7 +2279,8 @@ ldop, edop); } - logerrx("unknown option: %s", opt); + if (!(ctx->options & DHCPCD_PRINT_PIDFILE)) + logerrx("unknown option: %s", opt); return -1; }