summaryrefslogtreecommitdiffstats
path: root/dhcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp.c')
-rw-r--r--dhcp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/dhcp.c b/dhcp.c
index 2689b734..15b21c98 100644
--- a/dhcp.c
+++ b/dhcp.c
@@ -195,8 +195,13 @@ int make_option_mask(uint8_t *mask, const char *opts, int add)
if (opt->option == n)
match = 1;
}
- if (match) {
- if (add == 1)
+ if (match) {
+ if (add == 2 && !(opt->type & IPV4)) {
+ free(o);
+ errno = EINVAL;
+ return -1;
+ }
+ if (add == 1 || add == 2)
add_option_mask(mask,
opt->option);
else