Changeset bf1733d3 in mainline for uspace/srv/net/dhcp/dhcp.c
- Timestamp:
- 2015-04-27T20:24:41Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2b5d966
- Parents:
- c1fd281 (diff), dcba819 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/dhcp/dhcp.c
rc1fd281 rbf1733d3 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 return rc; 436 } 437 420 438 int dhcpsrv_link_add(service_id_t link_id) 421 439 { … … 459 477 } 460 478 461 dlink->state = ds_selecting;462 463 479 log_msg(LOG_DEFAULT, LVL_DEBUG, "Send DHCPDISCOVER"); 464 rc = dhcp_ send_discover(dlink);480 rc = dhcp_discover_proc(dlink); 465 481 if (rc != EOK) { 466 482 log_msg(LOG_DEFAULT, LVL_ERROR, "Error sending DHCPDISCOVER."); … … 469 485 goto error; 470 486 } 471 472 dlink->retries_left = dhcp_discover_retries;473 fibril_timer_set(dlink->timeout, dhcp_discover_timeout_val,474 dhcpsrv_discover_timeout, dlink);475 487 476 488 list_append(&dlink->links, &dhcp_links); … … 487 499 { 488 500 return ENOTSUP; 501 } 502 503 int dhcpsrv_discover(service_id_t link_id) 504 { 505 log_msg(LOG_DEFAULT, LVL_DEBUG, "dhcpsrv_link_add(%zu)", link_id); 506 507 dhcp_link_t *dlink = dhcpsrv_link_find(link_id); 508 509 if (dlink == NULL) { 510 log_msg(LOG_DEFAULT, LVL_NOTE, "Link %zu doesn't exist", 511 link_id); 512 return EINVAL; 513 } 514 515 return dhcp_discover_proc(dlink); 489 516 } 490 517
Note:
See TracChangeset
for help on using the changeset viewer.