projects
/
project
/
odhcpd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dhcpv6-ia: Fix segfault when writing DHCPv4 leases in state file
[project/odhcpd.git]
/
src
/
router.h
diff --git
a/src/router.h
b/src/router.h
index
8d74967
..
bdfe52c
100644
(file)
--- a/
src/router.h
+++ b/
src/router.h
@@
-20,31
+20,19
@@
struct icmpv6_opt {
uint8_t type;
uint8_t len;
struct icmpv6_opt {
uint8_t type;
uint8_t len;
+ uint8_t data[6];
};
};
-struct nd_opt_slla {
- uint8_t type;
- uint8_t len;
- uint8_t addr[6];
-};
-
-struct nd_opt_recursive_dns {
- uint8_t type;
- uint8_t len;
- uint8_t pad;
- uint8_t pad2;
- uint32_t lifetime;
-};
#define icmpv6_for_each_option(opt, start, end)\
for (opt = (struct icmpv6_opt*)(start);\
#define icmpv6_for_each_option(opt, start, end)\
for (opt = (struct icmpv6_opt*)(start);\
- (void*)(opt + (opt->len << 3)) <= (void*)(end); opt += (opt->len << 3))
+ (void*)(opt + 1) <= (void*)(end) && opt->len > 0 &&\
+ (void*)(opt + opt->len) <= (void*)(end); opt += opt->len)
+
-#define MaxRtrAdvInterval 600
-#define MinRtrAdvInterval (MaxRtrAdvInterval / 3)
-#define MaxValidTime 7200
-#define MaxPreferredTime (3 * MaxRtrAdvInterval)
+#define MaxRtrAdvInterval 1800
+#define MinRtrAdvInterval 3
#define ND_RA_FLAG_PROXY 0x4
#define ND_RA_FLAG_PROXY 0x4
-#define ND_RA_PREF_HIGH (1 << 3)
+#define ND_RA_PREF_HIGH
(1 << 3)
#define ND_RA_PREF_LOW (3 << 3)
#define ND_RA_PREF_LOW (3 << 3)