summaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2017-07-24 18:13:20 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2017-07-24 18:13:20 +0000
commit7c2f6343cedc0aa760d7b15a59a45f26bf5228ce (patch)
tree45ada9526d3bf63a114db20d4fa5a7406c349240 /sbin/dhclient
parente617f77ee95d294aedb2e147fb50993e378cd30e (diff)
Throw DHO_STATIC_ROUTES to the floor! Roughly! Ensure
they don't appear in effective leases at all.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dhclient.c20
-rw-r--r--sbin/dhclient/dhcpd.h5
-rw-r--r--sbin/dhclient/kroute.c7
3 files changed, 13 insertions, 19 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 20ee6ca097e..2060a8f86a8 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.482 2017/07/24 17:15:41 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.483 2017/07/24 18:13:19 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -1038,7 +1038,6 @@ bind_lease(struct interface_info *ifi)
&options[DHO_CLASSLESS_STATIC_ROUTES],
&options[DHO_CLASSLESS_MS_STATIC_ROUTES],
&options[DHO_ROUTERS],
- &options[DHO_STATIC_ROUTES],
&options[DHO_SUBNET_MASK]);
newlease:
@@ -2319,23 +2318,22 @@ apply_defaults(struct client_lease *lease)
}
}
+ if (newlease->options[DHO_STATIC_ROUTES].len != 0) {
+ log_warnx("DHO_STATIC_ROUTES (option 33) not supported");
+ free(newlease->options[DHO_STATIC_ROUTES].data);
+ newlease->options[DHO_STATIC_ROUTES].data = NULL;
+ newlease->options[DHO_STATIC_ROUTES].len = 0;
+ }
/*
- * RFC 3442 says client *MUST* ignore both DHO_ROUTERS and
- * DHO_STATIC_ROUTES when DHO_CLASSLESS_[MS_]_ROUTES present.
- *
- * Remove them from 'newlease' so that -L will not show them
- * as part of the effective lease.
+ * RFC 3442 says client *MUST* ignore DHO_ROUTERS
+ * when DHO_CLASSLESS_[MS_]_ROUTES present.
*/
if ((newlease->options[DHO_CLASSLESS_MS_STATIC_ROUTES].len != 0) ||
(newlease->options[DHO_CLASSLESS_STATIC_ROUTES].len != 0)) {
free(newlease->options[DHO_ROUTERS].data);
newlease->options[DHO_ROUTERS].data = NULL;
newlease->options[DHO_ROUTERS].len = 0;
-
- free(newlease->options[DHO_STATIC_ROUTES].data);
- newlease->options[DHO_STATIC_ROUTES].data = NULL;
- newlease->options[DHO_STATIC_ROUTES].len = 0;
}
return newlease;
diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h
index 151eae9d0e1..e76b5d6c894 100644
--- a/sbin/dhclient/dhcpd.h
+++ b/sbin/dhclient/dhcpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpd.h,v 1.217 2017/07/24 17:15:41 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.218 2017/07/24 18:13:19 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
@@ -239,5 +239,4 @@ void flush_unpriv_ibuf(const char *);
void set_mtu(struct option_data *);
void set_address(char *, struct in_addr, struct option_data *);
void set_routes(struct in_addr, struct option_data *,
- struct option_data *, struct option_data *, struct option_data *,
- struct option_data *);
+ struct option_data *, struct option_data *, struct option_data *);
diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c
index d75df496ea6..b7b700cea8d 100644
--- a/sbin/dhclient/kroute.c
+++ b/sbin/dhclient/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.117 2017/07/24 17:15:41 krw Exp $ */
+/* $OpenBSD: kroute.c,v 1.118 2017/07/24 18:13:19 krw Exp $ */
/*
* Copyright 2012 Kenneth R Westerback <krw@openbsd.org>
@@ -373,7 +373,7 @@ create_route_label(struct sockaddr_rtlabel *label)
void
set_routes(struct in_addr addr, struct option_data *classless,
struct option_data *msclassless, struct option_data *routers,
- struct option_data *classfull, struct option_data *subnet)
+ struct option_data *subnet)
{
struct in_addr gateway, mask;
@@ -406,9 +406,6 @@ set_routes(struct in_addr addr, struct option_data *classless,
add_default_route(gateway, addr);
}
-
- if (classfull->len != 0)
- log_warnx("DHO_STATIC_ROUTES (option 33) not supported");
}
/*