Mtr

Without IPv6 build fails in curses.c

Bug #1130561 reported by Mykola Orliuk
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mtr
New
Undecided
Unassigned

Bug Description

./bootstrap.sh && ./configure --disable-ipv6 && make

gcc -DHAVE_CONFIG_H -I. -g -O2 -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/libdrm -Wall -Wno-pointer-sign -MT curses.o -MD -MP -MF .deps/curses.Tpo -c -o curses.o curses.c
curses.c: In function ‘mtr_curses_hosts’:
curses.c:318:14: error: invalid initializer
make[2]: *** [curses.o] Error 1

Revision history for this message
Mykola Orliuk (virkony) wrote :

Please check correctness of logic in this patch. I was unable to understand change d90dd1fd which introduces this issue.

Revision history for this message
Mykola Orliuk (virkony) wrote :

This patch will disable snippet of code that cause build failure. Waiting for upstream fix :)

Revision history for this message
Antonio Querubin (aaq) wrote :

This might be a cleaner fix for the build problem. However, there appears to be other problems with the lookup code.

--- curses.c.orig 2013-02-23 05:13:40.000000000 -1000
+++ curses.c 2013-03-20 12:40:49.262278199 -1000
@@ -315,15 +315,10 @@
     mpls = net_mpls(at);

     if( addrcmp( (void *) addr, (void *) &unspec_addr, af ) != 0 ) {
- struct in6_addr addr6 = *addr;
-
- if (PrintAS) {
- u_char ipv4[4];
- ipv4[0] = addr6.s6_addr[0];
- ipv4[1] = addr6.s6_addr[1];
- ipv4[2] = addr6.s6_addr[2];
- ipv4[3] = addr6.s6_addr[3];

+ /* The routeviews ASN lookup only works for IPv4 addresses. */
+ if (PrintAS && af == AF_INET) {
+ u_char *ipv4 = (u_char *) addr;
 #define NAMELEN 127
               char ipv4_buf[NAMELEN];
               char* chip = (char*) &ipv4_buf;

Revision history for this message
Antonio Querubin (aaq) wrote :

I notice there's an equivalent IPv6 capable service at Team Cymru:

http://www.team-cymru.org/Services/ip-to-asn.html

I'll try to rework the code after taxes this weekend.

Revision history for this message
Antonio Querubin (aaq) wrote :

This patch fixes various problems associated with the ASN lookup code and adds ASN lookup for IPv6 addresses .

Revision history for this message
Antonio Querubin (aaq) wrote :

Updated patch. See bug #1160321.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.