OSSP CVS Repository

ossp - Difference in ossp-pkg/sa/sa.c versions 1.15 and 1.16
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/sa/sa.c 1.15 -> 1.16

--- sa.c 2001/10/09 13:19:25     1.15
+++ sa.c 2001/10/09 14:05:55     1.16
@@ -706,7 +706,7 @@
     return SA_OK;
 }
 
-sa_rc_t sa_addr_match(sa_addr_t *saa1, sa_addr_t *saa2, size_t prefixlen)
+sa_rc_t sa_addr_match(sa_addr_t *saa1, sa_addr_t *saa2, int prefixlen)
 {
     const unsigned char *ucp1, *ucp2;
     unsigned int uc1, uc2, mask;
@@ -716,7 +716,7 @@
     int nBits;
 
     /* argument sanity check(s) */
-    if (saa1 == NULL || saa2 == NULL)
+    if (saa1 == NULL || saa2 == NULL || prefixlen < -1)
         return SA_ERR_ARG;
 
     /* match short circuiting */
@@ -730,7 +730,7 @@
         ucp2 = (const unsigned char *)(((struct sockaddr_un *)saa2->saBuf)->sun_path);
         l1 = strlen(((struct sockaddr_un *)saa1->saBuf)->sun_path) * 8;
         l2 = strlen(((struct sockaddr_un *)saa2->saBuf)->sun_path) * 8;
-        if (prefixlen == 0) {
+        if (prefixlen == -1) {
             if (l1 != l2)
                 return SA_ERR_MTC;
             nBits = l1;
@@ -761,7 +761,7 @@
         return SA_ERR_ARG;
 
     /* support equal matching (= all bits) */
-    if (prefixlen == 0)
+    if (prefixlen == -1)
         prefixlen = nBits;
 
     /* perform address representation comparison 

CVSTrac 2.0.1