[PATCH] Support for the LOWER_UP flag
Natanael Copa
natanael.copa at gmail.com
Thu Jun 5 07:54:44 PDT 2008
On Thu, 2008-06-05 at 15:58 +0200, Denys Vlasenko wrote:
> On Wednesday 04 June 2008 20:29, Natanael Copa wrote:
> > Hi,
> >
> > Attatched is a patch for the LOWER_UP flag in 'ip link/addr' output.
> > Useful to check if network cable is inserted or not.
> >
> > The code does an ugly ifdef to check if IFF_LOWER_UP is declared or not.
> > On my zenwalk desktop it was not. It looks like iproute2 maintain their
> > own copies of the linux headers so I suppose we cannot expect the flag
> > be there. (should mabe be in one of the include files rather than in the
> > .c file?)
> >
> > The patch does increase the size a bit due to a macro. Maybe should have
> > a config option for it?
> >
> > on my hardened uclibc i386 build:
> >
> > function old new delta
> > ipaddr_list_or_flush 2929 2981 +52
> > .rodata 7677 7683 +6
> > ------------------------------------------------------------------------------
> > (add/remove: 0/0 grow/shrink: 2/0 up/down: 58/0) Total: 58
> > bytes
> > text data bss dec hex filename
> > 47498 670 4244 52412 ccbc busybox_old
> > 47556 670 4244 52470 ccf6 busybox_unstripped
>
> Applied, thanks. (It also brought my attention to ~300+ bytes
> of bloat nearby, which I removed).
oh.... I guess we were working on the same thing then.
I'm attatching what I was looking at. I guess it does not apply anymore.
# make bloatcheck
function old new delta
hdparm_main 1067 4916 +3849
print_flags - 135 +135
static.ultra_modes2 - 88 +88
static.dma_mword_modes - 72 +72
static.dma_1word_modes - 72 +72
static.ms - 64 +64
static.ultra_modes1 - 56 +56
static.pm - 32 +32
static.pio_modes - 32 +32
static.dflags - 32 +32
.rodata 31778 31768 -10
xbsd_print_disklabel 927 892 -35
arp_main 2474 2439 -35
ipaddr_list_or_flush 2687 2455 -232
process_dev 4446 - -4446
------------------------------------------------------------------------------
(add/remove: 9/1 grow/shrink: 1/4 up/down: 4432/-4758) Total: -326
bytes
text data bss dec hex filename
135105 2173 4500 141778 229d2 busybox_old
134715 2709 4500 141924 22a64 busybox_unstripped
> --
> vda
-nc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libbb-print_flags.patch
Type: text/x-patch
Size: 9103 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20080605/5d48bebb/attachment.bin
More information about the busybox
mailing list