From fac5288ad80b7ca2f23d1d5acf6ced98a61fd8eb Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu" Date: Tue, 21 Oct 2008 22:04:47 +0000 Subject: - 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. --- ipset_macipmap.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'ipset_macipmap.c') 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"); -- cgit v1.2.3