Re: [PATCH] udhcpc: add support for long options

2020-08-15 Thread Martin Lewis
Tested both regular options and long options against ISC's dhcpd, looks good. Martin On Thu, 13 Aug 2020 at 10:00, Denys Vlasenko wrote: > On Tue, Aug 4, 2020 at 5:25 PM Martin Lewis > wrote: > > Duplicate options are currently overridden (only the last option is > kept).

[PATCH] udhcpc: add support for long options

2020-08-04 Thread Martin Lewis
busybox_unstripped Signed-off-by: Martin Lewis --- networking/udhcp/dhcpc.c | 125 ++- networking/udhcp/dhcpc.h | 1 + 2 files changed, 93 insertions(+), 33 deletions(-) diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 50dfead63..d4a7a825e

Re: [PATCH 3/4] lsscsi: code shrink and refactor

2020-07-09 Thread Martin Lewis
159915 159920 +5 > lsscsi_main 364 349 -15 > > -- > (add/remove: 0/0 grow/shrink: 1/1 up/down: 5/-15) Total: -10 > bytes >textdata bss dec hex filenam

Re: [PATCH] shrink last_char_is function even more

2020-07-09 Thread Martin Lewis
Please note that my original patch is still smaller: http://lists.busybox.net/pipermail/busybox/2020-June/088026.html I'm not sure whether it's faster, it would be interesting to compare them. On Tue, 7 Jul 2020 at 14:17, Tito wrote: > Hi, > attached you will find a patch that shrinks libbb's

[PATCH] domain_codec: optimize dname_dec and convert_dname

2020-07-09 Thread Martin Lewis
bss dec hex filename 981645 169151872 1000432 f43f0 busybox_old 981603 169151872 1000390 f43c6 busybox_unstripped Signed-off-by: Martin Lewis --- networking/udhcp/domain_codec.c | 157 1 file changed, 79 insertions(+), 78

Re: [PATCH 2/2] udhcpc: fixed a TODO in fill_envp using option scanner

2020-07-02 Thread Martin Lewis
Thank you for applying the commits! I started implementing support for RFC 3396, hopefully it will be ready soon. Martin On Mon, 29 Jun 2020 at 08:40, Denys Vlasenko wrote: > Applied, thanks > > On Tue, Jun 23, 2020 at 3:41 PM Martin Lewis > wrote: > > > > fil

Re: [PATCH 4/4] last_char_is: code shrink

2020-07-01 Thread Martin Lewis
; } return NULL; } On Tue, 30 Jun 2020 at 10:59, Jody Bruchon wrote: > strlen scans the string; strrchr also scans the string. > > On 2020-07-01 10:23, Martin Lewis wrote: > > Hi, > > > > I'm not sure what I'm missing, from a quick glance at strrchr > > (g

Re: [PATCH 4/4] last_char_is: code shrink

2020-06-30 Thread Martin Lewis
t 3:45 PM Martin Lewis > wrote: > > > > function old new delta > > last_char_is 53 30 -23 > > > ---

[PATCH 0/2] udhcpc: optimized fill_envp (fixes TODO)

2020-06-23 Thread Martin Lewis
Up until now, udhcpc iterated over the received packet a few hundred times (!). This patch series resolves the relevant TODO - iterating over the packet just once, while also reducing binary size. Tested against: * VMware's dhcp server * udhcpd * ISC's dhcpd function

[PATCH 2/2] udhcpc: fixed a TODO in fill_envp using option scanner

2020-06-23 Thread Martin Lewis
fill_envp now iterates over the packet only once instead of a few hundred times using the new option scanner. Signed-off-by: Martin Lewis --- networking/udhcp/dhcpc.c | 201 --- 1 file changed, 87 insertions(+), 114 deletions(-) diff --git

[PATCH 1/2] udhcp: add option scanner

2020-06-23 Thread Martin Lewis
Added an option scanner to udhcp to enable iteration over packet options. Signed-off-by: Martin Lewis --- networking/udhcp/common.c | 96 ++- networking/udhcp/common.h | 8 2 files changed, 62 insertions(+), 42 deletions(-) diff --git

[PATCH 3/4] lsscsi: code shrink and refactor

2020-06-11 Thread Martin Lewis
1000119 f42b7 busybox_old 981322 169151872 1000109 f42ad busybox_unstripped Signed-off-by: Martin Lewis --- miscutils/lsscsi.c | 50 ++ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/miscutils/lsscsi.c b/miscutils/lsscsi.c

[PATCH 2/4] compare_string_array: code shrink

2020-06-11 Thread Martin Lewis
: 0/0 grow/shrink: 0/1 up/down: 0/-10) Total: -10 bytes textdata bss dec hex filename 981342 169151872 1000129 f42c1 busybox_old 981332 169151872 1000119 f42b7 busybox_unstripped Signed-off-by: Martin Lewis --- libbb/compare_string_array.c | 7

