for future attempts at making it more IPv6-like.
ok florian@
-.\" $OpenBSD: dhclient.8,v 1.46 2020/12/10 18:35:31 krw Exp $
+.\" $OpenBSD: dhclient.8,v 1.47 2021/02/24 16:18:59 krw Exp $
.\"
.\" Copyright (c) 1997 The Internet Software Consortium.
.\" All rights reserved.
.\" Enterprises. To learn more about the Internet Software Consortium,
.\" see ``http://www.isc.org/isc''. To learn more about Vixie
.\" Enterprises, see ``http://www.vix.com''.
-.Dd $Mdocdate: December 10 2020 $
+.Dd $Mdocdate: February 24 2021 $
.Dt DHCLIENT 8
.Os
.Sh NAME
.Xr hostname.if 5
file.
.Pp
-.Nm
-sets the
-.Sy AUTOCONF4
-flag on
-.Ar interface .
-If the flag is later cleared by
-.Xr ifconfig 8
-.Nm
-will continue to obtain leases normally but it will not apply any
-changes to the interface or the host until
-.Xr ifconfig 8
-restores the flag.
-.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl c Ar file
-/* $OpenBSD: dhclient.c,v 1.698 2021/02/22 02:19:03 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.699 2021/02/24 16:18:59 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
void get_ssid(struct interface_info *, int);
void get_sockets(struct interface_info *);
int get_routefd(int);
-void set_autoconf(struct interface_info *, int);
void set_iff_up(struct interface_info *, int);
void set_user(char *);
int get_ifa_family(char *, int);
get_sockets(ifi);
get_ssid(ifi, ioctlfd);
- if (noaction == 0) {
- set_autoconf(ifi, ioctlfd);
+ if (noaction == 0)
set_iff_up(ifi, ioctlfd);
- }
close(ioctlfd);
}
}
-void
-set_autoconf(struct interface_info *ifi, int ioctlfd)
-{
- struct ifreq ifr;
-
- memset(&ifr, 0, sizeof(ifr));
- strlcpy(ifr.ifr_name, ifi->name, sizeof(ifr.ifr_name));
-
- if (ioctl(ioctlfd, SIOCGIFXFLAGS, (caddr_t)&ifr) < 0)
- fatal("SIOGIFXFLAGS");
- if ((ifr.ifr_flags & IFXF_AUTOCONF4) == 0) {
- ifr.ifr_flags |= IFXF_AUTOCONF4;
- if (ioctl(ioctlfd, SIOCSIFXFLAGS, (caddr_t)&ifr) == -1)
- fatal("SIOCSIFXFLAGS");
- }
-
- ifi->flags |= IFI_AUTOCONF;
-}
-
void
set_iff_up(struct interface_info *ifi, int ioctlfd)
{
if ((rtm->rtm_flags & RTF_UP) == 0)
fatalx("down");
- if ((ifm->ifm_xflags & IFXF_AUTOCONF4) == 0 &&
- (ifi->flags & IFI_AUTOCONF) != 0) {
- /* Tell unwind when IFI_AUTOCONF is cleared. */
- tell_unwind(NULL, ifi->flags);
- ifi->flags &= ~IFI_AUTOCONF;
- } else if ((ifm->ifm_xflags & IFXF_AUTOCONF4) != 0 &&
- (ifi->flags & IFI_AUTOCONF) == 0) {
- /* Get new lease when IFI_AUTOCONF is set. */
- ifi->flags |= IFI_AUTOCONF;
- quit = RESTART;
- break;
- }
-
oldmtu = ifi->mtu;
interface_state(ifi);
if (oldmtu == ifi->mtu)
* Responsibility for resolv.conf may have changed hands.
*/
if (quit == 0 && ifi->active != NULL &&
- (ifi->flags & IFI_AUTOCONF) != 0 &&
(ifi->flags & IFI_IN_CHARGE) != 0 &&
ifi->state == S_BOUND)
write_resolv_conf();
-/* $OpenBSD: dhcpd.h,v 1.294 2021/02/22 23:43:59 jsg Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.295 2021/02/24 16:18:59 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
int rdomain;
int flags;
#define IFI_IN_CHARGE 0x01
-#define IFI_AUTOCONF 0x02
uint32_t mtu;
struct dhcp_packet recv_packet;
struct dhcp_packet sent_packet;
-/* $OpenBSD: kroute.c,v 1.194 2021/02/01 16:29:22 cheloha Exp $ */
+/* $OpenBSD: kroute.c,v 1.195 2021/02/24 16:18:59 krw Exp $ */
/*
* Copyright 2012 Kenneth R Westerback <krw@openbsd.org>
int *lastidx)
{
struct unwind_info unwind_info;
- struct ifreq ifr;
uint8_t *dns, *domains, *routes;
char *search = NULL;
int rslt;
domains = routes + proposal->routes_len;
dns = domains + proposal->domains_len;
- memset(&ifr, 0, sizeof(ifr));
- strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
- if (ioctl(ioctlfd, SIOCGIFXFLAGS, (caddr_t)&ifr) < 0)
- fatal("SIOGIFXFLAGS");
- if ((ifr.ifr_flags & IFXF_AUTOCONF4) == 0)
- return;
-
memset(&unwind_info, 0, sizeof(unwind_info));
if (proposal->ns_len >= sizeof(in_addr_t)) {
if (proposal->ns_len > sizeof(unwind_info.ns)) {
struct unwind_info noinfo;
int rslt;
- if ((ifi_flags & IFI_AUTOCONF) == 0 ||
- (ifi_flags & IFI_IN_CHARGE) == 0)
+ if ((ifi_flags & IFI_IN_CHARGE) == 0)
return;
if (unwind_info != NULL)