Commit 09e3a67dec72b85dfc5535d2dbe695e9b2bfc4f9

Authored by Luuk Paulussen
Committed by Wolfgang Denk
1 parent 7130a579fd

bootp: add ntpserver option to bootp request

Signed-off-by: Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz>
Acked-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Ben Warren <biggerbadderben@gmail.com>

Showing 1 changed file with 15 additions and 0 deletions Side-by-side Diff

... ... @@ -228,6 +228,11 @@
228 228 NetOurNISDomain[size] = 0;
229 229 }
230 230 break;
  231 +#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
  232 + case 42: /* NTP server IP */
  233 + NetCopyIP(&NetNtpServerIP, (IPaddr_t *) (ext + 2));
  234 + break;
  235 +#endif
231 236 /* Application layer fields */
232 237 case 43: /* Vendor specific info - Not yet supported */
233 238 /*
... ... @@ -278,6 +283,11 @@
278 283  
279 284 if (NetBootFileSize)
280 285 debug("NetBootFileSize: %d\n", NetBootFileSize);
  286 +
  287 +#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
  288 + if (NetNtpServerIP)
  289 + debug("NetNtpServerIP : %pI4\n", &NetNtpServerIP);
  290 +#endif
281 291 }
282 292 /*
283 293 * Handle a BOOTP received packet.
... ... @@ -537,6 +547,11 @@
537 547 *e++ = 40; /* NIS Domain name request */
538 548 *e++ = 32;
539 549 e += 32;
  550 +#endif
  551 +#if defined(CONFIG_BOOTP_NTPSERVER)
  552 + *e++ = 42;
  553 + *e++ = 4;
  554 + e += 4;
540 555 #endif
541 556  
542 557 *e++ = 255; /* End of the list */