The branch main has been updated by mav:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f4860c31b6eff06161a35a720423bb22d012fd03

commit f4860c31b6eff06161a35a720423bb22d012fd03
Author:     Alexander Motin <[email protected]>
AuthorDate: 2026-07-31 01:26:23 +0000
Commit:     Alexander Motin <[email protected]>
CommitDate: 2026-07-31 01:35:29 +0000

    stand: Bump DHCP xid between transactions
    
    Transaction ID should persist only between OFFER and the following
    REQUEST.  In all other cases it should change.
---
 stand/libsa/bootp.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/stand/libsa/bootp.c b/stand/libsa/bootp.c
index 5143bc91ff08..51f463d55521 100644
--- a/stand/libsa/bootp.c
+++ b/stand/libsa/bootp.c
@@ -172,7 +172,12 @@ restart:
            bootp_response->bp_yiaddr.s_addr != INADDR_ANY) {
                init_reboot = true;
                rbootp = bootp_response;
-               d->xid = ntohl(rbootp->bp_xid);
+               /*
+                * INIT-REBOOT is a new DHCP transaction, distinct from
+                * the firmware's cached DISCOVER/OFFER/REQUEST/ACK.
+                * Use the firmware's xid just as an entropy source.
+                */
+               d->xid = ntohl(rbootp->bp_xid) + 1;
                DEBUG_PRINTF(1, ("bootp: using cached DHCP reply "
                    "(INIT-REBOOT), yiaddr=%s xid=0x%08x\n",
                    inet_ntoa(rbootp->bp_yiaddr), (unsigned)d->xid));
@@ -259,6 +264,7 @@ restart:
                                bootp_response = NULL;
                                bootp_response_size = 0;
                                init_reboot = false;
+                               ++d->xid;
                                if (pkt != NULL) {
                                        free(pkt);
                                        pkt = NULL;

Reply via email to