summaryrefslogtreecommitdiff
path: root/net/iperf/patches/patch-ab
blob: 6844deeb4940664280c07b370228305560c4404f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$NetBSD: patch-ab,v 1.1 2005/10/07 20:29:52 markd Exp $

--- src/Listener.cpp.orig	2005-05-03 08:09:27.000000000 +1200
+++ src/Listener.cpp
@@ -369,6 +369,9 @@ void Listener::McastJoin( ) {
         WARN_errno( rc == SOCKET_ERROR, "multicast join" );
     }
 #ifdef HAVE_IPV6_MULTICAST
+#if !defined(IPV6_ADD_MEMBERSHIP) && defined(IPV6_JOIN_GROUP)
+#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+#endif
       else {
         struct ipv6_mreq mreq;
 
@@ -393,8 +396,9 @@ void Listener::McastJoin( ) {
 void Listener::McastSetTTL( int val ) {
 #ifdef HAVE_MULTICAST
     if ( !SockAddr_isIPv6( &mSettings->local ) ) {
+        u_char uval = val;
         int rc = setsockopt( mSettings->mSock, IPPROTO_IP, IP_MULTICAST_TTL,
-                             (char*) &val, sizeof(val));
+                             (char*) &uval, sizeof(uval));
         WARN_errno( rc == SOCKET_ERROR, "multicast ttl" );
     }
 #ifdef HAVE_IPV6_MULTICAST