[PATCH] udhcpc: raw socket cleanup
Denys Vlasenko
vda.linux at googlemail.com
Mon Nov 15 01:04:21 UTC 2010
On Sunday 14 November 2010 22:45, Vladislav Grishenko wrote:
> Hi all, proposed udhcpc patch attached
> Targets:
> 1. Remove dependence from predefined server and client ports
You mean "use socket filter even if SERVER_PORT != 67 or CLIENT_PORT != 68"?
If yes, this does not seem to be a typical use case.
> 2. Drop ARP packets socket filter pass as redundant feature from dhcpclient
I don't understand this part.
> 3. Drop fragments 'coz due L4 header absents
I don't understand this part either.
Looks like you are changing BPF_foo magic. I am not familiar with it.
Can you explain what is changed, and why?
> 4. Attach socket filter after bind to prevent possible kernel-dependent
> leaks
I don't understand this part too. If it is really important to attach
filter after bond, then it makes sense to add a comment which explains why.
> function old new delta
> change_listen_mode 327 323 -4
> .rodata 136378 136306 -72
> ----------------------------------------------------------------------------
> --
> (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-76) Total: -76
> bytes
- static const struct sock_filter filter_instr[] = {
+ static struct sock_filter filter_instr[] = {
This creates a non-constant object in data section,
which exists and takes space for _every applet_.
I would rather malloc this space if needed.
--
vda
More information about the busybox
mailing list