From 679212836a881b53382ea6bd811f38e00705d50d Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 17 Jul 2008 11:59:13 +0000 Subject: - fix segfault in nameif with mactab file (by fixing and shrink config parser) function old new delta config_free_data - 37 +37 config_open 43 48 +5 pack_gzip 1658 1660 +2 nameif_main 527 525 -2 SynchronizeFile 629 623 -6 make_device 1184 1176 -8 config_close 31 18 -13 config_read 431 393 -38 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/5 up/down: 44/-67) Total: -23 bytes --- networking/nameif.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'networking') diff --git a/networking/nameif.c b/networking/nameif.c index c5a715e36..291780a28 100644 --- a/networking/nameif.c +++ b/networking/nameif.c @@ -160,12 +160,12 @@ int nameif_main(int argc, char **argv) prepend_new_eth_table(&clist, ifname, *argv++); } } else { - struct parser_t parser; - if (config_open(&parser, fname)) { + struct parser_t *parser = config_open(fname); + if (parser) { char *tokens[2]; - while (config_read(&parser, tokens, 2, 2, " \t", '#') >= 0) + while (config_read(parser, tokens, 2, 2, " \t", '#') >= 0) prepend_new_eth_table(&clist, tokens[0], tokens[1]); - config_close(&parser); + config_close(parser); } } -- cgit v1.2.3