diff options
author | insomniac <insomniacslk@users.noreply.github.com> | 2018-11-19 22:44:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-19 22:44:28 +0000 |
commit | ea6c3e1bdb7e29e3c0653bfcb50f6ba88a822031 (patch) | |
tree | 7f93f13ad0f344857d5c4ef81aa1de5fc5d979c6 /netboot | |
parent | fe5756cfd7b9ff86307c33e3729ba07da7645e78 (diff) |
dhcpv4: run on unconfigured interfaces (#198)
Diffstat (limited to 'netboot')
-rw-r--r-- | netboot/netconf.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/netboot/netconf.go b/netboot/netconf.go index bf0274e..3cc5232 100644 --- a/netboot/netconf.go +++ b/netboot/netconf.go @@ -208,7 +208,9 @@ func ConfigureInterface(ifname string, netconf *NetConf) error { for _, ns := range netconf.DNSServers { resolvconf += fmt.Sprintf("nameserver %s\n", ns) } - resolvconf += fmt.Sprintf("search %s\n", strings.Join(netconf.DNSSearchList, " ")) + if len(netconf.DNSSearchList) > 0 { + resolvconf += fmt.Sprintf("search %s\n", strings.Join(netconf.DNSSearchList, " ")) + } if err = ioutil.WriteFile("/etc/resolv.conf", []byte(resolvconf), 0644); err != nil { return fmt.Errorf("could not write resolv.conf file %v", err) } |