summaryrefslogtreecommitdiff
path: root/common/socket.c
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2015-01-19 13:25:18 -0500
committerThomas Markwalder <tmark@isc.org>2015-01-19 13:25:18 -0500
commitc2b5b5e8d424aecf8ea2bd9fc0c48d3de7fd77c2 (patch)
treefe26d138feb5ec393c1868709ff75f8c1ee29b80 /common/socket.c
parent7e35d5b1a2d156b5a279871108b11889936ffaaf (diff)
downloadisc-dhcp-c2b5b5e8d424aecf8ea2bd9fc0c48d3de7fd77c2.tar.gz
[master] Fixed inconsistencies in setting hop count limit in dhcrelay
Merges in rt37426.
Diffstat (limited to 'common/socket.c')
-rw-r--r--common/socket.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/common/socket.c b/common/socket.c
index b8b44a67..e8851b4c 100644
--- a/common/socket.c
+++ b/common/socket.c
@@ -3,7 +3,7 @@
BSD socket interface code... */
/*
- * Copyright (c) 2004-2014 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2015 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
@@ -300,18 +300,24 @@ if_register_socket(struct interface_info *info, int family,
#endif
}
- if ((family == AF_INET6) &&
- ((info->flags & INTERFACE_UPSTREAM) != 0)) {
- int hop_limit = 32;
- if (setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
- &hop_limit, sizeof(int)) < 0) {
- log_fatal("setsockopt: IPV6_MULTICAST_HOPS: %m");
- }
- }
#endif /* DHCPv6 */
return sock;
}
+
+#ifdef DHCPv6
+void set_multicast_hop_limit(struct interface_info* info, int hop_limit) {
+ if (setsockopt(info->wfdesc, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
+ &hop_limit, sizeof(int)) < 0) {
+ log_fatal("setMulticaseHopLimit: IPV6_MULTICAST_HOPS: %m");
+ }
+
+ log_debug("Setting hop count limit to %d for interface %s",
+ hop_limit, info->name);
+
+}
+#endif /* DHCPv6 */
+
#endif /* USE_SOCKET_SEND || USE_SOCKET_RECEIVE || USE_SOCKET_FALLBACK */
#if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_FALLBACK)