[PATCH 4/4] last_char_is: code shrink

2020-06-11 Thread Martin Lewis
bytes textdata bss dec hex filename 981322 169151872 1000109 f42ad busybox_old 981299 169151872 186 f4296 busybox_unstripped Signed-off-by: Martin Lewis --- libbb/last_char_is.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git

[PATCH 1/4] procps: code shrink

2020-06-11 Thread Martin Lewis
-- (add/remove: 1/0 grow/shrink: 0/1 up/down: 37/-113) Total: -76 bytes textdata bss dec hex filename 981418 169151872 1000205 f430d busybox_old 981342 169151872 1000129 f42c1 busybox_unstripped Signed-off-by: Martin Lewis --- libbb/procps.c | 12

Re: [PATCH] domain_codec: optimize call to dname_enc

2020-06-10 Thread Martin Lewis
Hi, Yes, looks good :) Martin On Wed, 10 Jun 2020 at 10:21, Denys Vlasenko wrote: > Thanks. I addressed this a bit differently. Looks good now? > > On Tue, Jun 9, 2020 at 4:55 PM Martin Lewis > wrote: > > > > The only call to dname_enc is with cstr = NULL, so mos

[PATCH] dhcpc: refactor xmalloc_optname_optval to shrink binary size

2020-06-09 Thread Martin Lewis
textdata bss dec hex filename 993252 169231872 1012047 f714f busybox_old 993117 169231872 1011912 f70c8 busybox_unstripped Signed-off-by: Martin Lewis --- networking/udhcp/common.h | 2 +- networking/udhcp/dhcpc.c | 47

[PATCH] domain_codec: optimize call to dname_enc

2020-06-09 Thread Martin Lewis
) Total: -272 bytes textdata bss dec hex filename 993252 169231872 1012047 f714f busybox_old 992980 169231872 1011775 f703f busybox_unstripped Signed-off-by: Martin Lewis --- networking/udhcp/common.c | 6 +- networking/udhcp/common.h | 1

[PATCH] A friendly ping for code shrinks

2020-06-08 Thread Martin Lewis
Hello, Just a friendly ping for some old binary/code shrinking patches. dhcpc: http://lists.busybox.net/pipermail/busybox/2020-May/087942.html xfuncs_printf.c: http://lists.busybox.net/pipermail/busybox/2020-March/087822.html function

Re: How to redirect the output of lbb_main function to variable on c program

2020-06-03 Thread Martin Lewis
Hello, Sounds like you need output redirection. You need to create a pipe, dup2 it over stdout, call lbb_main, and read the output from the pipe. Similar question: https://stackoverflow.com/questions/17071702/c-language-read-from-stdout Martin On 22/05/2020, Tiago Araujo da costa wrote: > I

Re: Busybox hush shell does not read /etc/profile

