ucmd_dhcp.c 354 B

12345678910111213141516
  1. /* dhcp: ring-3 command. Re-run the DHCP client; dhcp.c prints the exchange. */
  2. #include "ucmd_lib.h"
  3. void _start(const char *arg)
  4. {
  5. int r;
  6. (void)arg;
  7. r = u_syscall1(SYS_DHCP_RUN, 4000);
  8. if (r == -2)
  9. u_puts("dhcp: no NIC\n");
  10. /* r == 0: dhcp_run() printed the lease; r == -1: it printed its own
  11. * failure line. */
  12. u_exit(r == 0 ? 0 : 1);
  13. }