Changeset ee20e8a in mainline for uspace/srv/net/dhcp/dhcp.c
- Timestamp:
- 2013-09-24T21:27:59Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c6bf6be
- Parents:
- 1b0602a3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/dhcp/dhcp.c
r1b0602a3 ree20e8a 418 418 } 419 419 420 static void dhcp_link_set_failed(dhcp_link_t *dlink) 421 { 422 log_msg(LOG_DEFAULT, LVL_NOTE, "Giving up on link %s", 423 dlink->link_info.name); 424 dlink->state = ds_fail; 425 } 426 420 427 int dhcpsrv_link_add(service_id_t link_id) 421 428 { … … 464 471 rc = dhcp_send_discover(dlink); 465 472 if (rc != EOK) { 466 dlink->state = ds_fail; 473 log_msg(LOG_DEFAULT, LVL_ERROR, "Error sending DHCPDISCOVER."); 474 dhcp_link_set_failed(dlink); 467 475 rc = EIO; 468 476 goto error; … … 533 541 return; 534 542 } 543 544 log_msg(LOG_DEFAULT, LVL_NOTE, "%s: Successfully configured.", 545 dlink->link_info.name); 535 546 } 536 547 … … 541 552 int rc; 542 553 543 log_msg(LOG_DEFAULT, LVL_DEBUG, "dhcpsrv_recv() %zu bytes", size); 554 log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: dhcpsrv_recv() %zu bytes", 555 dlink->link_info.name, size); 544 556 545 557 rc = dhcp_parse_reply(msg, size, &offer); … … 569 581 570 582 assert(dlink->state == ds_selecting); 571 log_msg(LOG_DEFAULT, LVL_NOTE, "dcpsrv_discover_timeout"); 583 log_msg(LOG_DEFAULT, LVL_NOTE, "%s: dcpsrv_discover_timeout", 584 dlink->link_info.name); 572 585 573 586 if (dlink->retries_left == 0) { 574 587 log_msg(LOG_DEFAULT, LVL_NOTE, "Retries exhausted"); 575 d link->state = ds_fail;588 dhcp_link_set_failed(dlink); 576 589 return; 577 590 } … … 582 595 if (rc != EOK) { 583 596 log_msg(LOG_DEFAULT, LVL_ERROR, "Error sending DHCPDISCOVER"); 584 d link->state = ds_fail;597 dhcp_link_set_failed(dlink); 585 598 return; 586 599 } … … 596 609 597 610 assert(dlink->state == ds_requesting); 598 log_msg(LOG_DEFAULT, LVL_NOTE, "dcpsrv_request_timeout"); 611 log_msg(LOG_DEFAULT, LVL_NOTE, "%s: dcpsrv_request_timeout", 612 dlink->link_info.name); 599 613 600 614 if (dlink->retries_left == 0) { 601 615 log_msg(LOG_DEFAULT, LVL_NOTE, "Retries exhausted"); 602 d link->state = ds_fail;616 dhcp_link_set_failed(dlink); 603 617 return; 604 618 } … … 609 623 if (rc != EOK) { 610 624 log_msg(LOG_DEFAULT, LVL_DEBUG, "Error sending request."); 611 d link->state = ds_fail;625 dhcp_link_set_failed(dlink); 612 626 return; 613 627 }
Note:
See TracChangeset
for help on using the changeset viewer.