Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F132922110
D15484.id43217.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15484.id43217.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D15484: dhclient: allow to supersede interface-mtu option
Attached
Detach File
Event Timeline
Log In to Comment