]> git.ipfire.org Git - thirdparty/ipset.git/commit
Show correct line numbers in restore output for parser errors
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 18 Jan 2011 16:17:46 +0000 (17:17 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 18 Jan 2011 16:17:46 +0000 (17:17 +0100)
commitcac607bd8850e00356e4d97b05e7c8adfb3fa640
treebefa146e2c99f2557ee385865070c5853eb887b7
parent1d4c46ed1088f40315695bc2de12bddc35b536a1
Show correct line numbers in restore output for parser errors

Parser errors are reported by a wrong lineno at restore, bug reported
by Holger Eitzenberger:

  create foo6 hash:ip hashsize 64 family inet6
  add foo6 20a1:1234:5678::/64
  add foo6 20a1:1234:5679::/64

you get:

  ipset v5.2: Error in line 1: Syntax error: plain IP address must be supplied: 20a1:1234:5678::/64

Should be line 2 though.

The solution is to set the session lineno before parsing.
include/libipset/session.h
lib/session.c
src/ipset.c