Lines Matching refs:route
150 Route *route; in dhcp_pd_get_assigned_subnet_prefix() local
152 SET_FOREACH(route, link->routes) { in dhcp_pd_get_assigned_subnet_prefix()
153 if (route->source != NETWORK_CONFIG_SOURCE_DHCP_PD) in dhcp_pd_get_assigned_subnet_prefix()
155 assert(route->family == AF_INET6); in dhcp_pd_get_assigned_subnet_prefix()
157 if (in6_addr_prefix_covers(pd_prefix, pd_prefix_len, &route->dst.in6) > 0) { in dhcp_pd_get_assigned_subnet_prefix()
159 *ret = route->dst.in6; in dhcp_pd_get_assigned_subnet_prefix()
181 Route *route; in dhcp_pd_remove() local
183 SET_FOREACH(route, link->routes) { in dhcp_pd_remove()
184 if (route->source != NETWORK_CONFIG_SOURCE_DHCP_PD) in dhcp_pd_remove()
186 if (only_marked && !route_is_marked(route)) in dhcp_pd_remove()
190 sd_radv_remove_prefix(link->radv, &route->dst.in6, 64); in dhcp_pd_remove()
192 link_remove_dhcp_pd_subnet_prefix(link, &route->dst.in6); in dhcp_pd_remove()
194 k = route_remove(route); in dhcp_pd_remove()
198 route_cancel_request(route, link); in dhcp_pd_remove()
291 …pd_route_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, Route *route) { in dhcp_pd_route_handler() argument
308 _cleanup_(route_freep) Route *route = NULL; in dhcp_pd_request_route()
319 r = route_new(&route); in dhcp_pd_request_route()
323 route->source = NETWORK_CONFIG_SOURCE_DHCP_PD; in dhcp_pd_request_route()
324 route->family = AF_INET6; in dhcp_pd_request_route()
325 route->dst.in6 = *prefix; in dhcp_pd_request_route()
326 route->dst_prefixlen = 64; in dhcp_pd_request_route()
327 route->protocol = RTPROT_DHCP; in dhcp_pd_request_route()
328 route->priority = link->network->dhcp_pd_route_metric; in dhcp_pd_request_route()
329 route->lifetime_usec = lifetime_usec; in dhcp_pd_request_route()
331 if (route_get(NULL, link, route, &existing) < 0) in dhcp_pd_request_route()
336 r = link_request_route(link, TAKE_PTR(route), true, &link->dhcp_pd_messages, in dhcp_pd_request_route()
607 Route *route; in dhcp_pd_prefix_lost() local
623 SET_FOREACH(route, uplink->manager->routes) { in dhcp_pd_prefix_lost()
624 … if (!IN_SET(route->source, NETWORK_CONFIG_SOURCE_DHCP4, NETWORK_CONFIG_SOURCE_DHCP6)) in dhcp_pd_prefix_lost()
626 if (route->family != AF_INET6) in dhcp_pd_prefix_lost()
628 if (route->type != RTN_UNREACHABLE) in dhcp_pd_prefix_lost()
633 .prefixlen = route->dst_prefixlen, in dhcp_pd_prefix_lost()
634 .address = route->dst })) in dhcp_pd_prefix_lost()
637 (void) route_remove(route); in dhcp_pd_prefix_lost()
639 route_cancel_request(route, uplink); in dhcp_pd_prefix_lost()
655 …le_route_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, Route *route) { in dhcp4_unreachable_route_handler() argument
671 …le_route_handler(sd_netlink *rtnl, sd_netlink_message *m, Request *req, Link *link, Route *route) { in dhcp6_unreachable_route_handler() argument
697 _cleanup_(route_freep) Route *route = NULL; in dhcp_request_unreachable_route()
717 r = route_new(&route); in dhcp_request_unreachable_route()
721 route->source = source; in dhcp_request_unreachable_route()
722 route->provider = *server_address; in dhcp_request_unreachable_route()
723 route->family = AF_INET6; in dhcp_request_unreachable_route()
724 route->dst.in6 = *addr; in dhcp_request_unreachable_route()
725 route->dst_prefixlen = prefixlen; in dhcp_request_unreachable_route()
726 route->type = RTN_UNREACHABLE; in dhcp_request_unreachable_route()
727 route->protocol = RTPROT_DHCP; in dhcp_request_unreachable_route()
728 route->priority = IP6_RT_PRIO_USER; in dhcp_request_unreachable_route()
729 route->lifetime_usec = lifetime_usec; in dhcp_request_unreachable_route()
731 if (route_get(link->manager, NULL, route, &existing) < 0) in dhcp_request_unreachable_route()
736 r = link_request_route(link, TAKE_PTR(route), true, counter, callback, NULL); in dhcp_request_unreachable_route()
809 _cleanup_(route_freep) Route *route = NULL; in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
816 r = route_new(&route); in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
820 route->source = NETWORK_CONFIG_SOURCE_DHCP_PD; in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
821 route->family = AF_INET6; in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
822 route->gw_family = AF_INET6; in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
823 route->gw.in6.s6_addr32[3] = br_address->s_addr; in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
824 route->scope = RT_SCOPE_UNIVERSE; in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
825 route->protocol = RTPROT_DHCP; in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
826 route->priority = IP6_RT_PRIO_USER; in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
827 route->lifetime_usec = lifetime_usec; in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
829 if (route_get(NULL, link, route, &existing) < 0) /* This is a new route. */ in dhcp4_pd_request_default_gateway_on_6rd_tunnel()
834 r = link_request_route(link, TAKE_PTR(route), true, &link->dhcp_pd_messages, in dhcp4_pd_request_default_gateway_on_6rd_tunnel()