|
Lines 1-30
Link Here
|
| 1 |
commit 2446514e716075cfe2be35e2a9b9de4eacdbac99 |
|
|
| 2 |
Author: Chris Novakovic <chris@chrisn.me.uk> |
| 3 |
Date: Tue Jun 6 23:02:59 2017 +0100 |
| 4 |
|
| 5 |
Fix logic of appending ".<layer>" to PXE basename |
| 6 |
|
| 7 |
Commit f77700aa, which fixes a compiler warning, also breaks the |
| 8 |
behaviour of prepending ".<layer>" to basenames in --pxe-service: in |
| 9 |
situations where the basename contains a ".", the ".<layer>" suffix is |
| 10 |
erroneously added, and in situations where the basename doesn't contain |
| 11 |
a ".", the ".<layer>" suffix is erroneously omitted. |
| 12 |
|
| 13 |
A patch against the git HEAD is attached that inverts this logic and |
| 14 |
restores the expected behaviour of --pxe-service. |
| 15 |
|
| 16 |
--- src/rfc2131.c.orig 2017-05-22 21:58:46 UTC |
| 17 |
+++ src/rfc2131.c |
| 18 |
@@ -836,10 +836,10 @@ size_t dhcp_reply(struct dhcp_context *c |
| 19 |
|
| 20 |
if (strchr(service->basename, '.')) |
| 21 |
snprintf((char *)mess->file, sizeof(mess->file), |
| 22 |
- "%s.%d", service->basename, layer); |
| 23 |
+ "%s", service->basename); |
| 24 |
else |
| 25 |
snprintf((char *)mess->file, sizeof(mess->file), |
| 26 |
- "%s", service->basename); |
| 27 |
+ "%s.%d", service->basename, layer); |
| 28 |
|
| 29 |
option_put(mess, end, OPTION_MESSAGE_TYPE, 1, DHCPACK); |
| 30 |
option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, htonl(context->local.s_addr)); |