summaryrefslogtreecommitdiffstats
path: root/dhcp.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-03-19 17:52:12 +0000
committerRoy Marples <roy@marples.name>2009-03-19 17:52:12 +0000
commit1abffd5ba55b4e4a2a149001a33349ef39139457 (patch)
tree48da83c4a9a64018cfc66e5566531361b7260a9b /dhcp.c
parent194b1fcb081f274e5759158267bf930f1bf57708 (diff)
downloaddhcpcd-1abffd5ba55b4e4a2a149001a33349ef39139457.tar.xz
We can now detected primary addresses added or changed in BSD.
As such, we can wait for a 3RDPARTY to configure the interface, such as PPP. We can then take the destination addess and automatically give it a default route or any other DHCP option such as DNS servers. This addresses #159.
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