Commit Graph

7 Commits

Author SHA1 Message Date
Denys Vlasenko
f625836e60 udhcpc[6]: make log2 messages for chaddr field indented like the rest
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-29 18:02:01 +02:00
Denys Vlasenko
2b9acc60c0 udhcpc[6]: initialize entire sockaddr_ll
I see random field values like sll_hatype=0x267 when I strace.
They seem to not matter, but just in case they sometimes do,
let's at least have deterministic values (via memset(0)).

function                                             old     new   delta
change_listen_mode                                   308     322     +14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-29 14:22:43 +02:00
Denys Vlasenko
ed898ed2dd udhcp6: fix releasing
Patch is based on work by tiggerswelt.net. They say:
"
We wanted udhcpc6 to release its IPv6-Addresses on
quit (-R-commandline-option) which turned out to generate once again
kind of garbage on the network-link.
We tracked this down to two issues:

 - udhcpc6 uses a variable called "srv6_buf" to send packets to
   the dhcp6-server, but this variable is never initialized correctly
   and contained kind of a garbage-address

 - The address of the dhcp6-server is usually a link-local-address,
   that requires an interface-index when using connect() on an AF_INET6-
   socket

We added an
additional parameter for ifindex to d6_send_kernel_packet() and made
d6_recv_raw_packet() to capture the address of the dhcp6-server and
forward it to its callee.
"

Three last patches together:

function                                             old     new   delta
d6_read_interface                                      -     454    +454
d6_recv_raw_packet                                     -     283    +283
option_to_env                                        249     504    +255
.rodata                                           165226  165371    +145
send_d6_discover                                     195     237     +42
send_d6_select                                       118     159     +41
send_d6_renew                                        173     186     +13
send_d6_release                                      162     173     +11
opt_req                                                -      10     +10
d6_send_kernel_packet                                304     312      +8
opt_fqdn_req                                           -       6      +6
d6_mcast_from_client_config_ifindex                   48      51      +3
d6_find_option                                        63      61      -2
udhcpc6_main                                        2416    2411      -5
static.d6_recv_raw_packet                            266       -    -266
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 8/2 up/down: 1271/-273)         Total: 998 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-03-27 22:44:22 +02:00
Denys Vlasenko
8f2e99c813 udhcp: get rid of bb_info_msg()
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>
2016-03-30 18:41:23 +02:00
Denys Vlasenko
76b680c7a8 Use bb_error_msg instead of bb_info_msg in all commented-out debug printouts
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-03-30 16:04:37 +02:00
Denys Vlasenko
2b6a6b90cc udhcpc6: set hop limit to 1 in emitted raw packets
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-07 18:22:06 +01:00
Denys Vlasenko
9ba75048c0 udhcpc6: new applet. Not yet functional.
It builds. It sends Solicit packets. Not sure these packets are well-formed.
I have no server to test it against.

function                                             old     new   delta
udhcpc6_main                                           -    2426   +2426
d6_send_raw_packet                                     -     428    +428
d6_send_kernel_packet                                  -     274    +274
d6_recv_raw_packet                                     -     248    +248
send_d6_discover                                       -     177    +177
packed_usage                                       28795   28966    +171
d6_run_script                                          -     156    +156
send_d6_renew                                          -     140    +140
send_d6_release                                        -     126    +126
d6_recv_kernel_packet                                  -     116    +116
send_d6_select                                         -      95     +95
perform_d6_release                                     -      78     +78
d6_find_option                                         -      74     +74
init_d6_packet                                         -      54     +54
d6_copy_option                                         -      48     +48
d6_mcast_from_client_config_ifindex                    -      42     +42
d6_dump_packet                                         -      24     +24
static.FF02__1_2                                       -      16     +16
d6_store_blob                                          -      13     +13
applet_names                                        2432    2440      +8
applet_main                                         1412    1416      +4
applet_nameofs                                       706     708      +2
add_d6_client_options                                  -       1      +1
------------------------------------------------------------------------------
(add/remove: 21/0 grow/shrink: 4/0 up/down: 4721/0)          Total: 4721 bytes
   text	   data	    bss	    dec	    hex	filename
 879080	    493	   7584	 887157	  d8975	busybox_old
 884585	    497	   7584	 892666	  d9efa	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-07 15:55:39 +01:00