Hi,

I ran into a few issues with 2.0beta1, linux (rhel5, fc9) platforms,
trying to get slpd to handle service requests over ipv6. Here are a few things I did to get it working.

- SLPNetIsIPV4() logic change, added net.slp.useIPv4 to allow for dual
stack operation
- services from /etc/slp.reg never gets registered to ipv6 slpv2 multicast group, as their registration is 'faked' to come from a AF_INET source and thus ignored. removed this restriction! - these static multicast groups, once added, were then incorrectly cleaned up on startup!

Also a small caveat, I dont know if this a considered a 'feature' :)

Quick example. Both syntaxes below work for ipv4
% slptool findsrvs test.openslp
% slptool findsrvs service:test.openslp

However ipv6 must use the following, unless libslp is changed to prepend
'service:' (if necessary) when calculating the slp_hash.
% slptool findsrvs service:test.openslp

Patch is against 2.0beta1 but it seems to also apply to svn, but I havent tested it.

diff -ur openslp-2.0.beta1.dist/common/slp_net.c openslp-2.0.beta1/common/slp_net.c
--- openslp-2.0.beta1.dist/common/slp_net.c	2008-03-26 18:27:29.000000000 -0500
+++ openslp-2.0.beta1/common/slp_net.c	2008-07-10 14:48:55.000000000 -0500
@@ -396,7 +396,7 @@
  */
 int SLPNetIsIPV4(void)
 {
-   return SLPPropertyAsBoolean("net.slp.useIPv6")? 0: 1;
+   return SLPPropertyAsBoolean("net.slp.useIPv4")? 1: 0;
 }
 
 /** Compare two address buffers.
diff -ur openslp-2.0.beta1.dist/common/slp_property.c openslp-2.0.beta1/common/slp_property.c
--- openslp-2.0.beta1.dist/common/slp_property.c	2008-03-26 18:27:30.000000000 -0500
+++ openslp-2.0.beta1/common/slp_property.c	2008-06-03 12:44:32.000000000 -0500
@@ -156,6 +156,7 @@
 
    /* Additional properties that are specific to IPv6 */
       {"net.slp.useIPv6", "false", 0},
+      {"net.slp.useIPv4", "true", 0},
    };
 
    int i;
diff -ur openslp-2.0.beta1.dist/slpd/slpd_database.c openslp-2.0.beta1/slpd/slpd_database.c
--- openslp-2.0.beta1.dist/slpd/slpd_database.c	2008-03-26 18:27:31.000000000 -0500
+++ openslp-2.0.beta1/slpd/slpd_database.c	2008-07-10 14:50:58.000000000 -0500
@@ -184,7 +184,6 @@
 
    /* add a socket to listen for IPv6 requests if we haven't already (includes if this one was already registered) */
    if (SLPNetIsIPV6() && 
-       (msg->peer.ss_family == AF_INET6) &&
        !SLPDDatabaseSrvtypeUsed(msg->body.srvreg.srvtype, msg->body.srvreg.srvtypelen))
    {
       SLPIfaceGetInfo(G_SlpdProperty.interfaces, &ifaces, AF_INET6);
diff -ur openslp-2.0.beta1.dist/slpd/slpd_incoming.c openslp-2.0.beta1/slpd/slpd_incoming.c
--- openslp-2.0.beta1.dist/slpd/slpd_incoming.c	2008-03-26 18:27:31.000000000 -0500
+++ openslp-2.0.beta1/slpd/slpd_incoming.c	2008-07-10 15:28:12.000000000 -0500
@@ -582,12 +582,19 @@
    SLPIfaceInfo ifaces;
    int i;
 
+#if 1
+   /* 
+    * do not remove ipv6 multicast service sockets previously
+    * created from database init (slp.reg)
+    */
+#else
    /*------------------------------------------------------------*/
    /* First, remove all of the sockets that might be in the list */
    /*------------------------------------------------------------*/
    while (G_IncomingSocketList.count)
       SLPDSocketFree((SLPDSocket *)
             SLPListUnlink(&G_IncomingSocketList, G_IncomingSocketList.head));
+#endif
 
 
    /*---------------------------------------------------------*/
diff -ur openslp-2.0.beta1.dist/slpd/slpd_regfile.c openslp-2.0.beta1/slpd/slpd_regfile.c
--- openslp-2.0.beta1.dist/slpd/slpd_regfile.c	2008-03-26 21:10:03.000000000 -0500
+++ openslp-2.0.beta1/slpd/slpd_regfile.c	2008-07-10 11:48:41.000000000 -0500
@@ -500,7 +500,7 @@
     * since it's a static service 
     */
    memset(&peer, 0, sizeof(struct sockaddr_in));
-   peer.ss_family = AF_INET;
+   peer.ss_family = AF_UNSPEC;
    ((struct sockaddr_in *)&peer)->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
    result = SLPMessageParseBuffer(&peer, &peer, *buf, *msg);
    (*msg)->body.srvreg.source = SLP_REG_SOURCE_STATIC;
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Openslp-devel mailing list
Openslp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openslp-devel

Reply via email to