Fix the issue that `ff_netstat -r` can't show gateway6.

This commit is contained in:
fengbojiang 2022-09-01 17:14:59 +08:00
parent 2156ba56d9
commit bf68b4fc1b
1 changed files with 2 additions and 1 deletions

View File

@ -559,17 +559,18 @@ routename(struct sockaddr *sa, int flags)
#ifdef INET
case AF_INET:
src = &satosin(sa)->sin_addr;
inet_ntop(sa->sa_family, src, line, sizeof(line) - 1);
break;
#endif /* INET */
#ifdef INET6
case AF_INET6:
src = &satosin6(sa)->sin6_addr;
inet_ntop(AF_INET6_LINUX, src, line, sizeof(line) - 1);
break;
#endif /* INET6 */
default:
return(line);
}
inet_ntop(sa->sa_family, src, line, sizeof(line) - 1);
return (line);
}
trimdomain(line, strlen(line));