mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-15 07:43:54 +08:00
Update to FreeBSD head 2016-12-10
Git mirror commit 80c55f08a05ab3b26a73b226ccb56adc3122a55c.
This commit is contained in:
@@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include "privsep.h"
|
||||
|
||||
#include <sys/capsicum.h>
|
||||
#include <sys/endian.h>
|
||||
|
||||
#include <net80211/ieee80211_freebsd.h>
|
||||
|
||||
@@ -134,6 +135,9 @@ int fork_privchld(int, int);
|
||||
((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
|
||||
#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
|
||||
|
||||
/* Minimum MTU is 68 as per RFC791, p. 24 */
|
||||
#define MIN_MTU 68
|
||||
|
||||
static time_t scripttime;
|
||||
|
||||
int
|
||||
@@ -800,9 +804,20 @@ dhcpack(struct packet *packet)
|
||||
void
|
||||
bind_lease(struct interface_info *ip)
|
||||
{
|
||||
struct option_data *opt;
|
||||
|
||||
/* Remember the medium. */
|
||||
ip->client->new->medium = ip->client->medium;
|
||||
|
||||
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);
|
||||
else
|
||||
interface_set_mtu_unpriv(privfd, mtu);
|
||||
}
|
||||
|
||||
/* Write out the new lease. */
|
||||
write_client_lease(ip, ip->client->new, 0);
|
||||
|
||||
|
Reference in New Issue
Block a user