ip/dhcpd: work around raspberry pi pxe firmware by providing dhcp option 66
The raspberry pi 4 PXE firmware insists on finding the tftp server address by parsing dhcp option 66 as an ip address string.
This commit is contained in:
parent
d9bf5d074d
commit
a89bee7373
1 changed files with 16 additions and 2 deletions
|
@ -1136,8 +1136,7 @@ miscoptions(Req *rp, uchar *ip)
|
||||||
uchar *addrs[8];
|
uchar *addrs[8];
|
||||||
uchar *op, *omax;
|
uchar *op, *omax;
|
||||||
uchar x[nelem(addrs)*IPaddrlen], vopts[Maxoptlen];
|
uchar x[nelem(addrs)*IPaddrlen], vopts[Maxoptlen];
|
||||||
char *p;
|
char ip4str[16], *p, *attr[100], **a;
|
||||||
char *attr[100], **a;
|
|
||||||
Ndbtuple *t;
|
Ndbtuple *t;
|
||||||
Iplifc *lifc;
|
Iplifc *lifc;
|
||||||
|
|
||||||
|
@ -1279,6 +1278,21 @@ miscoptions(Req *rp, uchar *ip)
|
||||||
case OBttl:
|
case OBttl:
|
||||||
byteopt(rp, OBttl, 255);
|
byteopt(rp, OBttl, 255);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ODtftpserver:
|
||||||
|
/*
|
||||||
|
* This option actually should contain a hostname, BUT:
|
||||||
|
* It appears that Rpi4 PXE firmware ignores the siaddr
|
||||||
|
* and instead insists on this (DHCP option 66) to contain
|
||||||
|
* the IP address string of the TFTP server.
|
||||||
|
*/
|
||||||
|
snprint(ip4str, sizeof(ip4str), "%V", rp->bp->siaddr);
|
||||||
|
stringopt(rp, ODtftpserver, ip4str);
|
||||||
|
break;
|
||||||
|
case ODbootfile:
|
||||||
|
if(*rp->bp->file)
|
||||||
|
stringopt(rp, ODbootfile, rp->bp->file);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*rp->vendorclass != '\0') {
|
if (*rp->vendorclass != '\0') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue