sd-ndisc,sd-radv: fix use of uninitialized value

When icmp6_receive() fails, then the source address is not initialized yet.
This commit is contained in:
Yu Watanabe
2023-09-04 19:31:40 +09:00
parent 6d05778469
commit 4674f407b2
2 changed files with 2 additions and 4 deletions
+1 -2
View File
@@ -225,8 +225,7 @@ static int ndisc_recv(sd_event_source *s, int fd, uint32_t revents, void *userda
if (r < 0)
switch (r) {
case -EADDRNOTAVAIL:
log_ndisc(nd, "Received RA from non-link-local address %s. Ignoring.",
IN6_ADDR_TO_STRING(&rt->address));
log_ndisc(nd, "Received RA from non-link-local address. Ignoring.");
return 0;
case -EMULTIHOP:
+1 -2
View File
@@ -264,8 +264,7 @@ static int radv_recv(sd_event_source *s, int fd, uint32_t revents, void *userdat
if (r < 0)
switch (r) {
case -EADDRNOTAVAIL:
log_radv(ra, "Received RS from non-link-local address %s. Ignoring",
IN6_ADDR_TO_STRING(&src));
log_radv(ra, "Received RS from non-link-local address. Ignoring");
return 0;
case -EMULTIHOP: