Skip to content

Commit bf68b4f

Browse files
committed
Fix the issue that ff_netstat -r can't show gateway6.
1 parent 2156ba5 commit bf68b4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/netstat/route.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,17 +559,18 @@ routename(struct sockaddr *sa, int flags)
559559
#ifdef INET
560560
case AF_INET:
561561
src = &satosin(sa)->sin_addr;
562+
inet_ntop(sa->sa_family, src, line, sizeof(line) - 1);
562563
break;
563564
#endif /* INET */
564565
#ifdef INET6
565566
case AF_INET6:
566567
src = &satosin6(sa)->sin6_addr;
568+
inet_ntop(AF_INET6_LINUX, src, line, sizeof(line) - 1);
567569
break;
568570
#endif /* INET6 */
569571
default:
570572
return(line);
571573
}
572-
inet_ntop(sa->sa_family, src, line, sizeof(line) - 1);
573574
return (line);
574575
}
575576
trimdomain(line, strlen(line));

0 commit comments

Comments
 (0)