const struct dhcp_lease *lease, const struct options *options,
int up)
{
- unsigned short mtu;
struct in_addr addr;
struct in_addr net;
struct in_addr brd;
/* If we aren't up, then reset the interface as much as we can */
if (!up) {
- /* Restore the original MTU value */
- if (iface->initial_mtu != iface->mtu) {
- set_mtu(iface->name, iface->initial_mtu);
- iface->mtu = iface->initial_mtu;
- }
-
/* If we haven't created an info file, do so now */
if (!lease->frominfo) {
if (write_info(iface, dhcp, lease, options, 0) == -1)
return 0;
}
- if (options->options & DHCPCD_MTU)
- if (get_option_uint16(&mtu, dhcp, DHCP_MTU) == 0)
- if (mtu != iface->mtu && mtu >= MTU_MIN) {
- if (set_mtu(iface->name, mtu) == 0)
- iface->mtu = mtu;
- else
- logger(LOG_ERR, "set_mtu: %s",
- strerror(errno));
- }
-
/* This also changes netmask */
if (!(options->options & DHCPCD_INFORM) ||
!has_address(iface->name, &addr, &net)) {
.Nd an RFC 2131 compliant DHCP client
.Sh SYNOPSIS
.Nm
-.Op Fl dknpAEGHMOLNRSTY
+.Op Fl dknpAEGHOLNRSTY
.Op Fl c , -script Ar script
.Op Fl h , -hostname Ar hostname
.Op Fl i , -classid Ar classid
(none) then the hostnam will be looked up in DNS and set to that.
.It Fl L , -noipv4ll
Don't use IPv4LL at all.
-.It Fl M , -nomtu
-Don't set the MTU of the
-.Ar interface .
.It Fl N , -nontp
Don't touch
.Pa /etc/ntpd.conf
{"nohostname", no_argument, NULL, 'H'},
{"clientid", optional_argument, NULL, 'I'},
{"noipv4ll", no_argument, NULL, 'L'},
- {"nomtu", no_argument, NULL, 'M'},
{"nontp", no_argument, NULL, 'N'},
{"nooptions", no_argument, NULL, 'O'},
{"nodns", no_argument, NULL, 'R'},
static void
usage(void)
{
- printf("usage: "PACKAGE" [-adknpEGHMNORSTY] [-c script] [-h hostname] [-i classID]\n"
+ printf("usage: "PACKAGE" [-adknpEGHNORSTY] [-c script] [-h hostname] [-i classID]\n"
" [-l leasetime] [-m metric] [-o option] [-r ipaddress]\n"
" [-s ipaddress] [-t timeout] [-u userclass] [-F none | ptr | both]\n"
" [-I clientID] <interface>\n");
/* Don't set any optional arguments here so we retain POSIX
* compatibility with getopt */
while ((opt = getopt_long(argc, argv, EXTRA_OPTS
- "c:dh:i:kl:m:no:pr:s:t:u:xAEF:GHI:LMNORSTY",
+ "c:dh:i:kl:m:no:pr:s:t:u:xAEF:GHI:LNORSTY",
longopts, &option_index)) != -1)
{
switch (opt) {
case 'L':
options->options &= ~DHCPCD_IPV4LL;
break;
- case 'M':
- options->options &= ~DHCPCD_MTU;
- break;
case 'N':
dontp = 0;
break;
#define DHCPCD_ARP (1 << 0)
#define DHCPCD_DOMAIN (1 << 2)
#define DHCPCD_GATEWAY (1 << 3)
-#define DHCPCD_MTU (1 << 4)
#define DHCPCD_LASTLEASE (1 << 7)
#define DHCPCD_INFORM (1 << 8)
#define DHCPCD_REQUEST (1 << 9)
time_t timeout;
int metric;
int options;
-
- int dohostname;
int domscsr;
struct in_addr request_address;
mv -f "$1"-pre."${INTERFACE}" "$1"
}
+make_mtu()
+{
+ if [ -n "${MTU}" ]; then
+ ifconfig "${INTERFACE}" mtu "${MTU}"
+ fi
+}
+
make_nis_conf() {
[ -z "${NISDOMAIN}" -a -z "${NISSERVER}" ] && return 0
local cf=/etc/yp.conf."${INTERFACE}" prefix= x= pidfile=
exit $?
fi
+make_mtu
make_resolv_conf
make_hostname
make_nis_conf
iface->family = family;
iface->arpable = !(ifr.ifr_flags & (IFF_NOARP | IFF_LOOPBACK));
- iface->mtu = iface->initial_mtu = mtu;
/* 0 is a valid fd, so init to -1 */
iface->fd = -1;
char leasefile[PATH_MAX];
char infofile[PATH_MAX];
- unsigned short initial_mtu;
- unsigned short mtu;
struct in_addr addr;
struct in_addr net;
struct rt *routes;