2020-06-02 Thread Martin Lewis
Hi, /etc/profile is read only during interactive login shell mode (hush's -l flag). I think that a tty must be attached to the shell for this to work, not sure if that's the case with inittab. Martin On Wed, 26 Feb 2020 at 18:37, Carlos Eduardo de Paula wrote: > I've been struggling to

Re: IPv6 - DHCPv6

2020-06-01 Thread Martin Lewis
Hello, I have a few notes. First of all, you should send the diff as a git patch. Not only will it make the code much easier to read, but will also make it possible to commit into the git repository. Also you mentioned that the server still doesn't respond as expected, perhaps you could address

[PATCH] dhcpc: code shrink in good_hostname

2020-05-04 Thread Martin Lewis
-- (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-15) Total: -15 bytes textdata bss dec hex filename 993144 169151872 1011931 f70db busybox_old 993129 169151872 1011916 f70cc busybox_unstripped Signed-off-by: Martin Lewis --- networking

[PATCH] xstrndup: Use strndup instead of implementing it.

2020-03-08 Thread Martin Lewis
Used the same function instead of strndup by mistake... Here's the correct version: Signed-off-by: Martin Lewis --- libbb/xfuncs_printf.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index 93f325c62

[PATCH] xstrndup: Use strndup instead of implementing it.

2020-03-08 Thread Martin Lewis
Signed-off-by: Martin Lewis --- libbb/xfuncs_printf.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index 93f325c62..b85dde797 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c @@ -93,26 +93,17

[PATCH] nc_bloaty: Code shrink in findline, use memchr instead.

2020-02-03 Thread Martin Lewis
Signed-off-by: Martin Lewis --- networking/nc_bloaty.c | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c index 034e03d21..190a8bcb1 100644 --- a/networking/nc_bloaty.c +++ b/networking/nc_bloaty.c @@ -237,24

[PATCH] nc_bloaty: Code shrink in findline, use strchr instead.

2020-01-15 Thread Martin Lewis
Signed-off-by: Martin Lewis --- networking/nc_bloaty.c | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c index 034e03d21..9848ea794 100644 --- a/networking/nc_bloaty.c +++ b/networking/nc_bloaty.c @@ -237,24

Re: [PATCH] telnet: added support for special telnet characters

2019-10-20 Thread Martin Lewis
er the local "Erase Character" > function is. And from what I've seen from a couple of telnet servers (busybox excluded), they support it. On Fri, 18 Oct 2019 at 09:47, Denys Vlasenko wrote: > On Mon, Jul 8, 2019 at 4:38 PM Martin Lewis > wrote: > > Closes ht

Re: [PATCH] libbb: Converted safe_read to safe_write format

2019-10-15 Thread Martin Lewis
A ping out of curiosity... On Thu, 10 Oct 2019 at 16:33, Martin Lewis wrote: > > Hello, > > Could you please elaborate on what was lacking in the INT_MAX part? > As seen in write's man page: > > > > On Linux, write() (and similar system calls) will transfer at most &g

Re: [PATCH] telnet: added support for special telnet characters

2019-10-15 Thread Martin Lewis
A friendly ping for an old patch. On Mon, 8 Jul 2019 at 09:37, Martin Lewis wrote: > > Closes https://bugs.busybox.net/show_bug.cgi?id=11976 > > Adds a new flag in telnet client's command line, which > forces telnet to send IAC's instead of the > traditional special cha

Re: [PATCH] libbb: Converted safe_read to safe_write format

2019-10-10 Thread Martin Lewis
is is true on >both 32-bit and 64-bit systems.) Wouldn't it create an issue with 64 bit systems when trying to read/write large files? Thanks, Martin On Wed, 9 Oct 2019 at 07:37, Denys Vlasenko wrote: > > On Sun, Sep 15, 2019 at 6:14 PM Martin Lewis > wrote: > > > >

[PATCH] brctl: add support for showstp command

2019-10-10 Thread Martin Lewis
Signed-off-by: Martin Lewis --- networking/brctl.c | 217 - 1 file changed, 216 insertions(+), 1 deletion(-) diff --git a/networking/brctl.c b/networking/brctl.c index ba5b6226f..cb55b0c90 100644 --- a/networking/brctl.c +++ b/networking

