Changeset 94e46c9 in mainline for uspace/srv/net/dhcp/dhcp.c
- Timestamp:
- 2015-05-23T04:09:11Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b5143bd
- Parents:
- a25d893 (diff), 0683992 (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
ra25d893 r94e46c9 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); … … 489 501 } 490 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); 516 } 517 491 518 static void dhcpsrv_recv_offer(dhcp_link_t *dlink, dhcp_offer_t *offer) 492 519 { … … 534 561 return; 535 562 } 563 564 /* XXX Work around multiple simultaneous sessions issue */ 565 dhcp_transport_fini(&dlink->dt); 536 566 537 567 log_msg(LOG_DEFAULT, LVL_NOTE, "%s: Successfully configured.",
Note:
See TracChangeset
for help on using the changeset viewer.