Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1584248
 поиск   регистрация   авторизация 
 
Группа :: Система/Основа
Пакет: xinetd

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: xinetd-2.3.14-cvs-20051128.patch


Index: CHANGELOG
===================================================================
RCS file: /cvs/xinetd/xinetd/CHANGELOG,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -p -a -r1.47 -r1.48
--- CHANGELOG	11 Oct 2005 16:07:17 -0000	1.47
+++ CHANGELOG	28 Nov 2005 16:54:43 -0000	1.48
@@ -907,3 +907,7 @@ This file describes the changes to xinet
 		Based on a patch from Tony Ernst.
 	Remove the <1024 port check for UDP builtin services.
 		This check has been rather antiquated for years.
+
+devel
+	If the address we're binding to is a multicast address, do the
+		multicast join.
Index: xinetd/service.c
===================================================================
RCS file: /cvs/xinetd/xinetd/xinetd/service.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -a -r1.26 -r1.27
--- xinetd/service.c	8 Apr 2005 21:23:07 -0000	1.26
+++ xinetd/service.c	28 Nov 2005 16:54:43 -0000	1.27
@@ -200,7 +200,7 @@ static status_e activate_rpc( struct ser
       return( FAILED ) ;
    }
    
-   if( tsin.sa.sa_family == AF_INET ) 
+   if( tsin.sa.sa_family == AF_INET )
       SC_SET_PORT( scp, ntohs( tsin.sa_in.sin_port ) ) ;
    else if( tsin.sa.sa_family == AF_INET6 )
       SC_SET_PORT( scp, ntohs( tsin.sa_in6.sin6_port ) ) ;
@@ -301,6 +301,17 @@ static status_e activate_normal( struct 
       return( FAILED ) ;
    }
 
+#ifdef IN_MULTICAST
+   if( SC_IPV4(scp) && IN_MULTICAST(tsin.sa_in.sin_addr.s_addr) ) {
+      struct ip_mreq mreq;
+      mreq.imr_multiaddr.s_addr = tsin.sa_in.sin_addr.s_addr;
+      mreq.imr_interface.s_addr = htonl(INADDR_ANY);
+      setsockopt(sd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq));
+      if ( debug.on )
+         msg( LOG_DEBUG, func, "Adding multicast membership." );
+   }
+#endif
+
    return( OK ) ;
 }
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005