For some time now, one of our clients has been asking for DHCP on both
the ethernet interfaces to his system. We're finally getting around to
doing it for him. This e-mail is an inquiry to determine if this
should be done privately, or if it would be of benefit to submit this
as a change to lwIP. I'm also interested to know if anyone has a
better implementation idea.
Background:
All DHCP transmissions go through udp_send. udp_send
determines the netif to use for the output by calling ip_route. In the
case of a broadcast destination, ip_route selects a single default
netif for the transmission (netif_default). This precludes the use of
DHCP on any interface but netif_default.
Proposed solution:
Create a new function in udp.c named udp_send_if. This new
function will have a linkage like udp_send, but with the addition of a
netif parameter. The body of this new function will be virtually
identical to the existing udp_send. The only difference would be that
ip_route would be called only if the incoming netif was NULL. If an
incoming netif is specified, it will be used.
Create a new version of udp_send, either as a macro in the udp header
or as a function in udp.c. The implementation will be a call to
udp_send_if with a NULL netif parameter, thus forcing the use of
ip_route.
Put udp_send_if into udp.h.
Modify DHCP to use udp_send_if in some (or all) of the instances where
it now calls udp_send. At a minimum, udp_send_if would be used for all
broadcasts. It could probably be used everywhere.
--
E-mail signature
Jim Gibbons
|
address@hidden
|
Gibbons and Associates, Inc.
|
TEL: (408) 984-1441
|
900 Lafayette, Suite 704, Santa Clara, CA
|
FAX: (408) 247-6395
|
|