<div dir="ltr">Hi Rob,<div><br></div><div>Unsetting the broadcast bit does not mean sending unicast discover.</div><div>The discover (and request) from the client is still broadcast. Only the</div><div>offer and ack responses from the server becomes unicast. The client</div><div>is still able to recognize the responses from its L2 address.</div><div><br></div><div>I tested this with dhcpd (not toybox's dhcpd though) and it worked quite well.</div><div>It also solved our pain points because somehow in some of our environments,</div><div>the broadcast server responses cannot be relayed. Only unicast can do.<br><br>The code is sync'ed to our internal codebase three weeks ago.<br></div><div>I guess the external one is not updated yet.</div><div><br></div><div>Zikai</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Oct 2, 2025 at 6:43 AM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 9/3/25 10:56, Zikai Chen wrote:<br>
> Hi,<br>
> <br>
> I'm using the dhcp client in Android, and I need the functionality that the<br>
> dhcp client can trigger unicast dhcp offer/ack from the server, so I added<br>
> a new option to the dhcp client.<br>
<br>
I'm trying to put together a release so I'm reviewing the commits since <br>
last time, and... how does this work?<br>
<br>
@@ -996,7 +999,7 @@ static int dhcpc_sendmsg(int msgtype)<br>
// Handle the message specific settings<br>
switch (msgtype) {<br>
case DHCPDISCOVER: // Broadcast DISCOVER message to all servers<br>
- state->pdhcp.flags = htons(BOOTP_BROADCAST); // Broadcast bit.<br>
+ state->pdhcp.flags = htons(broadcast_bit);<br>
if (toys.optflags & FLAG_r) {<br>
inet_aton(TT.req_ip, &rqsd);<br>
pend = dhcpc_addreqipaddr(&rqsd, pend);<br>
<br>
If your discover doesn't have the broadcast bit set, how does it know <br>
where the dhcp server lives?<br>
<br>
Presumably the server is sending a packet back via ethernet address <br>
(does toybox's dhcpd know how to do that?) but how did the request get <br>
to the dhcp server in the first place if it wasn't broadcast?<br>
<br>
Did you test this? Does it work for you? (Nothing on <br>
<a href="https://android.googlesource.com/platform/external/toybox/" rel="noreferrer" target="_blank">https://android.googlesource.com/platform/external/toybox/</a> has been <br>
updated in the past 6 months.)<br>
<br>
Rob<br>
</blockquote></div>