Browse Source

route: fix output of "route -n -A inet6"

The output of the command "route -n -A inet6" may be corrupted
due to partially initialized structure snaddr6 in the function
INET6_displayroutes.

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Tomas Paukrt 4 years ago
parent
commit
4527273f1c
1 changed files with 1 additions and 0 deletions
  1. 1 0
      networking/route.c

+ 1 - 0
networking/route.c

@@ -628,6 +628,7 @@ static void INET6_displayroutes(void)
 
 		r = 0;
 		while (1) {
+			memset(&snaddr6, 0, sizeof(snaddr6));
 			inet_pton(AF_INET6, addr6x + r,
 					  (struct sockaddr *) &snaddr6.sin6_addr);
 			snaddr6.sin6_family = AF_INET6;