networkd-wait-online-link.c revision d243773263630f1cbc5868a12476b17c335abec8
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2014 Lennart Poettering
Copyright 2014 Tom Gundersen
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "sd-network.h"
#include "strv.h"
#include "networkd-wait-online-link.h"
int r;
assert(m);
if (r < 0)
return r;
r = hashmap_ensure_allocated(&m->links_by_name,
if (r < 0)
return r;
if (!l)
return -ENOMEM;
l->manager = m;
if (!l->ifname)
return -ENOMEM;
if (r < 0)
return r;
if (r < 0)
return r;
if (ret)
*ret = l;
l = NULL;
return 0;
}
if (!l)
return NULL;
if (l->manager) {
}
free(l);
return NULL;
}
const char *ifname;
int r;
assert(l);
assert(m);
r = sd_rtnl_message_link_get_flags(m, &l->flags);
if (r < 0)
return r;
if (r < 0)
return r;
char *new_ifname;
if (!new_ifname)
return -ENOMEM;
l->ifname = new_ifname;
if (r < 0)
return r;
}
return 0;
}
int link_update_monitor(Link *l) {
assert(l);
free(l->operational_state);
l->operational_state = NULL;
return 0;
}
bool link_relevant(Link *l) {
assert(l);
if (l->flags & IFF_LOOPBACK)
return false;
return true;
}