diff options
Diffstat (limited to 'debian/patches/72_traceroute_fix_setsockopt.patch')
-rw-r--r-- | debian/patches/72_traceroute_fix_setsockopt.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/debian/patches/72_traceroute_fix_setsockopt.patch b/debian/patches/72_traceroute_fix_setsockopt.patch new file mode 100644 index 0000000..2f86a89 --- /dev/null +++ b/debian/patches/72_traceroute_fix_setsockopt.patch @@ -0,0 +1,64 @@ +Description: Use integer arguments to setsockopt(). + GNU/kFreeBSD must pass an integer argument with IP_TTL + in setsockopt(2). Thsi has no ill effect with GNU/Linux. + . + The change is backported from upstream git repository. +Author: Mats Erik Andersson <debian@gisladisker.se> +Forwarded: not-needed +Last-Update: 2011-01-18 + +--- inetutils-1.8/src/traceroute.c.orig ++++ inetutils-1.8/src/traceroute.c +@@ -67,7 +67,7 @@ + int icmpfd, udpfd; + enum trace_type type; + struct sockaddr_in to, from; +- unsigned char ttl; ++ int ttl; + struct timeval tsent; + } trace_t; + +@@ -314,7 +314,7 @@ + trace_init (trace_t * t, const struct sockaddr_in to, + const enum trace_type type) + { +- const unsigned char *ttlp; ++ const int *ttlp; + assert (t); + ttlp = &t->ttl; + +@@ -329,7 +329,7 @@ + error (EXIT_FAILURE, errno, "socket"); + + if (setsockopt (t->udpfd, IPPROTO_IP, IP_TTL, ttlp, +- sizeof (t->ttl)) < 0) ++ sizeof (*ttlp)) < 0) + error (EXIT_FAILURE, errno, "setsockopt"); + } + +@@ -343,7 +343,7 @@ + error (EXIT_FAILURE, errno, "socket"); + + if (setsockopt (t->icmpfd, IPPROTO_IP, IP_TTL, +- ttlp, sizeof (t->ttl)) < 0) ++ ttlp, sizeof (*ttlp)) < 0) + error (EXIT_FAILURE, errno, "setsockopt"); + } + else +@@ -523,14 +523,14 @@ + trace_inc_ttl (trace_t * t) + { + int fd; +- const unsigned char *ttlp; ++ const int *ttlp; + + assert (t); + + ttlp = &t->ttl; + t->ttl++; + fd = (t->type == TRACE_UDP ? t->udpfd : t->icmpfd); +- if (setsockopt (fd, IPPROTO_IP, IP_TTL, ttlp, sizeof (t->ttl)) < 0) ++ if (setsockopt (fd, IPPROTO_IP, IP_TTL, ttlp, sizeof (*ttlp)) < 0) + error (EXIT_FAILURE, errno, "setsockopt"); + } + |