]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix some routing issues for POINTOPOINT interfaces.
authorRoy Marples <roy@marples.name>
Wed, 25 May 2016 10:32:39 +0000 (10:32 +0000)
committerRoy Marples <roy@marples.name>
Wed, 25 May 2016 10:32:39 +0000 (10:32 +0000)
ipv4.c

diff --git a/ipv4.c b/ipv4.c
index 09c65d7f154683879930abad1edb3c49f8952a26..12945b3432aa7c8ee90c85e99dbb1aef7d2f6142 100644 (file)
--- 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;