-/* $OpenBSD: dhclient.c,v 1.448 2017/06/25 00:38:38 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.449 2017/06/27 13:24:49 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
}
/* Put us into the correct rdomain */
- ifi->rdomain = get_rdomain(ifi->name);
if (setrtable(ifi->rdomain) == -1)
fatal("setting routing table to %u", ifi->rdomain);
-/* $OpenBSD: dhcpd.h,v 1.195 2017/06/24 23:32:57 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.196 2017/06/27 13:24:49 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
void cancel_timeout(struct interface_info *);
void interface_link_forceup(char *);
int interface_status(struct interface_info *);
-int get_rdomain(char *);
void get_hw_address(struct interface_info *);
void sendhup(void);
-/* $OpenBSD: dispatch.c,v 1.127 2017/06/24 23:32:57 krw Exp $ */
+/* $OpenBSD: dispatch.c,v 1.128 2017/06/27 13:24:49 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
{
struct ifaddrs *ifap, *ifa;
struct sockaddr_dl *sdl;
+ struct if_data *ifdata;
int found;
if (getifaddrs(&ifap) != 0)
sdl->sdl_alen != ETHER_ADDR_LEN)
continue;
+ ifdata = ifa->ifa_data;
+ ifi->rdomain = ifdata->ifi_rdomain;
+
memcpy(ifi->hw_address.ether_addr_octet, LLADDR(sdl),
ETHER_ADDR_LEN);
ifi->flags |= IFI_VALID_LLADDR;
ifi->timeout_func = NULL;
}
-int
-get_rdomain(char *name)
-{
- int rv = 0, s;
- struct ifreq ifr;
-
- if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
- fatal("get_rdomain socket");
-
- memset(&ifr, 0, sizeof(ifr));
- strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
- if (ioctl(s, SIOCGIFRDOMAIN, (caddr_t)&ifr) != -1)
- rv = ifr.ifr_rdomainid;
-
- close(s);
- return rv;
-}
-
/*
* Inform the [priv] process a HUP was received.
*/