Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/dhcp/main.c

    r1bbc6dc rfafb8e5  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2013 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3838#include <str_error.h>
    3939#include <io/log.h>
     40#include <inet/inetcfg.h>
    4041#include <ipc/dhcp.h>
    4142#include <ipc/services.h>
     
    5354static errno_t dhcp_init(void)
    5455{
    55         loc_srv_t *srv;
    5656        errno_t rc;
    5757
     
    6060        dhcpsrv_links_init();
    6161
     62        rc = inetcfg_init();
     63        if (rc != EOK) {
     64                log_msg(LOG_DEFAULT, LVL_ERROR, "Error contacting inet configuration service.\n");
     65                return EIO;
     66        }
     67
    6268        async_set_fallback_port_handler(dhcp_client_conn, NULL);
    6369
    64         rc = loc_server_register(NAME, &srv);
     70        rc = loc_server_register(NAME);
    6571        if (rc != EOK) {
    6672                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering server: %s.", str_error(rc));
     
    6975
    7076        service_id_t sid;
    71         rc = loc_service_register(srv, SERVICE_NAME_DHCP, &sid);
     77        rc = loc_service_register(SERVICE_NAME_DHCP, &sid);
    7278        if (rc != EOK) {
    73                 loc_server_unregister(srv);
    7479                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service: %s.", str_error(rc));
    7580                return EEXIST;
Note: See TracChangeset for help on using the changeset viewer.