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

Diff for /src/usr.bin/ssh/canohost.c between version 1.21 and 1.22

version 1.21, 2001/02/08 19:30:51 version 1.22, 2001/02/08 22:37:10
Line 120 
Line 120 
 void  void
 check_ip_options(int socket, char *ipaddr)  check_ip_options(int socket, char *ipaddr)
 {  {
         u_char options[200], *ucp;          u_char options[200];
         char text[1024], *cp;          char text[sizeof(options) * 3 + 1];
         socklen_t option_size;          socklen_t option_size;
         int ipproto;          int i, ipproto;
         struct protoent *ip;          struct protoent *ip;
   
         if ((ip = getprotobyname("ip")) != NULL)          if ((ip = getprotobyname("ip")) != NULL)
Line 133 
Line 133 
         option_size = sizeof(options);          option_size = sizeof(options);
         if (getsockopt(socket, ipproto, IP_OPTIONS, (void *)options,          if (getsockopt(socket, ipproto, IP_OPTIONS, (void *)options,
             &option_size) >= 0 && option_size != 0) {              &option_size) >= 0 && option_size != 0) {
                 cp = text;                  text[0] = '\0';
                 /* Note: "text" buffer must be at least 3x as big as options. */                  for (i = 0; i < option_size; i++)
                 for (ucp = options; option_size > 0; ucp++, option_size--, cp += 3)                          snprintf(text + i*3, sizeof(text) - i*3,
                         sprintf(cp, " %2.2x", *ucp);                              " %2.2x", options[i]);
                 log("Connection from %.100s with IP options:%.800s",                  log("Connection from %.100s with IP options:%.800s",
                     ipaddr, text);                      ipaddr, text);
                 packet_disconnect("Connection from %.100s with IP options:%.800s",                  packet_disconnect("Connection from %.100s with IP options:%.800s",

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22