OSSP CVS Repository

ossp - Difference in ossp-pkg/l2/l2_ut_sa.c versions 1.27 and 1.28
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/l2/l2_ut_sa.c 1.27 -> 1.28

--- l2_ut_sa.c   2005/02/02 12:26:44     1.27
+++ l2_ut_sa.c   2005/10/03 08:00:16     1.28
@@ -267,14 +267,16 @@
            and for IPv6 inet_pton(3) would exist anyway */
         if (inet_aton(strptr, &in_val) == 0)
             return 0;
+        memcpy(addrptr, &in_val, sizeof(struct in_addr));
+        return 1;
 #elif defined(HAVE_INET_ADDR)
         /* at least for IPv4 try to rely on the even older inet_addr(3) */
         memset(&in_val, '\0', sizeof(in_val));
         if ((in_val.s_addr = inet_addr(strptr)) == ((in_addr_t)-1))
             return 0;
-#endif
         memcpy(addrptr, &in_val, sizeof(struct in_addr));
         return 1;
+#endif
     }
     errno = EAFNOSUPPORT;
     return 0;
@@ -732,7 +734,7 @@
 }
 
 /* export address object into URI */
-sa_rc_t sa_addr_a2u(sa_addr_t *saa, char **uri)
+sa_rc_t sa_addr_a2u(const sa_addr_t *saa, char **uri)
 {
     char uribuf[1024];
     struct sockaddr_un *un;
@@ -793,7 +795,7 @@
 }
 
 /* export address object into "struct sockaddr" */
-sa_rc_t sa_addr_a2s(sa_addr_t *saa, struct sockaddr **sabuf, socklen_t *salen)
+sa_rc_t sa_addr_a2s(const sa_addr_t *saa, struct sockaddr **sabuf, socklen_t *salen)
 {
     /* argument sanity check(s) */
     if (saa == NULL || sabuf == NULL || salen == 0)
@@ -808,7 +810,7 @@
     return SA_OK;
 }
 
-sa_rc_t sa_addr_match(sa_addr_t *saa1, sa_addr_t *saa2, int prefixlen)
+sa_rc_t sa_addr_match(const sa_addr_t *saa1, const sa_addr_t *saa2, int prefixlen)
 {
     const unsigned char *ucp1, *ucp2;
     unsigned int uc1, uc2, mask;
@@ -934,7 +936,7 @@
 }
 
 /* set timeouts if timeouts or done in kernel */
-static sa_rc_t sa_socket_settimeouts(sa_t *sa)
+static sa_rc_t sa_socket_settimeouts(const sa_t *sa)
 {
     /* stop processing if socket is still not allocated */
     if (sa->fdSocket == -1)
@@ -1222,7 +1224,7 @@
 
     /* kill underlying socket if type changes */
     if (sa->eType != type)
-        sa_socket_kill(sa);
+        (void)sa_socket_kill(sa);
 
     /* set new type */
     sa->eType = type;
@@ -1421,7 +1423,7 @@
 }
 
 /* bind socket to a local address */
-sa_rc_t sa_bind(sa_t *sa, sa_addr_t *laddr)
+sa_rc_t sa_bind(sa_t *sa, const sa_addr_t *laddr)
 {
     sa_rc_t rv;
     struct sockaddr_un *un;
@@ -1449,7 +1451,7 @@
 }
 
 /* connect socket to a remote address */
-sa_rc_t sa_connect(sa_t *sa, sa_addr_t *raddr)
+sa_rc_t sa_connect(sa_t *sa, const sa_addr_t *raddr)
 {
     int flags, n, error;
     fd_set rset, wset;
@@ -2131,7 +2133,7 @@
 }
 
 /* shutdown a socket connection */
-sa_rc_t sa_shutdown(sa_t *sa, char *flags)
+sa_rc_t sa_shutdown(sa_t *sa, const char *flags)
 {
     int how;
 

CVSTrac 2.0.1