Home | History | Annotate | Download | only in rump_dhcpclient

Lines Matching refs:iface

73 		    (srt || (!rt->iface ||
74 rt->iface->metric == r->iface->metric)) &&
116 desc_route("removing", f, f->iface->name);
126 n_route(struct rt *rt, const struct interface *iface)
131 !(iface->state->options->options & DHCPCD_GATEWAY))
134 desc_route("adding", rt, iface->name);
135 if (!add_route(iface, &rt->dest, &rt->net, &rt->gate, iface->metric))
139 if (rt->dest.s_addr == (iface->addr.s_addr & iface->net.s_addr) &&
140 rt->net.s_addr == iface->net.s_addr &&
146 fprintf(stderr, "%s: add_route failed: %d\n", iface->name, errno);
151 c_route(struct rt *ort, struct rt *nrt, const struct interface *iface)
156 !(iface->state->options->options & DHCPCD_GATEWAY))
159 desc_route("changing", nrt, iface->name);
163 del_route(ort->iface, &ort->dest, &ort->net, &ort->gate,
164 ort->iface->metric);
165 if (!add_route(iface, &nrt->dest, &nrt->net, &nrt->gate,
166 iface->metric))
168 fprintf(stderr, "%s: add_route failed: %d\n", iface->name, errno);
173 d_route(struct rt *rt, const struct interface *iface, int metric)
177 desc_route("deleting", rt, iface->name);
178 retval = del_route(iface, &rt->dest, &rt->net, &rt->gate, metric);
180 fprintf(stderr,"%s: del_route: %d\n", iface->name, errno);
207 add_subnet_route(struct rt *rt, const struct interface *iface)
211 if (iface->net.s_addr == INADDR_BROADCAST ||
212 iface->net.s_addr == INADDR_ANY ||
213 (iface->state->options->options &
215 iface->state->options->req_addr.s_addr == INADDR_ANY))
219 r->dest.s_addr = iface->addr.s_addr & iface->net.s_addr;
220 r->net.s_addr = iface->net.s_addr;
227 get_routes(const struct interface *iface)
231 if (iface->state->options->routes != NULL) {
232 for (rt = iface->state->options->routes;
250 return get_option_routes(iface->state->new,
251 iface->name, &iface->state->options->options);
258 massage_host_routes(struct rt *rt, const struct interface *iface)
263 if (r->gate.s_addr == iface->addr.s_addr &&
270 add_destination_route(struct rt *rt, const struct interface *iface)
274 if (!(iface->flags & IFF_POINTOPOINT) ||
275 !has_option_mask(iface->state->options->dstmask, DHO_ROUTER))
280 r->gate.s_addr = iface->dst.s_addr;
352 rt->iface = ifp;
358 if (or->iface != ifp ||
386 d_route(rt, rt->iface, rt->iface->metric);
394 delete_address(struct interface *iface)
399 ifo = iface->state->options;
404 iface->name,
405 inet_ntoa(iface->addr),
406 inet_ntocidr(iface->net));
407 retval = del_address(iface, &iface->addr, &iface->net);
410 iface->addr.s_addr = 0;
411 iface->net.s_addr = 0;
416 configure(struct interface *iface)
418 struct dhcp_message *dhcp = iface->state->new;
419 struct dhcp_lease *lease = &iface->state->lease;
420 struct if_options *ifo = iface->state->options;
425 !has_address(iface->name, &lease->addr, &lease->net))
428 iface->name, inet_ntoa(lease->addr),
430 if (add_address(iface,
440 if (iface->addr.s_addr != lease->addr.s_addr &&
441 iface->addr.s_addr != 0)
442 delete_address(iface);
444 iface->addr.s_addr = lease->addr.s_addr;
445 iface->net.s_addr = lease->net.s_addr;
451 rt->iface = iface;
453 del_route(iface, &rt->dest, &rt->net, &rt->gate, 0);