Bug 234 - Fix parsing of serial & TTL values.
Fix parsing of serial & TTL values.
Product: NSD
Classification: Unclassified
Component: Zonec Code
All All
: P2 minor
Assigned To: NSD team
Depends on:
  Show dependency treegraph
Reported: 2009-02-18 05:41 CET by Piotr Sikora
Modified: 2009-02-19 12:18 CET (History)
1 user (show)

See Also:

patch (5.74 KB, patch)
2009-02-18 05:41 CET, Piotr Sikora
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Sikora 2009-02-18 05:41:56 CET
Created attachment 99 [details]

Changes in attached patch (regarding serial):
- serial must be number in range from 0 to 4294967295 (UINT_MAX), negative numbers and odd stuff like "-3dhs" or "dwdwdwdwdw" are not allowed anymore,
- show proper error message when parsing bad serial in zone file ("serial is expected" instead of "time period is expected").

Changes in attached patch (regarding TTL):
- TTL values can't be negative anymore (they were casted to uint32_t anyway),
- $TTL value 4294967295 (UINT_MAX, 0xFFFFFFFF or (int32_t)-1) is now allowed,
- parser->default_minimum is now removed (it was never used anway).

Please note that parsing of TTL values is still far from perfect.
Comment 1 Matthijs Mekking 2009-02-19 12:18:06 CET
This is fixed in trunk, will be in next release.
Also, I have included a change so that not the whole zone will be skipped during parsing (because the TTL or ORIGIN directive failed).