svn commit: r344488 - head/sbin/dhclient
Maxim Sobolev
sobomax at FreeBSD.org
Sat Feb 23 23:31:14 UTC 2019
Author: sobomax
Date: Sat Feb 23 23:31:13 2019
New Revision: 344488
URL: https://svnweb.freebsd.org/changeset/base/344488
Log:
Further refine r336195: do not even attempt to verify/update interface's
MTU if we've set it once and there were no changes on the DHCP server
side since the last refresh. This is consistent I believe with how dhclient
handles other settings like IP address, mask etc.
Approved by: cem, eugen
Differential Revision: https://reviews.freebsd.org/D18546
Modified:
head/sbin/dhclient/dhclient.c
Modified: head/sbin/dhclient/dhclient.c
==============================================================================
--- head/sbin/dhclient/dhclient.c Sat Feb 23 21:14:00 2019 (r344487)
+++ head/sbin/dhclient/dhclient.c Sat Feb 23 23:31:13 2019 (r344488)
@@ -863,6 +863,7 @@ bind_lease(struct interface_info *ip)
opt = &ip->client->new->options[DHO_INTERFACE_MTU];
if (opt->len == sizeof(u_int16_t)) {
u_int16_t mtu = 0;
+ u_int16_t old_mtu = 0;
bool supersede = (ip->client->config->default_actions[DHO_INTERFACE_MTU] ==
ACTION_SUPERSEDE);
@@ -871,12 +872,19 @@ bind_lease(struct interface_info *ip)
else
mtu = be16dec(opt->data);
+ if (ip->client->active) {
+ opt = &ip->client->active->options[DHO_INTERFACE_MTU];
+ if (opt->len == sizeof(u_int16_t)) {
+ old_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 {
+ } else if (ip->client->state != S_RENEWING || mtu != old_mtu) {
interface_set_mtu_unpriv(privfd, mtu);
}
}
More information about the svn-src-head
mailing list