From 2a82db4cafbb826ecfd84b79d8c7ffac6d99b285 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Sat, 10 Mar 2012 21:40:10 +0000 Subject: [PATCH] Supply zero preference in advertise and reply messages --- src/option.c | 2 +- src/rfc3315.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/option.c b/src/option.c index 9259430..050a953 100644 --- a/src/option.c +++ b/src/option.c @@ -580,7 +580,7 @@ char *option_string(int prot, unsigned int opt, unsigned char *val, int opt_len, break; } - if (buf && (!ot[o].name || nodecode)) + if (opt_len != 0 && buf && (!ot[o].name || nodecode)) { int trunc = 0; if (opt_len > 13) diff --git a/src/rfc3315.c b/src/rfc3315.c index f28f5f6..b0c31ad 100644 --- a/src/rfc3315.c +++ b/src/rfc3315.c @@ -763,7 +763,11 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh } end_opt6(o); - + + o = new_opt6(OPTION6_PREFERENCE); + put_opt6_char(0); + end_opt6(o); + break; } }