File v1dadiscovery.diff of Package openslp

--- ./common/slp_v1message.c.orig	2002-12-03 21:04:50.000000000 +0000
+++ ./common/slp_v1message.c	2004-12-03 18:48:44.740573934 +0000
@@ -40,6 +40,7 @@
 
 #include "slp_v1message.h"
 #include "slp_utf8.h"
+#include "slp_compare.h"
 
 /* Implementation Note:
  * 
@@ -215,7 +216,8 @@
     srvrqst->predicate += srvrqst->srvtypelen + 1;
 
     /* Now split out the scope (if any) */
-    if(*srvrqst->predicate == '/')
+    /* Special case DA discovery, empty scope is allowed here */
+    if(*srvrqst->predicate == '/' && SLPCompareString(srvrqst->srvtypelen, srvrqst->srvtype, 15, "directory-agent") != 0)
     {
         /* no scope - so set default scope */
         srvrqst->scopelist = "default";
--- ./slpd/slpd_v1process.c.orig	2004-12-03 18:49:08.656163167 +0000
+++ ./slpd/slpd_v1process.c	2004-12-03 19:10:09.159293506 +0000
@@ -76,25 +76,32 @@
                        int errorcode)
 /*-------------------------------------------------------------------------*/
 {
-    if (message->body.srvrqst.scopelistlen == 0 ||
-        SLPIntersectStringList(message->body.srvrqst.scopelistlen,
-                               message->body.srvrqst.scopelist,
-                               G_SlpdProperty.useScopesLen,
-                               G_SlpdProperty.useScopes))
+    if (G_SlpdProperty.isDA)
     {
-        /* fill out real structure */
-        errorcode = SLPDKnownDAGenerateMyV1DAAdvert(errorcode,
-                                                    message->header.encoding,
-                                                    message->header.xid,
-                                                    sendbuf);
+	if (message->body.srvrqst.scopelistlen == 0 ||
+	    SLPIntersectStringList(message->body.srvrqst.scopelistlen,
+				   message->body.srvrqst.scopelist,
+				   G_SlpdProperty.useScopesLen,
+				   G_SlpdProperty.useScopes))
+	{
+	    /* fill out real structure */
+	    errorcode = SLPDKnownDAGenerateMyV1DAAdvert(errorcode,
+							message->header.encoding,
+							message->header.xid,
+							sendbuf);
+	}
+	else
+	{
+	    errorcode =  SLP_ERROR_SCOPE_NOT_SUPPORTED;
+	}
     }
     else
     {
-        errorcode =  SLP_ERROR_SCOPE_NOT_SUPPORTED;
+	errorcode = SLP_ERROR_MESSAGE_NOT_SUPPORTED;
     }
 
     /* don't return errorcodes to multicast messages */
-    if (errorcode == 0)
+    if (errorcode != 0)
     {
         if (message->header.flags & SLP_FLAG_MCAST ||
             ISMCAST(peeraddr->sin_addr))