Changes in uspace/srv/net/dhcp/dhcp.c [78192cc7:053fc2b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/dhcp/dhcp.c
r78192cc7 r053fc2b 418 418 } 419 419 420 static int dhcp_discover_proc(dhcp_link_t *dlink) 421 { 422 dlink->state = ds_selecting; 423 424 int rc = dhcp_send_discover(dlink); 425 if (rc != EOK) 426 return EIO; 427 428 dlink->retries_left = dhcp_discover_retries; 429 430 if(dlink->timeout->state == fts_not_set || 431 dlink->timeout->state == fts_fired) { 432 fibril_timer_set(dlink->timeout, dhcp_discover_timeout_val, 433 dhcpsrv_discover_timeout, dlink); 434 } 435 436 return rc; 437 } 438 420 439 int dhcpsrv_link_add(service_id_t link_id) 421 440 { … … 459 478 } 460 479 461 dlink->state = ds_selecting;462 463 480 log_msg(LOG_DEFAULT, LVL_DEBUG, "Send DHCPDISCOVER"); 464 rc = dhcp_ send_discover(dlink);481 rc = dhcp_discover_proc(dlink); 465 482 if (rc != EOK) { 466 483 log_msg(LOG_DEFAULT, LVL_ERROR, "Error sending DHCPDISCOVER."); … … 469 486 goto error; 470 487 } 471 472 dlink->retries_left = dhcp_discover_retries;473 fibril_timer_set(dlink->timeout, dhcp_discover_timeout_val,474 dhcpsrv_discover_timeout, dlink);475 488 476 489 list_append(&dlink->links, &dhcp_links); … … 487 500 { 488 501 return ENOTSUP; 502 } 503 504 int dhcpsrv_discover(service_id_t link_id) 505 { 506 log_msg(LOG_DEFAULT, LVL_DEBUG, "dhcpsrv_link_add(%zu)", link_id); 507 508 dhcp_link_t *dlink = dhcpsrv_link_find(link_id); 509 510 if (dlink == NULL) { 511 log_msg(LOG_DEFAULT, LVL_NOTE, "Link %zu doesn't exist", 512 link_id); 513 return EINVAL; 514 } 515 516 return dhcp_discover_proc(dlink); 489 517 } 490 518
Note:
See TracChangeset
for help on using the changeset viewer.