diff options
-rw-r--r-- | src/dhcp6-protocol.h | 1 | ||||
-rw-r--r-- | src/helper.c | 6 | ||||
-rw-r--r-- | src/rfc3315.c | 10 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/dhcp6-protocol.h b/src/dhcp6-protocol.h index 332d536..ce16603 100644 --- a/src/dhcp6-protocol.h +++ b/src/dhcp6-protocol.h @@ -63,6 +63,7 @@ #define OPTION6_FQDN 39 #define OPTION6_NTP_SERVER 56 #define OPTION6_CLIENT_MAC 79 +#define OPTION6_MUD_URL 112 #define NTP_SUBOPTION_SRV_ADDR 1 #define NTP_SUBOPTION_MC_ADDR 2 diff --git a/src/helper.c b/src/helper.c index 14330f3..749e8cc 100644 --- a/src/helper.c +++ b/src/helper.c @@ -638,8 +638,10 @@ int create_helper(int event_fd, int err_fd, uid_t uid, gid_t gid, long max_fd) buf = grab_extradata(buf, end, "DNSMASQ_TAGS", &err); - if (is6) - buf = grab_extradata(buf, end, "DNSMASQ_RELAY_ADDRESS", &err); + if (is6) { + buf = grab_extradata(buf, end, "DNSMASQ_RELAY_ADDRESS", &err); + buf = grab_extradata(buf, end, "DNSMASQ_MUD_URL", &err); + } else { const char *giaddr = NULL; diff --git a/src/rfc3315.c b/src/rfc3315.c index 6533197..8d601c4 100644 --- a/src/rfc3315.c +++ b/src/rfc3315.c @@ -1934,6 +1934,16 @@ static void update_leases(struct state *state, struct dhcp_context *context, str lease_add_extradata(lease, (unsigned char *)daemon->addrbuff, state->link_address ? strlen(daemon->addrbuff) : 0, 0); + void *mud_opt; + if ((mud_opt = opt6_find(state->packet_options, state->end, OPTION6_MUD_URL, 1))) + { + lease_add_extradata(lease, opt6_ptr(mud_opt, 0), opt6_len(mud_opt), NULL); + } + else + { + lease_add_extradata(lease, NULL, 0, 0); + } + if ((class_opt = opt6_find(state->packet_options, state->end, OPTION6_USER_CLASS, 2))) { void *enc_opt, *enc_end = opt6_ptr(class_opt, opt6_len(class_opt)); |