summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcrelay/dhcrelay.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2010-07-03 04:44:50 +0000
committerguenther <guenther@openbsd.org>2010-07-03 04:44:50 +0000
commit8bb39f085984c8f31e98e59d88cab46a5aa1548e (patch)
tree841fb14fb8115333f08970c7eca7ab1ad359933b /usr.sbin/dhcrelay/dhcrelay.c
parentRegen. (diff)
downloadwireguard-openbsd-8bb39f085984c8f31e98e59d88cab46a5aa1548e.tar.xz
wireguard-openbsd-8bb39f085984c8f31e98e59d88cab46a5aa1548e.zip
Fix the naming of interfaces and variables for rdomains and rtables
and make it possible to bind sockets (including listening sockets!) to rtables and not just rdomains. This changes the name of the system calls, socket option, and ioctl. After building with this you should remove the files /usr/share/man/cat2/[gs]etrdomain.0. Since this removes the existing [gs]etrdomain() system calls, the libc major is bumped. Written by claudio@, criticized^Wcritiqued by me
Diffstat (limited to 'usr.sbin/dhcrelay/dhcrelay.c')
-rw-r--r--usr.sbin/dhcrelay/dhcrelay.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/dhcrelay/dhcrelay.c b/usr.sbin/dhcrelay/dhcrelay.c
index 0799b0b4e98..d9cbccc9cff 100644
--- a/usr.sbin/dhcrelay/dhcrelay.c
+++ b/usr.sbin/dhcrelay/dhcrelay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcrelay.c,v 1.33 2009/11/03 10:14:09 claudio Exp $ */
+/* $OpenBSD: dhcrelay.c,v 1.34 2010/07/03 04:44:52 guenther 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_RDOMAIN, &rdomain,
+ if (setsockopt(sp->fd, IPPROTO_IP, 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_RDOMAIN, &rdomain,
+ if (setsockopt(server_fd, IPPROTO_IP, SO_RTABLE, &rdomain,
sizeof(rdomain)) == -1)
error("setsockopt: %m");
if (bind(server_fd, (struct sockaddr *)&laddr,
@@ -501,7 +501,7 @@ get_rdomain(char *name)
bzero(&ifr, sizeof(ifr));
strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
- if (ioctl(s, SIOCGIFRTABLEID, (caddr_t)&ifr) != -1)
+ if (ioctl(s, SIOCGIFRDOMAIN, (caddr_t)&ifr) != -1)
rv = ifr.ifr_rdomainid;
close(s);