package: busybox
version: 1.37.0

when I using udhcpd  for a wifi ap,it sends mac broadcast packets in a 
DHCP OFFER message.This confused me.


In rfc2131:
---------------------------------------------------------------------------
" If ??giaddr?? is zero and ??ciaddr?? is zero, and the broadcast bit is
set, then the server broadcasts DHCPOFFER and DHCPACK messages to
0xffffffff. If the broadcast bit is not set and ??giaddr?? is zero and
??ciaddr?? is zero, then the server unicasts DHCPOFFER and DHCPACK
messages to the client??s hardware address and ??yiaddr?? address.
"
----------------------------------------------------------------------------


If the code in dhcpd.c should be


-----------------------------------------------------------
"
static void send_packet_to_client(struct dhcp_packet *dhcp_pkt, int 
force_broadcast)
{
        ...
        if (force_broadcast
         // || (dhcp_pkt->flags & htons(BROADCAST_FLAG))
         // || dhcp_pkt->ciaddr == 0
         || ((dhcp_pkt->flags & 
htons(BROADCAST_FLAG))
         && dhcp_pkt->ciaddr == 0)

        ...
}" ?
----------------------------------------------------------------------


Not "||" but "&&" ,because the rfc2131 says "If the broadcast bit is 
not set and ??giaddr?? is zero and
??ciaddr?? is zero, then the server unicasts DHCPOFFER and DHCPACK
messages to the client??s hardware address and ??yiaddr?? address."


Udhcpd works wrong in my ARM board because wifi driver or kernel configs may 
not  support mac broadcast packets(I don't know why),so I report this bug.


By the way, other dhcp server implementations, isc-dhcp and dnsmasq DHCP OFFER 
messages all send mac unicast packets.
_______________________________________________
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to