[BACK]Return to netcat.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / nc

Diff for /src/usr.bin/nc/netcat.c between version 1.138 and 1.139

version 1.138, 2015/09/13 11:12:09 version 1.139, 2015/10/11 00:26:23
Line 57 
Line 57 
 #include <tls.h>  #include <tls.h>
 #include "atomicio.h"  #include "atomicio.h"
   
 #ifndef SUN_LEN  
 #define SUN_LEN(su) \  
         (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))  
 #endif  
   
 #define PORT_MAX        65535  #define PORT_MAX        65535
 #define PORT_MAX_LEN    6  #define PORT_MAX_LEN    6
 #define UNIX_DG_TMP_SOCKET_SIZE 19  #define UNIX_DG_TMP_SOCKET_SIZE 19
Line 646 
Line 641 
                 return (-1);                  return (-1);
         }          }
   
         if (bind(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) {          if (bind(s, (struct sockaddr *)&sun, sizeof(sun)) < 0) {
                 close(s);                  close(s);
                 return (-1);                  return (-1);
         }          }
Line 741 
Line 736 
                 errno = ENAMETOOLONG;                  errno = ENAMETOOLONG;
                 return (-1);                  return (-1);
         }          }
         if (connect(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) {          if (connect(s, (struct sockaddr *)&sun, sizeof(sun)) < 0) {
                 close(s);                  close(s);
                 return (-1);                  return (-1);
         }          }

Legend:
Removed from v.1.138  
changed lines
  Added in v.1.139