mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 10:27:12 +08:00
Update to FreeBSD head 2018-06-01
Git mirror commit fb63610a69b0eb7f69a201ba05c4c1a7a2739cf9. Update #3472.
This commit is contained in:
@@ -851,11 +851,23 @@ 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 = 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. */
|
||||
|
Reference in New Issue
Block a user