udhcpc6: carry along length of packet when parsing it.
authorDavid Decotigny <ddecotig@gmail.com>
Thu, 24 May 2018 15:30:15 +0000 (08:30 -0700)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 24 May 2018 16:34:56 +0000 (18:34 +0200)
commit8f48fc01e9e43d16bf5860fa37252b43c76cb395
tree8762e416ece3a9f6c80c5760f5054de9b491c5e2
parenta174c791ece5d7f2869e9efd338d91c8ea10f609
udhcpc6: carry along length of packet when parsing it.

This is to avoid parsing garbage past packet's actual end.

Also const-ize params to a few functions.

function                                             old     new   delta
d6_run_script_no_option                                -      12     +12
option_to_env                                        791     798      +7
d6_run_script                                        253     255      +2
perform_d6_release                                    95      93      -2
udhcpc6_main                                        2596    2592      -4
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/2 up/down: 21/-6)              Total: 15 bytes

Signed-off-by: David Decotigny <ddecotig@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/udhcp/d6_dhcpc.c