mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-25 07:49:18 +00:00
Add placeholder code for prepending pathnames to tftp.
At work we have a single tftp server that provides installation data for a variety of operating systems. I'd rather place our FreeBSD-related files in a subdirectory, instead of the root. It would be nice if this setting could be run-time configurable, but at least in our specific case, this is not possible, as pxeboot is chainloaded through pxelinux. Sponsored by: Kumina bv
This commit is contained in:
parent
45d3b226a6
commit
cb301c1a81
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=228798
@ -292,8 +292,15 @@ tftp_makereq(struct tftp_handle *h)
|
||||
wbuf.t.th_opcode = htons((u_short) RRQ);
|
||||
wtail = wbuf.t.th_stuff;
|
||||
l = strlen(h->path);
|
||||
#ifdef TFTP_PREPEND_PATH
|
||||
if (l > FNAME_SIZE - (sizeof(TFTP_PREPEND_PATH) - 1))
|
||||
return (ENAMETOOLONG);
|
||||
bcopy(TFTP_PREPEND_PATH, wtail, sizeof(TFTP_PREPEND_PATH) - 1);
|
||||
wtail += sizeof(TFTP_PREPEND_PATH) - 1;
|
||||
#else
|
||||
if (l > FNAME_SIZE)
|
||||
return (ENAMETOOLONG);
|
||||
#endif
|
||||
bcopy(h->path, wtail, l + 1);
|
||||
wtail += l + 1;
|
||||
bcopy("octet", wtail, 6);
|
||||
|
Loading…
Reference in New Issue
Block a user