Changeset 947e2ef in mainline for uspace/srv/net/dhcp/dhcp.c
- Timestamp:
- 2013-09-15T16:28:06Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7af0cc5, b9f7848b
- Parents:
- b8b1adb1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/dhcp/dhcp.c
rb8b1adb1 r947e2ef 53 53 54 54 static int transport_fd = -1; 55 static addr48_t mac_addr;55 static inet_link_info_t link_info; 56 56 static uint8_t msgbuf[MAX_MSG_SIZE]; 57 57 … … 132 132 hdr->flags = flag_broadcast; 133 133 134 addr48( mac_addr, hdr->chaddr);134 addr48(link_info.mac_addr, hdr->chaddr); 135 135 hdr->opt_magic = host2uint32_t_be(dhcp_opt_magic); 136 136 … … 178 178 hdr->flags = flag_broadcast; 179 179 hdr->ciaddr = host2uint32_t_be(offer->oaddr.addr); 180 addr48( mac_addr, hdr->chaddr);180 addr48(link_info.mac_addr, hdr->chaddr); 181 181 hdr->opt_magic = host2uint32_t_be(dhcp_opt_magic); 182 182 … … 387 387 rc = dnsr_set_srvaddr(&offer->dns_server); 388 388 if (rc != EOK) { 389 printf("%s: Failedsetting nameserver address (%d))\n",389 printf("%s: Error setting nameserver address (%d))\n", 390 390 NAME, rc); 391 391 return rc; … … 413 413 rc = inetcfg_init(); 414 414 if (rc != EOK) { 415 printf(" Failedcontacting inet configuration service.\n");415 printf("Error contacting inet configuration service.\n"); 416 416 return 1; 417 417 } … … 419 419 rc = loc_service_get_id(argv[1], &iplink, 0); 420 420 if (rc != EOK) { 421 printf("Failed resolving service '%s'.\n", argv[1]); 422 return 1; 423 } 424 425 /* XXX Determine MAC address automatically */ 426 mac_addr[0] = 0xaa; 427 mac_addr[1] = 0xde; 428 mac_addr[2] = 0xad; 429 mac_addr[3] = 0xbe; 430 mac_addr[4] = 0xef; 431 mac_addr[5] = 0xfe; 421 printf("Error resolving service '%s'.\n", argv[1]); 422 return 1; 423 } 424 425 /* Get link hardware address */ 426 rc = inetcfg_link_get(iplink, &link_info); 427 if (rc != EOK) { 428 printf("Error getting properties for link '%s'.\n", argv[1]); 429 return 1; 430 } 432 431 433 432 laddr.sin_family = AF_INET;
Note:
See TracChangeset
for help on using the changeset viewer.