OSSP CVS Repository

ossp - Check-in [903]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 903
Date: 2001-Sep-10 06:27:36 (local)
2001-Sep-10 04:27:36 (UTC)
User:ms
Branch:
Comment: Removed redundant call to memset for address structures.
Tickets:
Inspections:
Files:
ossp-pkg/l2/l2_sockmon.c      1.4 -> 1.5     7 inserted, 13 deleted

ossp-pkg/l2/l2_sockmon.c 1.4 -> 1.5

--- l2_sockmon.c 2001/09/07 13:03:07     1.4
+++ l2_sockmon.c 2001/09/10 04:27:36     1.5
@@ -91,7 +91,7 @@
 int myserver(int iFamily, int iProtocol, int iPort)
 {
     char pszBuf[BUFFSIZ];
-    struct sockaddr_in  laddr4,   faddr4,    caddr4;
+    struct sockaddr_in  laddr4,   faddr4,    CADDR4;
     struct sockaddr_in6 laddr6,   faddr6,    caddr6;
     int                 iSock,    iNewsock;
     int                 iSockopt, iProtofam;
@@ -102,8 +102,7 @@
     /* Set up an IPv4 TCP socket to listen on for connections. */
     if (iFamily == AF_INET6)
     {
-        /* initialize address structures */
-        memset(&laddr6,  0, sizeof(laddr6));
+        /* initialize address structure */
         memset(&laddr6,  0, sizeof(laddr6));
 
         laddr6.sin6_family      = AF_INET6;
@@ -113,8 +112,7 @@
     }
     else if (iFamily == AF_INET)
     {
-        /* initialize address structures */
-        memset(&laddr4,  0, sizeof(laddr4));
+        /* initialize address structure */
         memset(&laddr4,  0, sizeof(laddr4));
 
         laddr4.sin_family       = AF_INET;
@@ -159,8 +157,7 @@
 
     if (iProtocol == IPPROTO_UDP) {
         if (iFamily == AF_INET6) {
-            /* initialize address structures */
-            memset(&caddr6,  0, sizeof(caddr6));
+            /* initialize address structure */
             memset(&caddr6,  0, sizeof(caddr6));
 
             for (;;) { /* Receive messages */
@@ -195,8 +192,7 @@
             }
         }
         else if (iFamily == AF_INET) {
-            /* initialize address structures */
-            memset(&caddr4,  0, sizeof(caddr4));
+            /* initialize address structure */
             memset(&caddr4,  0, sizeof(caddr4));
 
             for (;;) { /* Receive messages */
@@ -240,8 +236,7 @@
 
         /* Wait for a connection request */
         if (iFamily == AF_INET6) {
-            /* initialize address structures */
-            memset(&faddr6,  0, sizeof(faddr6));
+            /* initialize address structure */
             memset(&faddr6,  0, sizeof(faddr6));
 
             for (;;) {
@@ -259,8 +254,7 @@
             }
         }
         else if (iFamily == AF_INET) {
-            /* initialize address structures */
-            memset(&faddr4,  0, sizeof(faddr4));
+            /* initialize address structure */
             memset(&faddr4,  0, sizeof(faddr4));
 
             for (;;) {

CVSTrac 2.0.1