main: move print_mac_addreses to state structure

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2018-05-20 11:46:23 +01:00
parent 4e7ab66fd4
commit e8e9d49ebb
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
4 changed files with 16 additions and 17 deletions

View file

@ -321,6 +321,9 @@ static char parse_command_line_opts(struct conf_t *state, int argc, char **argv)
output_format = default_format[0];
}
}
if (output_format == 'X' || output_format == 'J') {
state->print_mac_addreses = 1;
}
return output_format;
}
@ -355,10 +358,7 @@ int main(int argc, char **argv)
/* Do the job */
parse_config(&state, 1, state.dhcpdconf_file, state.shared_net_root);
if (output_format == 'X' || output_format == 'J')
parse_leases(&state, 1);
else
parse_leases(&state, 0);
parse_leases(&state);
prepare_data(&state);
do_counting(&state);
if (state.sorts != NULL)