Advertisement
Guest User

ping.c.patch

a guest
Dec 19th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.98 KB | None | 0 0
  1. thuovila@kone:~/src/misc/misc$ diff -u ping.c /tmp/ping.c
  2. --- ping.c  2014-12-19 12:44:21.927164702 +0200
  3. +++ /tmp/ping.c 1988-03-23 09:43:17.000000000 +0200
  4. @@ -353,7 +353,7 @@
  5.         if( pingflags & VERBOSE )
  6.             printf("packet too short (%d bytes) from %s\n", cc,
  7.                 inet_ntoa(ntohl(from->sin_addr.s_addr)));
  8. -       return 0;
  9. +       return;
  10.     }
  11.  
  12.     /* Now the ICMP part */
  13. @@ -361,7 +361,7 @@
  14.     icp = (struct icmp *)(buf + hlen);
  15.     if( icp->icmp_type == ICMP_ECHOREPLY ) {
  16.         if( icp->icmp_id != ident )
  17. -           return 0;           /* 'Twas not our ECHO */
  18. +           return;         /* 'Twas not our ECHO */
  19.  
  20.         nreceived++;
  21.         if (timing) {
  22. @@ -380,7 +380,7 @@
  23.         }
  24.  
  25.         if( pingflags & QUIET )
  26. -           return 0;
  27. +           return;
  28.  
  29.         if( pingflags & FLOOD ) {
  30.             putchar('\b');
  31. @@ -397,7 +397,7 @@
  32.     } else {
  33.         /* We've got something other than an ECHOREPLY */
  34.         if( !(pingflags & VERBOSE) )
  35. -           return 0;
  36. +           return;
  37.  
  38.         printf("%d bytes from %s: ",
  39.           cc, pr_addr(ntohl(from->sin_addr.s_addr)) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement