diff options
author | Denys Vlasenko | 2021-09-02 16:23:24 +0200 |
---|---|---|
committer | Denys Vlasenko | 2021-09-02 16:24:52 +0200 |
commit | 3f2d969db9023e273a327418b32ebd4ed88893c4 (patch) | |
tree | 8796e8dc29994a8b6de62f23d6fef89e4a8abf0c /networking/udhcp/dhcpd.c | |
parent | 62d0c8e02872d444ba20b4bdf638ac26c509a3dd (diff) | |
download | busybox-3f2d969db9023e273a327418b32ebd4ed88893c4.zip busybox-3f2d969db9023e273a327418b32ebd4ed88893c4.tar.gz |
udhcp: clarify aspects of relay operation, add TODOs and FIXMEs, tweak --help
function old new delta
packed_usage 33891 33920 +29
dhcprelay_main 943 926 -17
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 29/-17) Total: 12 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r-- | networking/udhcp/dhcpd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index b67dfc3..0f5edb7 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c @@ -614,6 +614,10 @@ static void send_packet_to_relay(struct dhcp_packet *dhcp_pkt) udhcp_send_kernel_packet(dhcp_pkt, server_data.server_nip, SERVER_PORT, dhcp_pkt->gateway_nip, SERVER_PORT, + /* Yes, relay agents receive (and send) all their packets on SERVER_PORT, + * even those which are clients' requests and would normally + * (i.e. without relay) use CLIENT_PORT. See RFC 1542. + */ server_data.interface); } @@ -1025,6 +1029,9 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) * socket read inside this call is restarted on caught signals. */ bytes = udhcp_recv_kernel_packet(&packet, server_socket); +//NB: we do not check source port here. Should we? +//It should be CLIENT_PORT for clients, +//or SERVER_PORT for relay agents (in which case giaddr must be != 0.0.0.0) if (bytes < 0) { /* bytes can also be -2 ("bad packet data") */ if (bytes == -1 && errno != EINTR) { |