Re: [PATCH] brctl: Added support for showmacs command

2019-09-16 Thread Martin Lewis
, will you be able to please provide an example / code reference in which the above code breaks (as I couldn’t find any)? Thank you, Martin On Mon, 16 Sep 2019 at 07:54, Bernhard Reutner-Fischer wrote: > > On 15 September 2019 18:04:49 CEST, Martin Lewis > wrote: > >Signed-off-b

[PATCH] replace: count_strstr - Handle an edge case where sub is empty

2019-09-15 Thread Martin Lewis
If sub is empty, avoids an infinite loop. Signed-off-by: Martin Lewis --- libbb/replace.c | 4 1 file changed, 4 insertions(+) diff --git a/libbb/replace.c b/libbb/replace.c index a661d96..6183d3e 100644 --- a/libbb/replace.c +++ b/libbb/replace.c @@ -11,14 +11,18 @@ #include "li

[PATCH] libbb: Converted safe_read to safe_write format

2019-09-15 Thread Martin Lewis
platforms. Signed-off-by: Martin Lewis --- include/libbb.h| 14 ++ libbb/read.c | 15 +-- libbb/safe_write.c | 3 +++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/libbb.h b/include/libbb.h index 111d1b7..07b1d05 100644 --- a/include

Re: [PATCH] libbb: Converted safe_read to safe_write format

2019-09-15 Thread Martin Lewis
Noticed just now the problematic indentation. I'll fix it in a second, sorry for the inconvenience. ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox

[PATCH] libbb: Converted safe_read to safe_write format

2019-09-15 Thread Martin Lewis
platforms. Signed-off-by: Martin Lewis --- include/libbb.h| 14 ++ libbb/read.c | 15 +-- libbb/safe_write.c | 3 +++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/libbb.h b/include/libbb.h index 111d1b7..07b1d05 100644 --- a/include

[PATCH] brctl: Added support for showmacs command

2019-09-15 Thread Martin Lewis
Signed-off-by: Martin Lewis --- networking/brctl.c | 119 - 1 file changed, 100 insertions(+), 19 deletions(-) diff --git a/networking/brctl.c b/networking/brctl.c index 586ca9b..35771a5 100644 --- a/networking/brctl.c +++ b/networking/brctl.c

[PATCH] arpping.c: Fixed a TODO by adding an error message print

2019-08-06 Thread Martin Lewis
Signed-off-by: Martin Lewis --- networking/udhcp/arpping.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/networking/udhcp/arpping.c b/networking/udhcp/arpping.c index a395e83..59c2bf8 100644 --- a/networking/udhcp/arpping.c +++ b/networking/udhcp/arpping.c @@ -80,8 +80,7

[PATCH] telnet: added support for special telnet characters

2019-07-08 Thread Martin Lewis
telnet servers. Currently only backspace is supported, I will add support for other characters soon. Signed-off-by: Martin Lewis --- networking/telnet.c | 40 ++-- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/networking/telnet.c b/networking

[PATCH] dhcpc.c: Added support for relay server parameter.

2019-06-10 Thread Martin Lewis
Resolved a TODO by adding support for gateway_nip parameter. Signed-off-by: Martin Lewis --- networking/udhcp/dhcpc.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 739870b..acd80f9 100644

[PATCH 1/1] [PATCH] udhcp: Fixed aliasing compilation error and alignment issues.

2019-05-24 Thread Martin Lewis
)])) ^ Also fixed a possible alignment issue related to strict aliasing. Signed-off-by: Martin Lewis --- networking/udhcp/d6_common.h | 2 +- networking/udhcp/d6_dhcpc.c | 4 ++-- 2 files changed, 3 insertions(+), 3

Re: [PATCH] telnetd: Added support for AYT IAC command.

