Ignore:
File:
1 edited

Legend:

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

    rfafb8e5 r1bbc6dc  
    11/*
    2  * Copyright (c) 2013 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3838#include <str_error.h>
    3939#include <io/log.h>
    40 #include <inet/inetcfg.h>
    4140#include <ipc/dhcp.h>
    4241#include <ipc/services.h>
     
    5453static errno_t dhcp_init(void)
    5554{
     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 
    6862        async_set_fallback_port_handler(dhcp_client_conn, NULL);
    6963
    70         rc = loc_server_register(NAME);
     64        rc = loc_server_register(NAME, &srv);
    7165        if (rc != EOK) {
    7266                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering server: %s.", str_error(rc));
     
    7569
    7670        service_id_t sid;
    77         rc = loc_service_register(SERVICE_NAME_DHCP, &sid);
     71        rc = loc_service_register(srv, SERVICE_NAME_DHCP, &sid);
    7872        if (rc != EOK) {
     73                loc_server_unregister(srv);
    7974                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service: %s.", str_error(rc));
    8075                return EEXIST;
Note: See TracChangeset for help on using the changeset viewer.