SOURCES: mtr-noraw.patch - update

arekm arekm at pld-linux.org
Wed Mar 12 21:37:26 CET 2008


Author: arekm                        Date: Wed Mar 12 20:37:26 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- update

---- Files affected:
SOURCES:
   mtr-noraw.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/mtr-noraw.patch
diff -u SOURCES/mtr-noraw.patch:1.1 SOURCES/mtr-noraw.patch:1.2
--- SOURCES/mtr-noraw.patch:1.1	Wed Mar 12 21:32:27 2008
+++ SOURCES/mtr-noraw.patch	Wed Mar 12 21:37:20 2008
@@ -1,7 +1,38 @@
 diff -urN mtr-0.72.org/net.c mtr-0.72/net.c
 --- mtr-0.72.org/net.c	2006-09-29 21:31:01.000000000 +0200
-+++ mtr-0.72/net.c	2008-03-12 21:20:48.577371533 +0100
-@@ -757,11 +757,7 @@
++++ mtr-0.72/net.c	2008-03-12 21:26:21.779967188 +0100
+@@ -252,7 +252,6 @@
+ 
+   switch ( af ) {
+   case AF_INET:
+-#if !defined(IP_HDRINCL) && defined(IP_TOS) && defined(IP_TTL)
+     iphsize = 0;
+     if ( setsockopt( sendsock, IPPROTO_IP, IP_TOS, &tos, sizeof tos ) ) {
+       perror( "setsockopt IP_TOS" );
+@@ -262,22 +261,6 @@
+       perror( "setsockopt IP_TTL" );
+       exit( EXIT_FAILURE );
+     }    
+-#else
+-    iphsize = sizeof (struct IPHeader);
+-
+-  ip->version = 0x45;
+-  ip->tos = tos;
+-  ip->len = BSDfix ? abs(packetsize): htons (abs(packetsize));
+-  ip->id = 0;
+-  ip->frag = 0;    /* 1, if want to find mtu size? Min */
+-    ip->ttl = ttl;
+-  ip->protocol = IPPROTO_ICMP;
+-  ip->check = 0;
+-
+-  /* BSD needs the source address here, Linux & others do not... */
+-    addrcpy( (void *) &(ip->saddr), (void *) &(ssa4->sin_addr), AF_INET );
+-    addrcpy( (void *) &(ip->daddr), (void *) remoteaddress, AF_INET );
+-#endif
+     echotype = ICMP_ECHO;
+     salen = sizeof (struct sockaddr_in);
+     break;
+@@ -757,26 +740,13 @@
  {
    int trueopt = 1;
  
@@ -13,3 +44,18 @@
    if (sendsock4 < 0) 
      return -1;
  #ifdef ENABLE_IPV6
+   sendsock6 = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
+ #endif
+ 
+-#ifdef IP_HDRINCL
+-  /*  FreeBSD wants this to avoid sending out packets with protocol type RAW
+-      to the network.  */
+-  if (setsockopt(sendsock4, SOL_IP, IP_HDRINCL, &trueopt, sizeof(trueopt))) {
+-    perror("setsockopt(IP_HDRINCL,1)");
+-    return -1;
+-  }
+-#endif /* IP_HDRINCL */
+-
+   recvsock4 = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
+   if (recvsock4 < 0)
+     return -1;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/mtr-noraw.patch?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list