From: Yu Watanabe Date: Thu, 22 Feb 2024 05:33:29 +0000 (+0900) Subject: sd-ndisc: actually refuse RA message from null address X-Git-Tag: v256-rc1~770^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=189eeddaecb40881c3a86f263085b972ed2dc08b;p=thirdparty%2Fsystemd.git sd-ndisc: actually refuse RA message from null address --- 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;