]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Merge branch 'master' into rbtree
authorRoy Marples <roy@marples.name>
Fri, 14 Jun 2019 14:22:43 +0000 (15:22 +0100)
committerRoy Marples <roy@marples.name>
Fri, 14 Jun 2019 14:22:43 +0000 (15:22 +0100)
1  2 
src/dhcp6.c
src/dhcpcd.c
src/ipv6.c
src/ipv6nd.c

diff --cc src/dhcp6.c
Simple merge
diff --cc src/dhcpcd.c
Simple merge
diff --cc src/ipv6.c
index f9ff14223c49271a2844f95dfec7cc518a56903a,e9e6dc257025dd69cf9022d9cfcdfadf199446d7..8288cb40ce7e4512b33e2558c4eff61c6d4e2d3b
@@@ -2235,8 -2240,7 +2235,7 @@@ inet6_staticroutes(rb_tree_t *routes, s
  }
  
  static int
- inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx, int expired,
-     bool *have_default)
 -inet6_raroutes(struct rt_head *routes, struct dhcpcd_ctx *ctx)
++inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
  {
        struct rt *rt;
        struct ra *rap;
                        rt = inet6_makeprefix(rap->iface, rap, addr);
                        if (rt) {
                                rt->rt_dflags |= RTDF_RA;
 -                              TAILQ_INSERT_TAIL(routes, rt, rt_next);
 +                              rt_proto_add(routes, rt);
                        }
                }
-               if (rap->lifetime) {
-                       rt = inet6_makerouter(rap);
-                       if (rt) {
-                               rt->rt_dflags |= RTDF_RA;
-                               if (rt_proto_add(routes, rt) && have_default)
-                                       *have_default = true;
-                       }
-               }
+               if (rap->lifetime == 0)
+                       continue;
+               rt = inet6_makerouter(rap);
+               if (rt == NULL)
+                       continue;
+               rt->rt_dflags |= RTDF_RA;
 -              TAILQ_INSERT_TAIL(routes, rt, rt_next);
++              rt_proto_add(routes, rt);
        }
        return 0;
  }
@@@ -2293,9 -2296,8 +2291,8 @@@ inet6_dhcproutes(rb_tree_t *routes, str
  #endif
  
  bool
 -inet6_getroutes(struct dhcpcd_ctx *ctx, struct rt_head *routes)
 +inet6_getroutes(struct dhcpcd_ctx *ctx, rb_tree_t *routes)
  {
-       bool have_default;
  
        /* Should static take priority? */
        if (inet6_staticroutes(routes, ctx) == -1)
diff --cc src/ipv6nd.c
Simple merge