udhcpc eating too much cpu

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Sun Jan 13 21:11:46 UTC 2008


The problem is described here too:

  http://archives.devshed.com/forums/networking-100/dhclient-raw-socket-2147170.html

We noticed that too (corner cases).  udhcpc eats up to 30% cpu.
That happens after DISCOVER while waiting for OFFER.  udhcpc is looking
through every udp package.

I also learned (from one of my collegues) that a LPF/BPF filter will most
likely help.  I used tcpdump to generate such a filter, like:

  # tcpdump -dd udp and src port 67 and dst port 68
  { 0x28, 0, 0, 0x0000000c },
  { 0x15, 0, 6, 0x000086dd },
  { 0x30, 0, 0, 0x00000014 },
  { 0x15, 0, 15, 0x00000011 },
  { 0x28, 0, 0, 0x00000036 },
  { 0x15, 0, 13, 0x00000043 },
  { 0x28, 0, 0, 0x00000038 },
  { 0x15, 10, 11, 0x00000044 },
  { 0x15, 0, 10, 0x00000800 },
  { 0x30, 0, 0, 0x00000017 },
  { 0x15, 0, 8, 0x00000011 },
  { 0x28, 0, 0, 0x00000014 },
  { 0x45, 6, 0, 0x00001fff },
  { 0xb1, 0, 0, 0x0000000e },
  { 0x48, 0, 0, 0x0000000e },
  { 0x15, 0, 3, 0x00000043 },
  { 0x48, 0, 0, 0x00000010 },
  { 0x15, 0, 1, 0x00000044 },
  { 0x6, 0, 0, 0x00000060 },
  { 0x6, 0, 0, 0x00000000 },

There's an article here:

  http://www.dr-linux.net/newbase/reference/linuxman/lsf/article.htm

and a programming example:

  ftp://ftp.ssc.com/pub/lj/listings/issue86/4659.tgz

which gives an idea on how it could be done. I intend to try that during
the comming weeks, if noone else beats me to it ;)


Cheers,

-- 
Cristian



More information about the busybox mailing list