Changeset bd88bee in mainline for uspace/srv/net/nconfsrv/iplink.c


Ignore:
Timestamp:
2013-09-21T22:51:06Z (11 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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.