apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r314835 - in /apr/apr/trunk: CHANGES network_io/unix/multicast.c
Date Wed, 12 Oct 2005 10:09:49 GMT
Author: colm
Date: Wed Oct 12 03:09:42 2005
New Revision: 314835

URL: http://svn.apache.org/viewcvs?rev=314835&view=rev
Log:
Remove the mcast_check_type() check from the multicast code. This check 
prevents callers from using mSCTP, as well as any future socket types we
may support. Rather than expand the list of protocols, remove the check
entirely, in-line with the APR policy of making parameter validation the
caller's problem.

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/network_io/unix/multicast.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/CHANGES?rev=314835&r1=314834&r2=314835&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES (original)
+++ apr/apr/trunk/CHANGES Wed Oct 12 03:09:42 2005
@@ -1,5 +1,9 @@
 Changes for APR 1.3.0
 
+  *) multicast: apr_mcast_*() no longer return APR_ENOTIMPL when invoked
+     for non-UDP/RAW sockets. The caller is expected to ensure that the
+     socket-type is suitable for multicast. [Colm MacCarthaigh]
+
   *) Add apr_sockaddr_ip_getbuf() function.  [Joe Orton]
 
   *) Fix handling of %pI in apr_psprintf.  [Joe Orton]

Modified: apr/apr/trunk/network_io/unix/multicast.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/network_io/unix/multicast.c?rev=314835&r1=314834&r2=314835&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/multicast.c (original)
+++ apr/apr/trunk/network_io/unix/multicast.c Wed Oct 12 03:09:42 2005
@@ -26,25 +26,6 @@
 #endif
 
 #ifdef HAVE_STRUCT_IPMREQ
-/* Only UDP and Raw Sockets can be used for Multicast */
-static apr_status_t mcast_check_type(apr_socket_t *sock)
-{
-    int type;
-    apr_status_t rv;
-
-    rv = apr_socket_type_get(sock, &type);
-
-    if (rv != APR_SUCCESS) {
-        return rv;
-    }
-    else if (type == SOCK_DGRAM || type == SOCK_RAW) {
-        return APR_SUCCESS;
-    }
-    else {
-        return APR_ENOTIMPL;
-    }
-}
-
 static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast,
                         apr_sockaddr_t *iface)
 {
@@ -138,12 +119,6 @@
     int ip_proto;
 #endif
 
-    rv = mcast_check_type(sock);
-
-    if (rv != APR_SUCCESS) {
-        return rv;
-    }
-
     if (source != NULL) {
 #if MCAST_JOIN_SOURCE_GROUP
         if (sock_is_ipv6(sock))
@@ -214,12 +189,6 @@
                                  apr_byte_t value)
 {
     apr_status_t rv = APR_SUCCESS;
-
-    rv = mcast_check_type(sock);
-
-    if (rv != APR_SUCCESS) {
-        return rv;
-    }
 
     if (sock_is_ipv4(sock)) {
         if (setsockopt(sock->socketdes, IPPROTO_IP, type,



Mime
View raw message