Page MenuHomeFreeBSD

D15484.id43217.diff
No OneTemporary

D15484.id43217.diff

Index: head/sbin/dhclient/dhclient.c
===================================================================
--- head/sbin/dhclient/dhclient.c
+++ head/sbin/dhclient/dhclient.c
@@ -849,11 +849,23 @@
opt = &ip->client->new->options[DHO_INTERFACE_MTU];
if (opt->len == sizeof(u_int16_t)) {
- u_int16_t mtu = be16dec(opt->data);
- if (mtu < MIN_MTU)
- warning("mtu size %u < %d: ignored", (unsigned)mtu, MIN_MTU);
+ u_int16_t mtu = 0;
+ bool supersede = (ip->client->config->default_actions[DHO_INTERFACE_MTU] ==
+ ACTION_SUPERSEDE);
+
+ if (supersede)
+ mtu = getUShort(ip->client->config->defaults[DHO_INTERFACE_MTU].data);
else
+ mtu = be16dec(opt->data);
+
+ if (mtu < MIN_MTU) {
+ /* Treat 0 like a user intentionally doesn't want to change MTU and,
+ * therefore, warning is not needed */
+ if (!supersede || mtu != 0)
+ warning("mtu size %u < %d: ignored", (unsigned)mtu, MIN_MTU);
+ } else {
interface_set_mtu_unpriv(privfd, mtu);
+ }
}
/* Write out the new lease. */
Index: head/sbin/dhclient/dhclient.conf.5
===================================================================
--- head/sbin/dhclient/dhclient.conf.5
+++ head/sbin/dhclient/dhclient.conf.5
@@ -38,7 +38,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 1, 1997
+.Dd May 31, 2018
.Dt DHCLIENT.CONF 5
.Os
.Sh NAME
@@ -227,6 +227,14 @@
in the
.Ic supersede
statement.
+.Pp
+Some options values have special meaning:
+.Bl -tag -width indent
+.It Ar interface-mtu
+Any server-supplied interface MTU is ignored by the client if a
+.Ic supersede
+zero value is configured.
+.El
.It Xo
.Ic prepend No { Op Ar option declaration
.Oo , Ar ... option declaration Oc }

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 22, 5:19 AM (27 m, 20 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24006628
Default Alt Text
D15484.id43217.diff (1 KB)

Event Timeline