Bernhard Fischer
Wed, 04 Jun 2008 13:07:37 -0700
On Wed, Jun 04, 2008 at 08:29:56PM +0200, 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?
no config, no.
I was about to apply it but looking at the macro i'd be curious if we
have more occurances of the
if (foo & flag)
emit(#flag)
pattern so we should provide something like the reversed form of
index_in_strings() like string_in_index(int state) that emits the
corresponding string?
Could you try that and convert some users to that scheme? I'd be
surprised if this would not be an overall win.
>
> 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
>
> -nc
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox