diff options
author | Loïc Minier <loic.minier@linaro.org> | 2011-08-17 15:32:55 +0200 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-08-17 08:49:17 -0600 |
commit | 8ed2c44f563f03ecfe0999dd475e51a574cd93e0 (patch) | |
tree | abf236cae74bddadbfb35fe7c5a4a5754dec26c4 | |
parent | a58e8d4f602f7024d6ae464febbfc479f9f64e59 (diff) |
pxecfg: Prefix MAC-based requests with "01-"2011.08.1
pxelinux will prefix per MAC-address requests with the MAC type prefix
which is "01-" for Ethernet, so do this in pxecfg as well.
Cc: patches@linaro.org
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
-rw-r--r-- | common/cmd_pxecfg.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/common/cmd_pxecfg.c b/common/cmd_pxecfg.c index 694a212ee..84b0d2507 100644 --- a/common/cmd_pxecfg.c +++ b/common/cmd_pxecfg.c @@ -55,12 +55,17 @@ static void format_mac_pxecfg(char **outbuf) if (!ethaddr) return; - *outbuf = strdup(ethaddr); + /* "01-" MAC type prefix, dash-separated MAC address, zero */ + *outbuf = malloc(3 + strlen(ethaddr) + 1); if (*outbuf == NULL) return; - for (p = *outbuf; *p; p++) { + /* MAC type 1; ideally should be read from the DHCP/BOOTP reply packet, + * but in practice always 1 for Ethernet */ + sprintf(*outbuf, "01-%s", ethaddr); + + for (p = *outbuf + 3; *p; p++) { if (*p == ':') *p = '-'; } |