aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/common.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* udhcp: fix capitalization of two messagesDenys Vlasenko2016-03-301-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: get rid of bb_info_msg()Denys Vlasenko2016-03-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta udhcpd_main 1501 1531 +30 d6_recv_raw_packet 251 264 +13 perform_d6_release 188 198 +10 udhcpc6_main 2443 2449 +6 udhcp_recv_raw_packet 582 588 +6 udhcp_recv_kernel_packet 132 138 +6 send_d6_renew 140 146 +6 d6_recv_kernel_packet 118 124 +6 send_renew 77 82 +5 send_discover 85 90 +5 send_decline 84 89 +5 send_d6_select 97 102 +5 send_d6_discover 174 179 +5 perform_release 167 172 +5 count_lines 72 74 +2 udhcpc_main 2836 2837 +1 bb_info_msg 125 - -125 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 17/4 up/down: 117/-180) Total: -63 bytes text data bss dec hex filename 924935 906 17160 943001 e6399 busybox_old 924736 906 17160 942802 e62d2 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc: fix OPTION_6RD parsing (could overflow its malloced buffer)Denys Vlasenko2016-02-261-2/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: add PXELINUX path prefix option (code 210) definitionJeremy Kerr2014-07-161-0/+2
| | | | | | | | | | | | | | | Like d3092c99, this change adds support for the DHCP "path-prefix" option, as defined in RFC 5071. We use the string identifer "pxepathprefix". Adding this option makes string parsing in the hook scripts simpler. function old new delta dhcp_option_strings 255 269 +14 dhcp_optflags 72 74 +2 Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: add PXELINUX config file option (code 209) definitionJeremy Kerr2013-11-121-0/+2
| | | | | | | | | This change adds a definition for DHCP option 209. RFC 5071 defines code 209 as a configuration file for a PXE bootloader; this change uses the string "pxeconffile" as its text identifier. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: code shrinkDenys Vlasenko2013-05-171-17/+13
| | | | | | | | function old new delta attach_option 416 413 -3 allocate_tempopt_if_needed 74 - -74 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc: fix a problem with binary-encoded options #2Denys Vlasenko2013-05-171-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: finish support of classless static routes (now the correct patch!)Michael McTernan2011-12-161-18/+37
| | | | | Signed-off-by: Michael McTernan <Michael.McTernan.2001@cs.bris.ac.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc: sanitize hostnames in incoming packets. Closes 3979.Denys Vlasenko2011-12-081-5/+9
| | | | | | | | | | | | | | | | The following options are replaced with string "bad" if they contain malformed hostname: HOST_NAME, DOMAIN_NAME, NIS_DOMAIN, TFTP_SERVER_NAME function old new delta xmalloc_optname_optval 850 888 +38 attach_option 440 443 +3 len_of_option_as_string 13 14 +1 dhcp_option_lengths 13 14 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 43/0) Total: 43 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc6: rudimentary code to export data to script; fix IAADDR parsingDenys Vlasenko2011-11-161-0/+19
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dhcpc: fix the case where we might add extra space at the end of envvar.Denys Vlasenko2011-10-201-0/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc: add support for DHCP option 212 (RFC 5969)Denys Vlasenko2011-10-191-0/+3
| | | | | | | | | | | | | | | The patch is from OpenWRT people. function old new delta xmalloc_optname_optval 637 874 +237 dhcp_option_strings 237 243 +6 dhcp_optflags 68 70 +2 len_of_option_as_string 12 13 +1 dhcp_option_lengths 12 13 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/0 up/down: 247/0) Total: 247 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: add FEATURE_UDHCP_8021Q optionNigel Hathaway2011-04-261-0/+8
| | | | | | | | | function old new delta dhcp_option_strings 217 237 +20 dhcp_optflags 64 68 +4 Signed-off-by: Nigel Hathaway <Nigel.Hathaway@ubiquisys.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc: fix a problem with binary-encoded optionsDenys Vlasenko2011-02-061-1/+1
| | | | | | | function old new delta attach_option 395 413 +18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc: remove now-unneeded definitions of vendor and client-id optsDenys Vlasenko2010-10-201-3/+4
| | | | | | | function old new delta dhcp_optflags 68 64 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc: remove -c CLIENTID, it is hard to use, -x 61:hexstring does the same ↵Denys Vlasenko2010-10-201-1/+1
| | | | | | | | | | | | | better function old new delta packed_usage 27802 27808 +6 static.udhcpc_longopts 261 250 -11 udhcpc_main 2799 2780 -19 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 6/-30) Total: -24 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: add support for 0x21 ROUTES and 0xf9 MS_STATIC_ROUTES optionsVladislav Grishenko2010-09-261-0/+4
| | | | | Signed-off-by: Vladislav Grishenko <themiron@mail.ru> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dhcp: readability cleanups and small code shrinkDenys Vlasenko2010-05-301-2/+2
| | | | | | | function old new delta udhcp_run_script 654 617 -37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: s/sipservers/sipsrv/ to match other similar option namesDenys Vlasenko2010-04-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: implement "raw" binary options. Closes bug 735Denys Vlasenko2010-04-041-9/+38
| | | | | | | | | | | | | function old new delta allocate_tempopt_if_needed - 76 +76 udhcp_str2optset 351 415 +64 attach_option 380 398 +18 len_of_option_as_string 11 12 +1 dhcp_option_lengths 11 12 +1 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/0 up/down: 160/0) Total: 160 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: s/dhcp_option/dhcp_optflag/gDenys Vlasenko2010-04-041-20/+20
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpd: support decoding of option 120 "SIP servers". Closes bug 737Denys Vlasenko2010-04-031-12/+23
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: make index_in_substrings return -1 on ambiguous matchesDenys Vlasenko2010-04-031-2/+2
| | | | | | | function old new delta index_in_substrings 67 93 +26 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: abort if we see unknown option, and show valid options if soDenys Vlasenko2010-03-271-5/+21
| | | | | | | | | | | function old new delta udhcp_option_idx - 77 +77 udhcp_str2optset 366 351 -15 udhcpc_main 2845 2801 -44 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 77/-59) Total: 18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: pass pointer to whole packet to "add option" functionsDenys Vlasenko2010-03-261-7/+9
| | | | | | | | | | | | | | | | | | | | | This is needed for "overflow option" support function old new delta udhcp_find_option - 34 +34 udhcp_add_binary_option 94 106 +12 write_leases 227 223 -4 udhcp_init_header 86 82 -4 send_release 104 99 -5 init_packet 87 81 -6 add_client_options 160 154 -6 add_server_options 100 92 -8 udhcpd_main 1964 1954 -10 udhcpc_main 2859 2837 -22 find_option 34 - -34 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/8 up/down: 46/-99) Total: -53 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: move options.c to common.c; disable unused bool and s16 option codeDenys Vlasenko2010-03-261-2/+452
| | | | | | | | | | | | | | | | | function old new delta udhcp_add_binary_option - 94 +94 udhcp_str2nip - 42 +42 len_of_option_as_string 12 10 -2 dhcp_option_lengths 12 10 -2 udhcpc_main 2859 2851 -8 read_nip 42 - -42 xmalloc_optname_optval 590 536 -54 udhcp_str2optset 443 366 -77 udhcp_add_option_string 86 - -86 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 0/5 up/down: 136/-271) Total: -135 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: logging improvements, field and variable renamesDenys Vlasenko2009-06-171-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: change UDHCP_DEBUG into int, make verbosity selectable with -vDenys Vlasenko2009-06-171-1/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* trylink: produce even more info about final link stageDenis Vlasenko2007-08-121-1/+3
| | | | | | | | | trylink: explain how to modify link and drastically decrease amount of padding (unfortunately, needs hand editing ATM). *: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts size saving: 0.5k
* udhcp: slight shrinkDenis Vlasenko2007-08-021-21/+0
| | | | | | | | | | | | | | | | | udhcpd_main 1171 1208 +37 udhcpc_main 2363 2387 +24 dhcprelay_main 1145 1146 +1 dhcprelay_stopflag 4 1 -3 dhcprelay_signal_handler 11 8 -3 client_background 46 42 -4 udhcp_read_interface 230 211 -19 udhcp_make_pidfile 76 - -76 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 3/4 up/down: 62/-105) Total: -43 bytes text data bss dec hex filename 770052 1096 11228 782376 bf028 busybox_old 769980 1096 11228 782304 befe0 busybox_unstripped
* udhcp: many small fixes:Denis Vlasenko2007-07-031-22/+2
| | | | | | | | | | | | | | | | | | | | | | | | * arpping(): smaller and even probably fixed * lots of variables/params converted: ulong -> uint32_t * uptime() nuked in favor of monotonic_sec() * udhcp_get_packet(): only one "bad vendor", simplify function old new delta reservedIp 36 35 -1 udhcpc_main 2462 2460 -2 addStaticLease 64 62 -2 static.broken_vendors 16 - -16 uptime 19 - -19 udhcpd_main 1273 1238 -35 udhcp_get_packet 223 184 -39 .rodata 144162 144106 -56 arpping 690 609 -81 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/7 up/down: 0/-251) Total: -251 bytes text data bss dec hex filename 734241 3028 14400 751669 b7835 busybox_old 734005 3028 14400 751433 b7749 busybox_unstripped
* udhcpc: stop deleting our own pidfile if we daemonize.Denis Vlasenko2007-05-031-16/+0
| | | | | udhcp[cd]: stop using atexit magic fir pidfile removal.
* udhcp: MAC_BCAST_ADDR and blank_chaddr are in fact constant, move to rodata.Denis Vlasenko2007-04-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | a few global variables reduced to smallints function old new delta add_lease 75 227 +152 static.blank_chaddr - 16 +16 MAC_BCAST_ADDR - 6 +6 sockfd 4 8 +4 udhcp_run_script 1153 1155 +2 state 8 5 -3 listen_mode 4 1 -3 perform_release 152 148 -4 fd 8 4 -4 blank_chaddr 16 - -16 udhcpc_main 2518 2497 -21 .rodata 131864 131832 -32 oldest_expired_lease 61 - -61 clear_lease 127 - -127 ------------------------------------------------------------------------------ (add/remove: 2/3 grow/shrink: 3/6 up/down: 180/-271) Total: -91 bytes
* make pidfile writing configurable.Denis Vlasenko2007-03-271-29/+16
| | | | [ui]toa_to_buf: change API. No users yet.
* Move udhcp to new NOMMU helpers.Denis Vlasenko2007-03-261-22/+38
| | | | | | Fix server part to compile under NOMMU. Client is not compilable yet. On MMU everything compiles (and maybe even works :)
* use bb_sanitize_stdio() where appropriateDenis Vlasenko2007-01-271-15/+1
|
* small fixes: using fd-based io instead of FILE*-based,Denis Vlasenko2006-11-181-3/+1
| | | | missed O_TRUNC, etc
* udhcp: fix indentation and style.Denis Vlasenko2006-11-181-13/+0
| | | | | Eliminate (group) a lot of smallish *.h files Remove lots of unneeded #includes
* message string changes, mostly for consistency, also -32 bytes in .rodataDenis Vlasenko2006-10-201-1/+1
|
* bb_applet_name -> applet_nameDenis Vlasenko2006-10-031-2/+2
|
* Fix (hopefully) bug 976. Need more thorough audit.Denis Vlasenko2006-09-071-3/+3
| | | | | Restore erroneously removed FEATURE_UDHCP_SYSLOG.
* Implement optional syslog logging using ordinaryDenis Vlasenko2006-09-061-57/+14
| | | | | | bb_xx_msg calls, and convert networking/* to it. The rest of bbox will be converted gradually.
* replacing func() with xfunc() where appropriateDenis Vlasenko2006-09-031-4/+1
|
* My first bout of untangling udhcp. Make lots of gratuitous #defines goRob Landley2006-05-281-7/+6
| | | | | | away, substitutie BB_VER for an external VERSION, use busybox CONFIG symbols rather than checking for them then defining others, etc. Lots more cleanup to do...
* - replace _PATH_DEVNULL with bb_dev_nullBernhard Reutner-Fischer2006-05-191-4/+6
|
* add back in udhcp supportMike Frysinger2006-05-081-0/+135
|
* remove in place of external linkMike Frysinger2006-03-231-162/+0
|
* Revert the uptime() removal. Let the list sort it out...Rob Landley2005-05-041-0/+8
|
* Patch from Shaun Jackman:Rob Landley2005-05-041-8/+0
| | | | | | Replace uptime with time(NULL). time is more portable than uptime and eliminates the need to define uptime, reducing code size slightly.