summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-11-02 17:03:31 +0000
committerRoy Marples <roy@marples.name>2020-11-02 17:03:58 +0000
commit7b19da497887e908f285996b3b1c95471a68a8d8 (patch)
tree5d35fcb6e2e9c99aa19f7bf9b849edd782d60e20
parent407de1ed009d5c5a8ab3121d6b1f4b24f65717da (diff)
downloaddhcpcd-7b19da497887e908f285996b3b1c95471a68a8d8.tar.xz
options: Don't log unknown option errors when printing the pidfile
-rw-r--r--src/if-options.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/if-options.c b/src/if-options.c
index 9b2c74fb..23797bb1 100644
--- a/src/if-options.c
+++ b/src/if-options.c
@@ -782,6 +782,8 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
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 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
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 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
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 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
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 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
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 @@ parse_config_line(struct dhcpcd_ctx *ctx, const char *ifname,
ldop, edop);
}
- logerrx("unknown option: %s", opt);
+ if (!(ctx->options & DHCPCD_PRINT_PIDFILE))
+ logerrx("unknown option: %s", opt);
return -1;
}