diff options
author | /C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu </C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu> | 2008-10-21 22:04:47 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu </C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu> | 2008-10-21 22:04:47 +0000 |
commit | fac5288ad80b7ca2f23d1d5acf6ced98a61fd8eb (patch) | |
tree | dd463fdaf37a4daf8dddddd63ccd45daee0ad883 /ipset_macipmap.c | |
parent | b8d6cfc169bf79b72faaab6ef7940798dbfe9328 (diff) |
- macipmap type reported misleading deprecated separator
tokens and printed the old one at listing set elements.
Token printing was errorneous too.
(Bugs reported by Krzysztof Oledzki)
- Warn only once about deprecated separator tokens in
restore mode.
Diffstat (limited to 'ipset_macipmap.c')
-rw-r--r-- | ipset_macipmap.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ipset_macipmap.c b/ipset_macipmap.c index 7345f8b..3a9530c 100644 --- a/ipset_macipmap.c +++ b/ipset_macipmap.c @@ -183,13 +183,15 @@ adt_parser(unsigned cmd, const char *optarg, void *data) char *ptr, *tmp = saved; DP("macipmap: %p %p", optarg, data); - - if ((ptr = strchr(tmp, ':')) || (ptr = strchr(tmp, '%'))) - fprintf(stderr, "Warning: please replace old separator character '%s.1' with ','.\n" - "Next release won't support it.\n", - ptr); - ptr = strsep(&tmp, ":%,"); + ptr = strsep(&tmp, ","); + if (!tmp) { + tmp = saved; + ptr = strsep(&tmp, ":%"); + if (tmp && ++warn_once == 1) + fprintf(stderr, "Warning: please use ',' separator token between ip,mac.\n" + "Next release won't support old separator tokens.\n"); + } parse_ip(ptr, &mydata->ip); if (tmp) @@ -250,7 +252,7 @@ printips_sorted(struct set *set, void *data, size_t len, unsigned options) while (addr <= mysetdata->last_ip) { if (test_bit(IPSET_MACIP_ISSET, (void *)&table[addr - mysetdata->first_ip].flags)) { - printf("%s:", ip_tostring(addr, options)); + printf("%s,", ip_tostring(addr, options)); print_mac(table[addr - mysetdata->first_ip]. ethernet); printf("\n"); |