]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-ndisc: actually refuse RA message from null address 31441/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 22 Feb 2024 05:33:29 +0000 (14:33 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 22 Feb 2024 05:35:24 +0000 (14:35 +0900)
src/libsystemd-network/sd-ndisc.c

index 9b2635ae1cd151959c388b5e36a3c07a5e175189..ac31d212e39ad0dcbe909cae04deeb7b4ca0cea5 100644 (file)
@@ -252,8 +252,10 @@ static int ndisc_recv(sd_event_source *s, int fd, uint32_t revents, void *userda
 
         /* The function icmp6_receive() accepts the null source address, but RFC 4861 Section 6.1.2 states
          * that hosts MUST discard messages with the null source address. */
-        if (in6_addr_is_null(&rt->address))
-                log_ndisc(nd, "Received RA from null address. Ignoring.");
+        if (in6_addr_is_null(&rt->address)) {
+                log_ndisc(nd, "Received an ICMPv6 packet from null address, ignoring.");
+                return 0;
+        }
 
         (void) ndisc_handle_datagram(nd, rt);
         return 0;