Age | Commit message (Collapse) | Author |
|
parse_number('L') since it is parsing unsigned 32bit integers.
|
|
match grammar comments and improve euphony.
|
|
renew/rebind/expiry. Treat renew/rebind/expiry statements in leases as
comments for human consumption.
|
|
integers.
|
|
emitted when other unsigned 32-bit values are parsed. i.e.
"expecting integer between 0 and 4294967295". No need to
make people google what "unsigned 32-bit decimal value" means.
|
|
associated weird comment about parsing resolv.conf.
dhclient.conf and dhclient.leases.<if> are semi-colon
oriented and not line oriented. '\n' is never returned
by get_token().
|
|
to parse_hex_octets() and have it return 0/1 to indicate success,
to not touch existing data on error paths, to handle ';'
better, emit single error message ("expecting colon
delimited list of hex octets."). Fold parse_hex() into
parse_hex_octets().
Simplify logic in parse_option_decl() to eliminate duplicate
overflow error checking and error messages as a result.
|
|
0 for failure, 1 for success, emitting a
single error message ("expecting string.") and
handling ';' better.
Don't leak memory when encountering pathological
config or lease files containing repeated instances
of an option or command with string data.
|
|
committed.
|
|
code in the same way as the other parse_*()
functions. Whitespace fix in comment while
passing. Also conform to idiom that original
data is not changed in the error path.
|
|
single error message ("expecting integer between x and y")
and to properly handle ';' in error cases.
|
|
i.e. handle ';' better, and issue error
message ("expecting boolean.") itself.
|
|
i.e. handle ';' better, and issue only one error
message ("expecting IPv4 CIDR block").
One gratuitous whitespace tweak tossed in.
|
|
failure ("expecting unsigned 32-bit decimal value") and to
properly handle the terminating ';' in error situations.
Make parse_lease_time() return an int to indicate success
or failure as its friends do. Also avoid swapping endianess
twice.
Use == 1 vs != 0 when checking parse_ip_addr() return
value.
|
|
failure ("expecting IPv4 address") and to properly
handle the terminating ';' in error situations.
|
|
pointlessly precise error messages in favour of 'expecting
UTC time'.
|
|
Create global 'log_procname' and set it to '<ifname>' or
'<ifname> [priv]' as appropriate for the process doing the
setting. Use it as the prefix in all log_*() output. Makes
tracking messages for an interface or a process much easier.
|
|
verbiage.
|
|
|
|
"<var> == 0", "!(<var> & FLAG)" with
"(<var> & FLAG) == 0", "!<func()>"
with "<func()> == 0" and "!<define>" with
"<define> == 0". And the positive cases
as well.
A few stray == NULL and != NULL as well.
|
|
"<pointer> == NULL". And of course "<pointer>"
expressions with "<pointer> != NULL".
|
|
declarations.
|
|
|
|
chars to parse_decimal() instead of less obvious *fmt; refactor
to eliminate need for the 'alloc:' and 'bad_flag:' labels and the
invidious backwards goto's to them.
|
|
and sometimes uintNN_t.
|
|
fields 'hardware', 'alias', 'media', 'medium', 'ethernet'.
Also remove now-unused parse_ethernet().
Making these parsing failures will smoke out anybody with
leases or conf files from the last century.
|
|
files.
ok tb@ millert@
|
|
|
|
|
|
win.
No intentional functional change.
|
|
'int' -> 'unsigned int' (and visa versa) where obvious.
Steal a couple of 'unsigned' -> u_int32_t from reyk@'s dhcrelay
tweaks.
No intentional functional change.
|
|
be used to return the final size of the parsed (i.e. un-vis'ed)
string. Use same, plus memcpy() to ensure entire final string is
copied to intended destination even if there are embedded NULs.
|
|
Push the un-vising up to parse_string(). This allows both the actual
string and the un-vised version to be available as desired. Use
memcpy() instead of strdup() to copy un-vised string since it may
legitimately contain NUL.
|
|
some logic.
|
|
|
|
"expecting a string". Things other than filenames are parsed here.
|
|
Simplify the "^" placing logic and make it apply to log entries as
well as terminal output.
Since dhclient(8) can be re-exec'd for various reasons after going
daemon, make sure we don't try to log to stderr if it isn't a TTY.
|
|
No objections heard. Feedback from millert@ guenther@
|
|
with standard daemon log.[ch].
ok mpi@
|
|
each *.c file.
Inspired by mention of header silliness by Edgar Pettijohn and mmcc@
on tech@.
|
|
Reported long ago by matthieu@. Also Jacob Berkman via the lists.
Tests and suggestions from Jacob and Matthieu.
|
|
|
|
(classless-ms-static-routes). dhcpd can now specify and serve
these options and dhclient can recognize and use supersede, etc.
statements on them.
Based on a diff from Stefan Rinke. Thanks!
|
|
signed 8 bit dhcp option types. So nuke getShort() and all 's' and
'b' format support. While here use '%u'/'%lu' and not
'%d'/'%ld' to snprintf() unsigned values.
|
|
make the code more readable. And prepare for some new things
that will need to be parsed.
ok dlg@
|
|
it actually does.
|
|
than occasionally 'expected'. End all with a '.'.
|
|
encountering a ';'. I.e. when checking the token type, 'skip_to_semi()'
after 'parse_warn()' only when the parsed token wasn't a ';'.
|
|
the perfectly adequate parse_semi(). And some blocks didn't even
need to peek.
|
|
possibly ignoring entire rest of dhclient.conf or dhclient.leases.if
looking for a mistakenly consumed '}'.
|