Lines Matching refs:link

96         Link *link;
102 HASHMAP_FOREACH(link, m->links, i) {
103 r = link_carrier_reset(link);
105 log_link_warning_errno(link, r, "Could not reset carrier: %m");
171 r = sd_bus_add_fallback_vtable(m->bus, NULL, "/org/freedesktop/network1/link", "org.freedesktop.network1.Link", link_vtable, link_object_find, m);
173 return log_error_errno(r, "Failed to add link object vtable: %m");
175 r = sd_bus_add_node_enumerator(m->bus, NULL, "/org/freedesktop/network1/link", link_node_enumerator, m);
177 return log_error_errno(r, "Failed to add link enumerator: %m");
199 Link *link = NULL;
214 r = link_get(m, ifindex, &link);
220 r = link_initialized(link, device);
284 Link *link = NULL;
326 r = link_get(m, ifindex, &link);
327 if (r < 0 || !link) {
331 log_warning("rtnl: received route for nonexistent link (%d), ignoring", ifindex);
338 log_link_warning(link, "rtnl: received address with invalid family, ignoring.");
352 log_link_warning_errno(link, r, "rtnl: received route without valid destination, ignoring: %m");
358 log_link_warning_errno(link, r, "rtnl: received route with invalid gateway, ignoring: %m");
364 log_link_warning_errno(link, r, "rtnl: received route with invalid source, ignoring: %m");
370 log_link_warning_errno(link, r, "rtnl: received route with invalid preferred source, ignoring: %m");
379 log_link_warning_errno(link, r, "rtnl: received route without valid destination, ignoring: %m");
385 log_link_warning_errno(link, r, "rtnl: received route with invalid gateway, ignoring: %m");
391 log_link_warning_errno(link, r, "rtnl: received route with invalid source, ignoring: %m");
397 log_link_warning_errno(link, r, "rtnl: received route with invalid preferred source, ignoring: %m");
404 log_link_debug(link, "rtnl: ignoring unsupported address family: %d", family);
410 log_link_warning_errno(link, r, "rtnl: received route with invalid destination prefixlen, ignoring: %m");
416 log_link_warning_errno(link, r, "rtnl: received route with invalid source prefixlen, ignoring: %m");
422 log_link_warning_errno(link, r, "rtnl: received route with invalid scope, ignoring: %m");
428 log_link_warning_errno(link, r, "rtnl: received route with invalid tos, ignoring: %m");
434 log_link_warning_errno(link, r, "rtnl: received route with invalid table, ignoring: %m");
440 log_link_warning_errno(link, r, "rtnl: received route with invalid priority, ignoring: %m");
444 route_get(link, family, &dst, dst_prefixlen, tos, priority, table, &route);
450 r = route_add_foreign(link, family, &dst, dst_prefixlen, tos, priority, table, &route);
474 Link *link = NULL;
516 r = link_get(m, ifindex, &link);
517 if (r < 0 || !link) {
521 log_warning("rtnl: received address for nonexistent link (%d), ignoring", ifindex);
528 log_link_warning(link, "rtnl: received address with invalid family, ignoring.");
534 log_link_warning_errno(link, r, "rtnl: received address with invalid prefixlen, ignoring: %m");
540 log_link_warning_errno(link, r, "rtnl: received address with invalid scope, ignoring: %m");
546 log_link_warning_errno(link, r, "rtnl: received address with invalid flags, ignoring: %m");
554 log_link_warning_errno(link, r, "rtnl: received address without valid address, ignoring: %m");
563 log_link_warning_errno(link, r, "rtnl: received address without valid address, ignoring: %m");
570 log_link_debug(link, "rtnl: ignoring unsupported address family: %d", family);
574 log_link_warning(link, "Could not print address");
586 address_get(link, family, &in_addr, prefixlen, &address);
591 log_link_debug(link, "Updating address: %s/%u (valid %s%s)", buf, prefixlen,
595 r = address_add_foreign(link, family, &in_addr, prefixlen, &address);
597 log_link_warning_errno(link, r, "Failed to add address %s/%u: %m", buf, prefixlen);
600 log_link_debug(link, "Adding address: %s/%u (valid %s%s)", buf, prefixlen,
611 log_link_debug(link, "Removing address: %s/%u (valid %s%s)", buf, prefixlen,
615 log_link_warning(link, "Removing non-existent address: %s/%u (valid %s%s)", buf, prefixlen,
628 Link *link = NULL;
641 log_warning_errno(r, "rtnl: Could not receive link: %m");
651 log_warning("rtnl: Received unexpected message type when processing link");
657 log_warning_errno(r, "rtnl: Could not get ifindex from link: %m");
660 log_warning("rtnl: received link message with invalid ifindex: %d", ifindex);
666 log_warning_errno(r, "rtnl: Received link message without ifname: %m");
670 (void) link_get(m, ifindex, &link);
675 if (!link) {
676 /* link is new, so add it */
677 r = link_add(m, message, &link);
679 log_warning_errno(r, "Could not add new link: %m");
693 r = link_update(link, message);
700 link_drop(link);
831 Link *link;
859 HASHMAP_FOREACH(link, m->links, i) {
860 if (link->flags & IFF_LOOPBACK)
863 if (link->operstate > operstate)
864 operstate = link->operstate;
866 if (!link->network)
870 r = ordered_set_put_strdupv(dns, link->network->dns);
874 r = ordered_set_put_strdupv(ntp, link->network->ntp);
878 r = ordered_set_put_strdupv(search_domains, link->network->search_domains);
882 r = ordered_set_put_strdupv(route_domains, link->network->route_domains);
886 if (!link->dhcp_lease)
890 if (link->network->dhcp_use_dns) {
893 r = sd_dhcp_lease_get_dns(link->dhcp_lease, &addresses);
902 if (link->network->dhcp_use_ntp) {
905 r = sd_dhcp_lease_get_ntp(link->dhcp_lease, &addresses);
914 if (link->network->dhcp_use_domains != DHCP_USE_DOMAINS_NO) {
917 r = sd_dhcp_lease_get_domainname(link->dhcp_lease, &domainname);
920 if (link->network->dhcp_use_domains == DHCP_USE_DOMAINS_YES)
979 Link *link;
988 SET_FOREACH(link, m->dirty_links, i) {
989 r = link_save(link);
991 link_clean(link);
1049 Link *link;
1057 while ((link = hashmap_first(m->links)))
1058 link_unref(link);
1089 Link *link;
1094 HASHMAP_FOREACH(link, m->links, i) {
1097 if (link->state == LINK_STATE_PENDING)
1100 if (!link->network)
1104 if (link_lldp_enabled(link) ||
1105 link_ipv4ll_enabled(link) ||
1106 link_dhcp4_server_enabled(link) ||
1107 link_dhcp4_enabled(link) ||
1108 link_dhcp6_enabled(link) ||
1109 link_ipv6_accept_ra_enabled(link))
1117 Link *link;
1127 HASHMAP_FOREACH(link, m->links, i)
1128 link_save(link);
1167 sd_netlink_message *link;
1185 for (link = reply; link; link = sd_netlink_message_next(link)) {
1190 k = manager_rtnl_process_link(m->rtnl, link, m);
1307 Link *link;
1309 link = hashmap_get(m->links, INT_TO_PTR(gateways[i].ifindex));
1310 if (!link) {
1311 log_debug("Weird, found a gateway for a link we don't know. Ignoring.");
1315 if (link == exclude)
1318 if (link->operstate < LINK_OPERSTATE_ROUTABLE)
1321 return link;