diff --git a/ifconfig/options.c b/ifconfig/options.c index 3032062..3d68875 100644 --- a/ifconfig/options.c +++ b/ifconfig/options.c @@ -270,7 +270,7 @@ static struct argp_option argp_options[] = { { "format", FORMAT_OPTION, "FORMAT", 0, "select output format; set to `help' for info", GRP }, { "up", UP_OPTION, NULL, 0, - "activate the interface (default if address is given)", GRP }, + "activate the interface", GRP }, { "down", DOWN_OPTION, NULL, 0, "shut the interface down", GRP }, { "flags", 'F', "FLAG[,FLAG...]", 0, @@ -496,10 +496,13 @@ parse_opt_set_default_format_from_file (const char *file) void parse_opt_finalize (struct ifconfig *ifp) { - if (ifp && !ifp->valid) + if (ifp) { - ifp->valid = IF_VALID_FORMAT; - ifp->format = default_format; + if (!(ifp->valid & IF_VALID_FORMAT)) + { + ifp->valid |= IF_VALID_FORMAT; + ifp->format = default_format; + } ifp->setflags |= pending_setflags; ifp->clrflags |= pending_clrflags; }