summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/mtr/files/mtr-0.69-debian.patch')
-rw-r--r--net-analyzer/mtr/files/mtr-0.69-debian.patch93
1 files changed, 93 insertions, 0 deletions
diff --git a/net-analyzer/mtr/files/mtr-0.69-debian.patch b/net-analyzer/mtr/files/mtr-0.69-debian.patch
new file mode 100644
index 000000000000..5842777d4de6
--- /dev/null
+++ b/net-analyzer/mtr/files/mtr-0.69-debian.patch
@@ -0,0 +1,93 @@
+--- mtr-0.69.orig/mtr.c
++++ mtr-0.69/mtr.c
+@@ -388,10 +388,6 @@
+ }
+
+
+- if (net_set_interfaceaddress (InterfaceAddress) != 0) {
+- fprintf (stderr, "mtr: Couldn't set interface addres.\n");
+- exit (1);
+- }
+
+ #ifdef ENABLE_IPV6
+ /* gethostbyname2() is deprecated so we'll use getaddrinfo() instead. */
+@@ -442,6 +438,11 @@
+ exit(1);
+ }
+
++ if (net_set_interfaceaddress (InterfaceAddress) != 0) {
++ fprintf (stderr, "mtr: Couldn't set interface address.\n");
++ exit (1);
++ }
++
+ display_open();
+ dns_open();
+
+--- mtr-0.69.orig/net.c
++++ mtr-0.69/net.c
+@@ -322,7 +322,15 @@
+ int oldavg; /* usedByMin */
+ int oldjavg; /* usedByMin */
+ int i; /* usedByMin */
++#ifdef ENABLE_IPV6
++ char addrcopy[sizeof(struct in6_addr)];
++#else
++ char addrcopy[sizeof(struct in_addr)];
++#endif
+
++ /* Copy the from address ASAP because it can be overwritten */
++ addrcpy( (void *) &addrcopy, addr, af );
++
+ if (seq < 0 || seq >= MaxSequence)
+ return;
+
+@@ -339,22 +347,22 @@
+ if ( addrcmp( (void *) &(host[index].addr),
+ (void *) &unspec_addr, af ) == 0 ) {
+ // should be out of if as addr can change
+- addrcpy( (void *) &(host[index].addr), addr, af );
++ addrcpy( (void *) &(host[index].addr), addrcopy, af );
+ display_rawhost(index, (void *) &(host[index].addr));
+
+ /* multi paths by Min */
+- addrcpy( (void *) &(host[index].addrs[0]), addr, af );
++ addrcpy( (void *) &(host[index].addrs[0]), addrcopy, af );
+ } else {
+ for( i=0; i<MAXPATH; ) {
+- if( addrcmp( (void *) &(host[index].addrs[i]), (void *) &addr,
++ if( addrcmp( (void *) &(host[index].addrs[i]), (void *) &addrcopy,
+ af ) == 0 ||
+ addrcmp( (void *) &(host[index].addrs[i]),
+ (void *) &unspec_addr, af ) == 0 ) break;
+ i++;
+ }
+- if( addrcmp( (void *) &(host[index].addrs[i]), addr, af ) != 0 &&
++ if( addrcmp( (void *) &(host[index].addrs[i]), addrcopy, af ) != 0 &&
+ i<MAXPATH ) {
+- addrcpy( (void *) &(host[index].addrs[i]), addr, af );
++ addrcpy( (void *) &(host[index].addrs[i]), addrcopy, af );
+ }
+ /* end multi paths */
+ }
+@@ -911,8 +919,10 @@
+
+ void net_close(void)
+ {
+- close(sendsock);
+- close(recvsock);
++ if (sendsock4 >= 0) close(sendsock4);
++ if (recvsock4 >= 0) close(recvsock4);
++ if (sendsock6 >= 0) close(sendsock6);
++ if (recvsock6 >= 0) close(recvsock6);
+ }
+
+
+--- mtr-0.69.orig/net.h
++++ mtr-0.69/net.h
+@@ -117,3 +117,6 @@
+ extern char available_options[];
+
+ ip_t unspec_addr;
++
++FILE *ADDRCMP;
++int i;