| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

udhcpc

Page history last edited by PBworks 15 years, 12 months ago

udhcpc

Version: 0.9.7

Status: ???



 

Description

A small DHCP client.

 

As discovered by Gadgetmind, the udhcpc implementation provided in MG35 calls hardcoded "scripts" for DHCP events. Only "deconfig" and "bound" events are processed in script.c:

 

deconfig: 
/bin/busybox ifconfig eth0 0.0.0.0

bound:
/bin/busybox ifconfig eth0 %new_ip_address broadcast %new_bcast_address netmask %new_netmask
/bin/busybox route del default gw 0.0.0.0 dev eth0
/bin/busybox route add default gw %new_gateway dev eth0

 

History

[Gadgetmind, 2005???]

Al Tek have hacked udhcpc so that rather than calling a script/program for dhcp events, it directly involves "/bin/busybox ifconfig" and "/bin/busybox route" with various options. This is deeply nasty. What's worse is that it also writes some values directly to memory for dvdplayer.bin to find. Yak! Anyway, bodges have been added to bodges, and the new udhcpc is now in firmware 1.4.4.5-alpha2 onwards. The main change is that /etc/resolv.conf now contains the information required for name lookups to work.

 

[VasileB, 2008-04-13]

Note: unfortunately, Gadgetmind's changes are lost :-(

 

[VasileB, 2008-04-28]

John added the processing of DNS returned by DHCP server, and it seems to work OK. It is more verbose than the original, but this can be useful for debugging.

 

Comments

 

(John) I've re-added the resolv.conf stuff, but do we have any more info on the global config writing for dvdplayer? Does it just update the ip/nm/gw? router?

(VasileB) Joe found Gadgetmind's comments about udhcpc-dvdplayer "communication":

 

I started marking the function of blocks, working through from the main state machines, through the scummy script.c stuff that directly invoked ifconfig/route and writes to smb.conf and then back out of the exit code.

 

Where I knew what something did, I documented it. The mystery bits had to be the "secret sauce" that tells dvdplayer.bin that the network is up.

 

I finally found it! I have currently not bothered working out the subnet mask size so I can write /24 /16 or whatever to smb.conf. The Al Tech code does this but the code looked convoluted and also used the IP, which didn't make sense.

 

I finally found (deep inside 70 pages of O2 optimised arm assembler) that the code writes the IP to address 0x1FFF208 and the subnet mask to 0x1FFF20C as part of the shifting swapping and twiddling. However, it does it by dereferencing a pointer stored in memory and adding offsets, so it really wasn't obvious.


Comments (0)

You don't have permission to comment on this page.