From 189eeddaecb40881c3a86f263085b972ed2dc08b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 22 Feb 2024 14:33:29 +0900 Subject: [PATCH] sd-ndisc: actually refuse RA message from null address --- src/libsystemd-network/sd-ndisc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libsystemd-network/sd-ndisc.c b/src/libsystemd-network/sd-ndisc.c index 9b2635ae1cd..ac31d212e39 100644 --- a/src/libsystemd-network/sd-ndisc.c +++ b/src/libsystemd-network/sd-ndisc.c @@ -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; -- 2.47.3