Mercurial > hg > dhcpcd
changeset 5009:0f76dcb791a4 draft
DHCP: redirect message to other interfaces if received for inactive
This is unlikely but possible if you have a manual subnet route
via another interface you normally receive a DHCP address inside
this subnet.
Saves spamming the log that we received for an inactive interface
as well.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Sun, 26 Jan 2020 16:44:40 +0000 |
| parents | 28209b094c6c |
| children | ec0c1c259be4 |
| files | src/dhcp.c |
| diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dhcp.c Sun Jan 26 15:58:51 2020 +0000 +++ b/src/dhcp.c Sun Jan 26 16:44:40 2020 +0000 @@ -2898,6 +2898,8 @@ xid = ntohl(bootp->xid); TAILQ_FOREACH(ifn, ifp->ctx->ifaces, next) { + if (ifn == ifp) + continue; state = D_CSTATE(ifn); if (state == NULL || state->state == DHS_NONE) continue; @@ -3548,8 +3550,9 @@ } state = D_CSTATE(ifp); if (state == NULL) { - logdebugx("%s: received BOOTP for inactive interface", - ifp->name); + /* Try re-directing it to another interface. */ + dhcp_redirect_dhcp(ifp, (struct bootp *)iov->iov_base, + iov->iov_len, &from->sin_addr); return; }
