summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ripd/interface.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/ripd/interface.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/ripd/interface.c')
-rw-r--r--usr.sbin/ripd/interface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ripd/interface.c b/usr.sbin/ripd/interface.c
index 1960251ecd2..5df24f922a9 100644
--- a/usr.sbin/ripd/interface.c
+++ b/usr.sbin/ripd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.8 2009/09/26 18:24:58 michele Exp $ */
+/* $OpenBSD: interface.c,v 1.9 2010/07/03 04:44:52 guenther Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -79,11 +79,11 @@ if_init(struct ripd_conf *xconf, struct iface *iface)
iface->fd = xconf->rip_socket;
strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name));
- if (ioctl(iface->fd, SIOCGIFRTABLEID, (caddr_t)&ifr) == -1)
+ if (ioctl(iface->fd, SIOCGIFRDOMAIN, (caddr_t)&ifr) == -1)
rdomain = 0;
else {
rdomain = ifr.ifr_rdomainid;
- if (setsockopt(iface->fd, IPPROTO_IP, SO_RDOMAIN, &rdomain,
+ if (setsockopt(iface->fd, IPPROTO_IP, SO_RTABLE, &rdomain,
sizeof(rdomain)) == -1)
fatal("failed to set rdomain");
}