Changeset bd88bee in mainline for uspace/srv/net/nconfsrv


Ignore:
Timestamp:
2013-09-21T22:51:06Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
66ec63a
Parents:
7af0cc5
Message:

Automatically start DHCP on ethernet links.

Location:
uspace/srv/net/nconfsrv
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/nconfsrv/iplink.c

    r7af0cc5 rbd88bee  
    3838#include <errno.h>
    3939#include <fibril_synch.h>
     40#include <inet/dhcp.h>
    4041#include <inet/inetcfg.h>
    4142#include <io/log.h>
    4243#include <loc.h>
    4344#include <stdlib.h>
     45#include <str.h>
    4446
    4547#include "iplink.h"
     
    139141        }
    140142
     143        log_msg(LOG_DEFAULT, LVL_NOTE, "Configure link %s", nlink->svc_name);
    141144        rc = inetcfg_link_add(sid);
    142145        if (rc != EOK) {
     
    144147                    "'%s'.\n", nlink->svc_name);
    145148                goto error;
     149        }
     150
     151        if (str_lcmp(nlink->svc_name, "net/eth", str_length("net/eth")) == 0) {
     152                rc = dhcp_link_add(sid);
     153                if (rc != EOK) {
     154                        log_msg(LOG_DEFAULT, LVL_ERROR, "Failed configuring DHCP on "
     155                            " link '%s'.\n", nlink->svc_name);
     156                        goto error;
     157                }
    146158        }
    147159
  • uspace/srv/net/nconfsrv/nconfsrv.c

    r7af0cc5 rbd88bee  
    3939#include <errno.h>
    4040#include <fibril_synch.h>
     41#include <inet/dhcp.h>
    4142#include <inet/inetcfg.h>
    4243#include <io/log.h>
     
    6566        if (rc != EOK) {
    6667                log_msg(LOG_DEFAULT, LVL_ERROR, "Error contacting inet "
     68                    "configuration service.");
     69                return EIO;
     70        }
     71
     72        rc = dhcp_init();
     73        if (rc != EOK) {
     74                log_msg(LOG_DEFAULT, LVL_ERROR, "Error contacting dhcp "
    6775                    "configuration service.");
    6876                return EIO;
Note: See TracChangeset for help on using the changeset viewer.