diff options
author | JINMEI, Tatuya <jinmei@isl.rdc.toshiba.co.jp> | 2007-06-14 05:12:20 +0000 |
---|---|---|
committer | Bjørn Mork <bjorn@mork.no> | 2010-08-06 15:37:37 +0200 |
commit | f077ef7bd0694a4c4803b12ab8966386bb76e530 (patch) | |
tree | 8e57c6eb70771e2c310c7935170566e33cbca1ec | |
parent | 00aefa091ba2e374519c475793056f6ab8ce9fb6 (diff) |
corrected duplication check for 'request' statement. reported by: Shunichi Gondo
-rw-r--r-- | config.c | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -1550,19 +1550,6 @@ add_options(opcode, ifc, cfl0) struct ia_conf *iac; for (cfl = cfl0; cfl; cfl = cfl->next) { - if (opcode == DHCPOPTCODE_REQUEST) { - for (opt = TAILQ_FIRST(&ifc->reqopt_list); opt; - opt = TAILQ_NEXT(opt, link)) { - if (opt->val_num == cfl->type) { - dprintf(LOG_INFO, FNAME, - "duplicated requested" - " option: %s", - dhcp6optstr(cfl->type)); - goto next; /* ignore it */ - } - } - } - switch(cfl->type) { case DHCPOPT_RAPID_COMMIT: switch (opcode) { @@ -1706,6 +1693,14 @@ add_options(opcode, ifc, cfl0) } switch(opcode) { case DHCPOPTCODE_REQUEST: + if (dhcp6_find_listval(&ifc->reqopt_list, + DHCP6_LISTVAL_NUM, &opttype, 0) + != NULL) { + dprintf(LOG_INFO, FNAME, + "duplicated requested option: %s", + dhcp6optstr(opttype)); + goto next; /* ignore it */ + } if (dhcp6_add_listval(&ifc->reqopt_list, DHCP6_LISTVAL_NUM, &opttype, NULL) == NULL) { |