diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2011-06-21 17:31:08 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2011-06-21 17:31:08 +0000 |
commit | e7884bf87149523a28dac8c81b890d680655cbd8 (patch) | |
tree | 6fad4366ab0f38e88691278a55b07242076ede3d /usr.sbin | |
parent | b50edea001b4bd82ae333fbd20b35c63b80e60cc (diff) |
Convert SO_RTABLE's protocol level to the SOL_SOCKET; ok claudio
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/dhcrelay/dhcrelay.c | 6 | ||||
-rw-r--r-- | usr.sbin/ftp-proxy/ftp-proxy.c | 7 | ||||
-rw-r--r-- | usr.sbin/ospfd/interface.c | 4 | ||||
-rw-r--r-- | usr.sbin/ripd/interface.c | 4 | ||||
-rw-r--r-- | usr.sbin/traceroute/traceroute.c | 6 |
5 files changed, 13 insertions, 14 deletions
diff --git a/usr.sbin/dhcrelay/dhcrelay.c b/usr.sbin/dhcrelay/dhcrelay.c index d9cbccc9cff..fd76adde09a 100644 --- a/usr.sbin/dhcrelay/dhcrelay.c +++ b/usr.sbin/dhcrelay/dhcrelay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcrelay.c,v 1.34 2010/07/03 04:44:52 guenther Exp $ */ +/* $OpenBSD: dhcrelay.c,v 1.35 2011/06/21 17:31:07 mikeb Exp $ */ /* * Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org> @@ -176,7 +176,7 @@ main(int argc, char *argv[]) if (setsockopt(sp->fd, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)) == -1) error("setsockopt: %m"); - if (setsockopt(sp->fd, IPPROTO_IP, SO_RTABLE, &rdomain, + if (setsockopt(sp->fd, SOL_SOCKET, SO_RTABLE, &rdomain, sizeof(rdomain)) == -1) error("setsockopt: %m"); if (bind(sp->fd, (struct sockaddr *)&laddr, sizeof laddr) == -1) @@ -197,7 +197,7 @@ main(int argc, char *argv[]) if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)) == -1) error("setsockopt: %m"); - if (setsockopt(server_fd, IPPROTO_IP, SO_RTABLE, &rdomain, + if (setsockopt(server_fd, SOL_SOCKET, SO_RTABLE, &rdomain, sizeof(rdomain)) == -1) error("setsockopt: %m"); if (bind(server_fd, (struct sockaddr *)&laddr, diff --git a/usr.sbin/ftp-proxy/ftp-proxy.c b/usr.sbin/ftp-proxy/ftp-proxy.c index 2a56df3406e..c077f8e61f9 100644 --- a/usr.sbin/ftp-proxy/ftp-proxy.c +++ b/usr.sbin/ftp-proxy/ftp-proxy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftp-proxy.c,v 1.22 2011/04/28 00:17:28 mikeb Exp $ */ +/* $OpenBSD: ftp-proxy.c,v 1.23 2011/06/21 17:31:07 mikeb Exp $ */ /* * Copyright (c) 2004, 2005 Camiel Dobbelaar, <cd@sentia.nl> @@ -428,9 +428,8 @@ handle_connection(const int listen_fd, short event, void *ev) goto fail; } len = sizeof(s->client_rd); - if (client_sa->sa_family == AF_INET && - getsockopt(s->client_fd, IPPROTO_IP, SO_RTABLE, &s->client_rd, - &len)) { + if (getsockopt(s->client_fd, SOL_SOCKET, SO_RTABLE, &s->client_rd, + &len) && errno != ENOPROTOOPT) { logmsg(LOG_CRIT, "#%d getsockopt failed: %s", s->id, strerror(errno)); goto fail; diff --git a/usr.sbin/ospfd/interface.c b/usr.sbin/ospfd/interface.c index a7e30359751..ea53ed06cee 100644 --- a/usr.sbin/ospfd/interface.c +++ b/usr.sbin/ospfd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.72 2011/05/09 12:24:41 claudio Exp $ */ +/* $OpenBSD: interface.c,v 1.73 2011/06/21 17:31:07 mikeb Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -257,7 +257,7 @@ if_init(struct ospfd_conf *xconf, struct iface *iface) rdomain = 0; else { rdomain = ifr.ifr_rdomainid; - if (setsockopt(iface->fd, IPPROTO_IP, SO_RTABLE, + if (setsockopt(iface->fd, SOL_SOCKET, SO_RTABLE, &rdomain, sizeof(rdomain)) == -1) fatal("failed to set rdomain"); } diff --git a/usr.sbin/ripd/interface.c b/usr.sbin/ripd/interface.c index 5df24f922a9..c1b1c66db2c 100644 --- a/usr.sbin/ripd/interface.c +++ b/usr.sbin/ripd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.9 2010/07/03 04:44:52 guenther Exp $ */ +/* $OpenBSD: interface.c,v 1.10 2011/06/21 17:31:07 mikeb Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -83,7 +83,7 @@ if_init(struct ripd_conf *xconf, struct iface *iface) rdomain = 0; else { rdomain = ifr.ifr_rdomainid; - if (setsockopt(iface->fd, IPPROTO_IP, SO_RTABLE, &rdomain, + if (setsockopt(iface->fd, SOL_SOCKET, SO_RTABLE, &rdomain, sizeof(rdomain)) == -1) fatal("failed to set rdomain"); } diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c index 4e7e3691f6a..fef9d8d2db7 100644 --- a/usr.sbin/traceroute/traceroute.c +++ b/usr.sbin/traceroute/traceroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traceroute.c,v 1.76 2011/04/23 10:00:13 sthen Exp $ */ +/* $OpenBSD: traceroute.c,v 1.77 2011/06/21 17:31:07 mikeb Exp $ */ /* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */ /*- @@ -442,10 +442,10 @@ main(int argc, char *argv[]) if (errstr) errx(1, "rtable value is %s: %s", errstr, optarg); - if (setsockopt(sndsock, IPPROTO_IP, SO_RTABLE, + if (setsockopt(sndsock, SOL_SOCKET, SO_RTABLE, &rtableid, sizeof(rtableid)) == -1) err(1, "setsockopt SO_RTABLE"); - if (setsockopt(s, IPPROTO_IP, SO_RTABLE, + if (setsockopt(s, SOL_SOCKET, SO_RTABLE, &rtableid, sizeof(rtableid)) == -1) err(1, "setsockopt SO_RTABLE"); break; |