summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2017-06-28 15:23:19 +0000
committerkrw <krw@openbsd.org>2017-06-28 15:23:19 +0000
commit583aafa8966ad56b2ec29746ff0e833f333a0e82 (patch)
treed08d11ccccc1eb2e18707eac24bcf05dd347bae5
parentAdd regression tests for mail. (diff)
downloadwireguard-openbsd-583aafa8966ad56b2ec29746ff0e833f333a0e82.tar.xz
wireguard-openbsd-583aafa8966ad56b2ec29746ff0e833f333a0e82.zip
resolv_conf_priority() is a function local to kroute.c, no
need to expose its definition in dhcpd.h. While here change the parameter from struct interface_info to int and just pass the only field used (rdomain).
-rw-r--r--sbin/dhclient/dhcpd.h4
-rw-r--r--sbin/dhclient/kroute.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h
index 2151304ab3e..c242a6f6b77 100644
--- a/sbin/dhclient/dhcpd.h
+++ b/sbin/dhclient/dhcpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpd.h,v 1.197 2017/06/28 14:35:43 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.198 2017/06/28 15:23:19 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
@@ -252,6 +252,4 @@ void flush_routes(void);
void add_route(struct in_addr, struct in_addr, struct in_addr, struct in_addr,
int, int);
-int resolv_conf_priority(struct interface_info *);
-
void flush_unpriv_ibuf(const char *);
diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c
index 94474c4e4f4..5651c8c1b1a 100644
--- a/sbin/dhclient/kroute.c
+++ b/sbin/dhclient/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.96 2017/06/28 14:35:43 krw Exp $ */
+/* $OpenBSD: kroute.c,v 1.97 2017/06/28 15:23:19 krw Exp $ */
/*
* Copyright 2012 Kenneth R Westerback <krw@openbsd.org>
@@ -77,6 +77,8 @@ int create_route_label(struct sockaddr_rtlabel *);
int check_route_label(struct sockaddr_rtlabel *);
void populate_rti_info(struct sockaddr **, struct rt_msghdr *);
void delete_route(struct interface_info *, int, struct rt_msghdr *);
+int resolv_conf_priority(int);
+
#define ROUTE_LABEL_NONE 1
#define ROUTE_LABEL_NOT_DHCLIENT 2
@@ -750,7 +752,7 @@ priv_write_resolv_conf(struct interface_info *ifi, u_int8_t *contents, size_t sz
ssize_t n;
int fd;
- if (!resolv_conf_priority(ifi))
+ if (!resolv_conf_priority(ifi->rdomain))
return;
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC,
@@ -776,7 +778,7 @@ priv_write_resolv_conf(struct interface_info *ifi, u_int8_t *contents, size_t sz
* suppy the contents of the resolv.conf file.
*/
int
-resolv_conf_priority(struct interface_info *ifi)
+resolv_conf_priority(int rdomain)
{
struct iovec iov[3];
struct {
@@ -807,7 +809,7 @@ resolv_conf_priority(struct interface_info *ifi)
m_rtmsg.m_rtm.rtm_msglen = sizeof(m_rtmsg.m_rtm);
m_rtmsg.m_rtm.rtm_flags = RTF_STATIC | RTF_GATEWAY | RTF_UP;
m_rtmsg.m_rtm.rtm_seq = seq = arc4random();
- m_rtmsg.m_rtm.rtm_tableid = ifi->rdomain;
+ m_rtmsg.m_rtm.rtm_tableid = rdomain;
iov[iovcnt].iov_base = &m_rtmsg.m_rtm;
iov[iovcnt++].iov_len = sizeof(m_rtmsg.m_rtm);