Lines Matching refs:nrt
368 nc_route(struct rt *ort, struct rt *nrt) in nc_route() argument
372 if (nrt->dest.s_addr == 0 && in nc_route()
373 nrt->net.s_addr == 0 && in nc_route()
374 !(nrt->iface->options->options & DHCPCD_GATEWAY)) in nc_route()
377 desc_route(ort == NULL ? "adding" : "changing", nrt); in nc_route()
380 ort = ipv4_findrt(nrt->iface->ctx, nrt, 0); in nc_route()
382 ((ort->flags & RTF_REJECT && nrt->flags & RTF_REJECT) || in nc_route()
383 (ort->iface == nrt->iface && in nc_route()
385 ort->metric == nrt->metric && in nc_route()
387 ort->gate.s_addr == nrt->gate.s_addr))) in nc_route()
389 } else if (ort->flags & STATE_FAKE && !(nrt->flags & STATE_FAKE) && in nc_route()
390 ort->iface == nrt->iface && in nc_route()
392 ort->metric == nrt->metric && in nc_route()
394 ort->dest.s_addr == nrt->dest.s_addr && in nc_route()
395 ort->net.s_addr == nrt->net.s_addr && in nc_route()
396 ort->gate.s_addr == nrt->gate.s_addr) in nc_route()
402 if (if_route(RTM_ADD, nrt) == 0) { in nc_route()
404 logger(nrt->iface->ctx, LOG_ERR, "if_route (DEL): %m"); in nc_route()
417 logger(nrt->iface->ctx, LOG_ERR, "if_route (DEL): %m"); in nc_route()
418 if (if_route(RTM_ADD, nrt) == 0) in nc_route()
423 logger(nrt->iface->ctx, LOG_ERR, "if_route (ADD): %m"); in nc_route()
503 struct rt_head *nrt; in get_routes() local
507 nrt = malloc(sizeof(*nrt)); in get_routes()
508 TAILQ_INIT(nrt); in get_routes()
515 ipv4_freeroutes(nrt); in get_routes()
519 TAILQ_INSERT_TAIL(nrt, r, next); in get_routes()
521 return nrt; in get_routes()