[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.141 and 1.142

version 1.141, 2015/11/01 01:05:31 version 1.142, 2015/11/12 20:33:52
Line 311 
Line 311 
         argv += optind;          argv += optind;
   
         if (rtableid >= 0) {          if (rtableid >= 0) {
                 /*                  if (setrtable(rtableid) == -1)
                  * XXX No pledge if doing rtable manipulation!                          err(1, "setrtable");
                  * XXX the routing table stuff is dangerous and can't be pledged.  
                  * XXX rtable should really have a better interface than sockopt  
                  */  
         }          }
         else if (family == AF_UNIX) {          if (family == AF_UNIX) {
                 if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1)                  if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1)
                         err(1, "pledge");                          err(1, "pledge");
         }          }
Line 809 
Line 806 
                     SOCK_NONBLOCK, res0->ai_protocol)) < 0)                      SOCK_NONBLOCK, res0->ai_protocol)) < 0)
                         continue;                          continue;
   
                 if (rtableid >= 0 && (setsockopt(s, SOL_SOCKET, SO_RTABLE,  
                     &rtableid, sizeof(rtableid)) == -1))  
                         err(1, "setsockopt SO_RTABLE");  
   
                 /* Bind to a local port or source address if specified. */                  /* Bind to a local port or source address if specified. */
                 if (sflag || pflag) {                  if (sflag || pflag) {
                         struct addrinfo ahints, *ares;                          struct addrinfo ahints, *ares;
Line 908 
Line 901 
                 if ((s = socket(res0->ai_family, res0->ai_socktype,                  if ((s = socket(res0->ai_family, res0->ai_socktype,
                     res0->ai_protocol)) < 0)                      res0->ai_protocol)) < 0)
                         continue;                          continue;
   
                 if (rtableid >= 0 && (setsockopt(s, SOL_SOCKET, SO_RTABLE,  
                     &rtableid, sizeof(rtableid)) == -1))  
                         err(1, "setsockopt SO_RTABLE");  
   
                 ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));                  ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));
                 if (ret == -1)                  if (ret == -1)

Legend:
Removed from v.1.141  
changed lines
  Added in v.1.142