Commit 518f9e39 authored by jan.koester's avatar jan.koester
Browse files

test

parent d2f8345a
Loading
Loading
Loading
Loading
+4 −1
Changes for src/network.cpp: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -253,8 +253,11 @@ std::vector<std::string> NetworkManager::enumInterfaces() {

// The first configuration matching ifname, in file-name order across both
// directories (systemd-networkd semantics: the first match wins, so a
// specific 10-eth0.network beats the catch-all 80-dhcp.network)
// specific 10-eth0.network beats the catch-all 80-dhcp.network). Never
// for the loopback, which syslite sets up itself (127.0.0.1/8): a
// catch-all Name=* would otherwise put DHCP on it.
const NetworkConfig *NetworkManager::configFor(const std::string &ifname) const {
    if (ifname == "lo") return nullptr;
    for (auto &cfg : _configs)
        if (const_cast<NetworkManager *>(this)->matchInterface(cfg.matchName, ifname))
            return &cfg;