summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-05-25 10:32:39 +0000
committerRoy Marples <roy@marples.name>2016-05-25 10:32:39 +0000
commiteeb8d62f485b39c1e4e9ad789123fd8050dfab34 (patch)
tree144f99c757c5fe264959396d7a30911a1b8baf48
parentf6bdf24c69d370e959e571289c12e9d55ca2f1d0 (diff)
downloaddhcpcd-eeb8d62f485b39c1e4e9ad789123fd8050dfab34.tar.xz
Fix some routing issues for POINTOPOINT interfaces.
-rw-r--r--ipv4.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipv4.c b/ipv4.c
index 09c65d7f..12945b34 100644
--- a/ipv4.c
+++ b/ipv4.c
@@ -548,6 +548,10 @@ add_subnet_route(struct rt_head *rt, const struct interface *ifp)
if (rt == NULL) /* earlier malloc failed */
return NULL;
+ /* P2P interfaces don't have subnet routes as such. */
+ if (ifp->flags & IFF_POINTOPOINT)
+ return rt;
+
state = D_CSTATE(ifp);
/* Don't create a subnet route for these addresses */
if (state->addr->mask.s_addr == INADDR_ANY)
@@ -677,6 +681,10 @@ add_router_host_route(struct rt_head *rt, const struct interface *ifp)
if (rt == NULL) /* earlier malloc failed */
return NULL;
+ /* Don't add a host route for these interfaces. */
+ if (ifp->flags & (IFF_LOOPBACK | IFF_POINTOPOINT))
+ return rt;
+
TAILQ_FOREACH(rtp, rt, next) {
if (rtp->dest.s_addr != INADDR_ANY)
continue;