summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2019-01-22 09:25:30 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2019-01-22 09:25:30 +0000
commitf510e60a932c248b782e0217055433775b7f1bbf (patch)
tree3c0a341e1946064b8468bb29d0dfa9f0b63e6a05 /usr.sbin
parentb13e6a05b26f1b7259902e126de9350a99cd6fc8 (diff)
PF_ROUTE -> AF_ROUTE in the scattered sock()/setsockopt() calls
where the "wrong" #define was used. ok dlg@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/arp/arp.c6
-rw-r--r--usr.sbin/ifstated/ifstated.c8
-rw-r--r--usr.sbin/ldpd/kroute.c4
-rw-r--r--usr.sbin/ndp/ndp.c6
-rw-r--r--usr.sbin/npppd/npppd/npppd_subr.c4
-rw-r--r--usr.sbin/pppd/sys-bsd.c8
-rw-r--r--usr.sbin/rad/rad.c6
-rw-r--r--usr.sbin/rarpd/arptab.c4
-rw-r--r--usr.sbin/route6d/route6d.c4
-rw-r--r--usr.sbin/sasyncd/carp.c6
-rw-r--r--usr.sbin/snmpd/kroute.c4
11 files changed, 30 insertions, 30 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c
index b424ef06ad0..f2ef04aa133 100644
--- a/usr.sbin/arp/arp.c
+++ b/usr.sbin/arp/arp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arp.c,v 1.81 2018/04/26 12:42:51 guenther Exp $ */
+/* $OpenBSD: arp.c,v 1.82 2019/01/22 09:25:29 krw Exp $ */
/* $NetBSD: arp.c,v 1.12 1995/04/24 13:25:18 cgd Exp $ */
/*
@@ -244,10 +244,10 @@ getsocket(void)
if (rtsock >= 0)
return;
- rtsock = socket(PF_ROUTE, SOCK_RAW, 0);
+ rtsock = socket(AF_ROUTE, SOCK_RAW, 0);
if (rtsock < 0)
err(1, "routing socket");
- if (setsockopt(rtsock, PF_ROUTE, ROUTE_TABLEFILTER, &rdomain, len) < 0)
+ if (setsockopt(rtsock, AF_ROUTE, ROUTE_TABLEFILTER, &rdomain, len) < 0)
err(1, "ROUTE_TABLEFILTER");
if (pledge("stdio dns", NULL) == -1)
diff --git a/usr.sbin/ifstated/ifstated.c b/usr.sbin/ifstated/ifstated.c
index 32cf2f857cc..c35984c479f 100644
--- a/usr.sbin/ifstated/ifstated.c
+++ b/usr.sbin/ifstated/ifstated.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifstated.c,v 1.62 2018/10/31 07:39:13 mestre Exp $ */
+/* $OpenBSD: ifstated.c,v 1.63 2019/01/22 09:25:29 krw Exp $ */
/*
* Copyright (c) 2004 Marco Pfatschbacher <mpf@openbsd.org>
@@ -148,16 +148,16 @@ main(int argc, char *argv[])
log_init(debug, LOG_DAEMON);
log_setverbose(opts & IFSD_OPT_VERBOSE);
- if ((rt_fd = socket(PF_ROUTE, SOCK_RAW, 0)) < 0)
+ if ((rt_fd = socket(AF_ROUTE, SOCK_RAW, 0)) < 0)
fatal("no routing socket");
rtfilter = ROUTE_FILTER(RTM_IFINFO) | ROUTE_FILTER(RTM_IFANNOUNCE);
- if (setsockopt(rt_fd, PF_ROUTE, ROUTE_MSGFILTER,
+ if (setsockopt(rt_fd, AF_ROUTE, ROUTE_MSGFILTER,
&rtfilter, sizeof(rtfilter)) == -1) /* not fatal */
log_warn("%s: setsockopt msgfilter", __func__);
rtfilter = RTABLE_ANY;
- if (setsockopt(rt_fd, PF_ROUTE, ROUTE_TABLEFILTER,
+ if (setsockopt(rt_fd, AF_ROUTE, ROUTE_TABLEFILTER,
&rtfilter, sizeof(rtfilter)) == -1) /* not fatal */
log_warn("%s: setsockopt tablefilter", __func__);
diff --git a/usr.sbin/ldpd/kroute.c b/usr.sbin/ldpd/kroute.c
index 5eabbb7d83c..f04e3de8638 100644
--- a/usr.sbin/ldpd/kroute.c
+++ b/usr.sbin/ldpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.67 2018/01/03 19:39:07 denis Exp $ */
+/* $OpenBSD: kroute.c,v 1.68 2019/01/22 09:25:29 krw Exp $ */
/*
* Copyright (c) 2015, 2016 Renato Westphal <renato@openbsd.org>
@@ -171,7 +171,7 @@ kr_init(int fs, unsigned int rdomain)
ROUTE_FILTER(RTM_IFINFO) | ROUTE_FILTER(RTM_NEWADDR) |
ROUTE_FILTER(RTM_DELADDR) | ROUTE_FILTER(RTM_IFANNOUNCE);
- if (setsockopt(kr_state.fd, PF_ROUTE, ROUTE_MSGFILTER,
+ if (setsockopt(kr_state.fd, AF_ROUTE, ROUTE_MSGFILTER,
&rtfilter, sizeof(rtfilter)) == -1)
log_warn("%s: setsockopt(ROUTE_MSGFILTER)", __func__);
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index 95a60ed915a..2791d8b0375 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndp.c,v 1.91 2019/01/21 08:16:47 kn Exp $ */
+/* $OpenBSD: ndp.c,v 1.92 2019/01/22 09:25:29 krw Exp $ */
/* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */
/*
@@ -288,10 +288,10 @@ getsocket(void)
if (rtsock >= 0)
return;
- rtsock = socket(PF_ROUTE, SOCK_RAW, 0);
+ rtsock = socket(AF_ROUTE, SOCK_RAW, 0);
if (rtsock < 0)
err(1, "routing socket");
- if (setsockopt(rtsock, PF_ROUTE, ROUTE_TABLEFILTER, &rdomain, len) < 0)
+ if (setsockopt(rtsock, AF_ROUTE, ROUTE_TABLEFILTER, &rdomain, len) < 0)
err(1, "ROUTE_TABLEFILTER");
if (pledge("stdio dns", NULL) == -1)
diff --git a/usr.sbin/npppd/npppd/npppd_subr.c b/usr.sbin/npppd/npppd/npppd_subr.c
index 2c207c6a3ff..213d3b50689 100644
--- a/usr.sbin/npppd/npppd/npppd_subr.c
+++ b/usr.sbin/npppd/npppd/npppd_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: npppd_subr.c,v 1.18 2016/04/05 21:24:02 krw Exp $ */
+/* $OpenBSD: npppd_subr.c,v 1.19 2019/01/22 09:25:29 krw Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
@@ -225,7 +225,7 @@ in_route0(int type, struct in_addr *dest, struct in_addr *mask,
rtm->rtm_msglen = cp - buf;
- if ((sock = priv_socket(PF_ROUTE, SOCK_RAW, AF_UNSPEC)) < 0) {
+ if ((sock = priv_socket(AF_ROUTE, SOCK_RAW, AF_UNSPEC)) < 0) {
log_printf(LOG_ERR, "socket() failed in %s() on %s : %m",
__func__, strtype);
goto fail;
diff --git a/usr.sbin/pppd/sys-bsd.c b/usr.sbin/pppd/sys-bsd.c
index 5d9b949e6fa..69ca841d213 100644
--- a/usr.sbin/pppd/sys-bsd.c
+++ b/usr.sbin/pppd/sys-bsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys-bsd.c,v 1.27 2015/09/12 12:42:36 miod Exp $ */
+/* $OpenBSD: sys-bsd.c,v 1.28 2019/01/22 09:25:29 krw Exp $ */
/*
* sys-bsd.c - System-dependent procedures for setting up
@@ -1117,7 +1117,7 @@ dodefaultroute(g, cmd)
struct sockaddr_in mask;
} rtmsg;
- if ((routes = socket(PF_ROUTE, SOCK_RAW, AF_INET)) < 0) {
+ if ((routes = socket(AF_ROUTE, SOCK_RAW, AF_INET)) < 0) {
syslog(LOG_ERR, "Couldn't %s default route: socket: %m",
cmd=='s'? "add": "delete");
return 0;
@@ -1181,7 +1181,7 @@ sifproxyarp(unit, hisaddr)
return 0;
}
- if ((routes = socket(PF_ROUTE, SOCK_RAW, AF_INET)) < 0) {
+ if ((routes = socket(AF_ROUTE, SOCK_RAW, AF_INET)) < 0) {
syslog(LOG_ERR, "Couldn't add proxy arp entry: socket: %m");
return 0;
}
@@ -1228,7 +1228,7 @@ cifproxyarp(unit, hisaddr)
arpmsg.hdr.rtm_type = RTM_DELETE;
arpmsg.hdr.rtm_seq = ++rtm_seq;
- if ((routes = socket(PF_ROUTE, SOCK_RAW, AF_INET)) < 0) {
+ if ((routes = socket(AF_ROUTE, SOCK_RAW, AF_INET)) < 0) {
syslog(LOG_ERR, "Couldn't delete proxy arp entry: socket: %m");
return 0;
}
diff --git a/usr.sbin/rad/rad.c b/usr.sbin/rad/rad.c
index 0f936a06037..d7d9f21f98a 100644
--- a/usr.sbin/rad/rad.c
+++ b/usr.sbin/rad/rad.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rad.c,v 1.16 2018/09/16 08:53:02 bluhm Exp $ */
+/* $OpenBSD: rad.c,v 1.17 2019/01/22 09:25:29 krw Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -286,13 +286,13 @@ main(int argc, char *argv[])
sizeof(filt)) == -1)
fatal("ICMP6_FILTER");
- if ((frontend_routesock = socket(PF_ROUTE, SOCK_RAW | SOCK_CLOEXEC,
+ if ((frontend_routesock = socket(AF_ROUTE, SOCK_RAW | SOCK_CLOEXEC,
AF_INET6)) < 0)
fatal("route socket");
rtfilter = ROUTE_FILTER(RTM_IFINFO) | ROUTE_FILTER(RTM_NEWADDR) |
ROUTE_FILTER(RTM_DELADDR);
- if (setsockopt(frontend_routesock, PF_ROUTE, ROUTE_MSGFILTER,
+ if (setsockopt(frontend_routesock, AF_ROUTE, ROUTE_MSGFILTER,
&rtfilter, sizeof(rtfilter)) < 0)
fatal("setsockopt(ROUTE_MSGFILTER)");
diff --git a/usr.sbin/rarpd/arptab.c b/usr.sbin/rarpd/arptab.c
index 44526e86c98..86e86e70e9c 100644
--- a/usr.sbin/rarpd/arptab.c
+++ b/usr.sbin/rarpd/arptab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arptab.c,v 1.29 2018/04/26 12:42:51 guenther Exp $ */
+/* $OpenBSD: arptab.c,v 1.30 2019/01/22 09:25:29 krw Exp $ */
/*
* Copyright (c) 1984, 1993
@@ -72,7 +72,7 @@ int rtget(struct sockaddr_inarp **, struct sockaddr_dl **);
void
arptab_init(void)
{
- s = socket(PF_ROUTE, SOCK_RAW, 0);
+ s = socket(AF_ROUTE, SOCK_RAW, 0);
if (s < 0)
err(1, "arp: socket");
}
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c
index 9289660c8a9..e33a17ae3bf 100644
--- a/usr.sbin/route6d/route6d.c
+++ b/usr.sbin/route6d/route6d.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route6d.c,v 1.97 2018/07/11 20:38:57 claudio Exp $ */
+/* $OpenBSD: route6d.c,v 1.98 2019/01/22 09:25:29 krw Exp $ */
/* $KAME: route6d.c,v 1.111 2006/10/25 06:38:13 jinmei Exp $ */
/*
@@ -587,7 +587,7 @@ init(void)
pfd[0].events = POLLIN;
if (nflag == 0) {
- if ((rtsock = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) {
+ if ((rtsock = socket(AF_ROUTE, SOCK_RAW, 0)) < 0) {
fatal("route socket");
/*NOTREACHED*/
}
diff --git a/usr.sbin/sasyncd/carp.c b/usr.sbin/sasyncd/carp.c
index 358e807939e..ae18c5593e7 100644
--- a/usr.sbin/sasyncd/carp.c
+++ b/usr.sbin/sasyncd/carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: carp.c,v 1.16 2017/08/31 16:19:22 otto Exp $ */
+/* $OpenBSD: carp.c,v 1.17 2019/01/22 09:25:29 krw Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -247,14 +247,14 @@ carp_init(void)
return -1;
}
- cfgstate.route_socket = socket(PF_ROUTE, SOCK_RAW, 0);
+ cfgstate.route_socket = socket(AF_ROUTE, SOCK_RAW, 0);
if (cfgstate.route_socket < 0) {
fprintf(stderr, "No routing socket\n");
return -1;
}
rtfilter = ROUTE_FILTER(RTM_IFINFO);
- if (setsockopt(cfgstate.route_socket, PF_ROUTE, ROUTE_MSGFILTER,
+ if (setsockopt(cfgstate.route_socket, AF_ROUTE, ROUTE_MSGFILTER,
&rtfilter, sizeof(rtfilter)) == -1) /* not fatal */
log_msg(2, "carp_init: setsockopt");
diff --git a/usr.sbin/snmpd/kroute.c b/usr.sbin/snmpd/kroute.c
index 50e3fb8a878..c1af1548b71 100644
--- a/usr.sbin/snmpd/kroute.c
+++ b/usr.sbin/snmpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.37 2018/12/07 08:40:54 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.38 2019/01/22 09:25:29 krw Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
@@ -171,7 +171,7 @@ kr_init(void)
&opt, sizeof(opt)) == -1)
log_warn("%s: SO_USELOOPBACK", __func__); /* not fatal */
- if (snmpd_env->sc_rtfilter && setsockopt(kr_state.ks_fd, PF_ROUTE,
+ if (snmpd_env->sc_rtfilter && setsockopt(kr_state.ks_fd, AF_ROUTE,
ROUTE_MSGFILTER, &snmpd_env->sc_rtfilter,
sizeof(snmpd_env->sc_rtfilter)) == -1)
log_warn("%s: ROUTE_MSGFILTER", __func__);