]> git.decadent.org.uk Git - odhcp6c.git/blobdiff - src/ra.h
dhcpv6: clear CUSTOM_OPTS in a more sane manner
[odhcp6c.git] / src / ra.h
index d4d93763af6827d3376081ce15891002cb027392..3beac68576a04bcf0b41df0f400b343a29b78ef6 100644 (file)
--- a/src/ra.h
+++ b/src/ra.h
@@ -1,5 +1,5 @@
 /**
- * Copyright (C) 2012-2013 Steven Barth <steven@midlink.org>
+ * Copyright (C) 2012-2014 Steven Barth <steven@midlink.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License v2 as published by
 struct icmpv6_opt {
        uint8_t type;
        uint8_t len;
-};
-
-struct nd_opt_recursive_dns {
-       uint8_t type;
-       uint8_t len;
-       uint8_t pad;
-       uint8_t pad2;
-       uint32_t lifetime;
-       struct in6_addr servers[1];
+       uint8_t data[6];
 };
 
 #define ND_OPT_ROUTE_INFORMATION 24
-struct nd_opt_route_info {
-       uint8_t nd_opt_ri_type;
-       uint8_t nd_opt_ri_len;
-       uint8_t nd_opt_ri_prefix_len;
-       uint8_t nd_opt_ri_prf;
-       uint32_t nd_opt_ri_route_lifetime;
-       uint8_t nd_opt_ri_prefix[1];
-};
+
 
 #define icmpv6_for_each_option(opt, start, end)\
        for (opt = (struct icmpv6_opt*)(start);\
-       ((void *)opt < (void *)end) && \
-       (void *)((uint8_t *)opt + (opt->len << 3)) <= (void *)(end); \
-       opt = (struct icmpv6_opt *)((uint8_t *)opt + (opt->len << 3)))
+       (void*)(opt + 1) <= (void*)(end) && opt->len > 0 &&\
+       (void*)(opt + opt->len) <= (void*)(end); opt += opt->len)
 
 
 int ra_init(const char *ifname, const struct in6_addr *ifid);