2019-04-10 Thread Martin Lewis
You're absolutely right, I'll fix this right away. On Thu, 4 Apr 2019 at 15:46, Denys Vlasenko wrote: > On Thu, Apr 4, 2019 at 1:33 PM Martin Lewis > wrote: > > > > Fixed a TODO in AYT IAC handling by replying back with a NOP. > > > > Signed-off-by: Martin

[PATCH] telnetd: Added support for AYT IAC command.

2019-04-04 Thread Martin Lewis
Fixed a TODO in AYT IAC handling by replying back with a NOP. Signed-off-by: Martin Lewis --- networking/telnetd.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/networking/telnetd.c b/networking/telnetd.c index caef151..c6fe815 100644 --- a/networking/telnetd.c

Re: [PATCH 1/2] wget: replace set_alarm with non blocking functions to support retries

2019-01-24 Thread Martin Lewis
happy with this approach either... > ...probably need to rewrite existing code to get rid of fgets(), > use poll() + read(). > From 3d70e006affde33a9b278b2a62c81d4eb40f2394 Mon Sep 17 00:00:00 2001 From: Martin Lewis Date: Wed, 23 Jan 2019 15:46:16 +0100 Subject: [PATCH 1/2] wget: replace set_alarm

[PATCH v2 2/2] wget: add support for retries in http requests

2019-01-15 Thread Martin Lewis
Replace die handlers with error returning so download_one_url can retry from the beginning. When retries is 1 (default) the behaviour should be the same as before. v2: updated diff to mind the -o option, prettified help Signed-off-by: Martin Lewis --- networking/wget.c | 125

[PATCH 1/1] wget: don't notify on download begin and end if quiet

2019-01-10 Thread Martin Lewis
When printing notification on download start and end, mistakenly, it didn't respect the quiet option Signed-off-by: Martin Lewis --- networking/wget.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/networking/wget.c b/networking/wget.c index 3a02de6

Re: [PATCH 2/2] wget: notify on download begin and end

2019-01-10 Thread Martin Lewis
Thank you I have noticed that mistakenly the last patch doesn't respect the quiet option, so I'm sending a fix On Fri, 4 Jan 2019 at 18:28, Denys Vlasenko wrote: > On Wed, Dec 26, 2018 at 4:28 PM Martin Lewis > wrote: > > When using -o to file the progress meter is not display

[PATCH 1/2] wget: add -o flag

2018-12-26 Thread Martin Lewis
Signed-off-by: Martin Lewis --- networking/wget.c | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/networking/wget.c b/networking/wget.c index 58a51d9..8da0ce8 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -128,9 +128,10 @@ /* //usage

[PATCH 2/2] wget: notify on download begin and end

2018-12-26 Thread Martin Lewis
When using -o to file the progress meter is not displayed, so write that we started the download and that we finished it. Signed-off-by: Martin Lewis --- networking/wget.c | 8 1 file changed, 8 insertions(+) diff --git a/networking/wget.c b/networking/wget.c index 8da0ce8..914221c

Re: [PATCH 2/2] wget: add support for retries in http requests

2018-12-12 Thread Martin Lewis
Hello, These patches add the -t (--tries) option to wget. There was an issue that wget died on errors, so I had to change some functions to return error so we are able to retry. Also I had to replace the blocking functions (and the set_alarm) with time outing functions (in first patch). In order

[PATCH 2/2] wget: add support for retries in http requests

2018-12-12 Thread Martin Lewis
Replace die handlers with error returning so download_one_url can retry from the beginning. When retries is 1 (default) the behaviour should be the same as before. Signed-off-by: Martin Lewis --- networking/wget.c | 120 ++ 1 file changed, 95

[PATCH 1/2] wget: replace set_alarm with non blocking functions to support retries

2018-12-12 Thread Martin Lewis
Signed-off-by: Martin Lewis --- networking/wget.c | 162 +++--- 1 file changed, 153 insertions(+), 9 deletions(-) diff --git a/networking/wget.c b/networking/wget.c index 58a51d9..e9fdd9f 100644 --- a/networking/wget.c +++ b/networking/wget.c