]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #32299 from yuwata/network-radv-ignore-rs-from-the-same-interface
authorLuca Boccassi <bluca@debian.org>
Thu, 18 Apr 2024 21:45:06 +0000 (23:45 +0200)
committerGitHub <noreply@github.com>
Thu, 18 Apr 2024 21:45:06 +0000 (23:45 +0200)
network/radv: ignore RS message from the same interface

1  2 
src/libsystemd-network/sd-radv.c

index 6a71ce14ff4e6ceb64f650b57a72be3fcb56c759,62b69e633ff608570d530bea3a4fbf12c88f4e7d..053dd0653b1ad6c33ae23db67230b6ce78a6e8e1
@@@ -283,8 -260,12 +283,12 @@@ static int radv_process_packet(sd_radv 
          r = sd_ndisc_router_solicit_get_sender_address(rs, &src);
          if (r < 0 && r != -ENODATA) /* null address is allowed */
                  return log_radv_errno(ra, r, "Failed to get sender address of RS, ignoring: %m");
+         if (r >= 0 && in6_addr_equal(&src, &ra->ipv6ll))
+                 /* This should be definitely caused by a misconfiguration. If we send RA to ourself, the
+                  * kernel complains about that. Let's ignore the packet. */
+                 return log_radv_errno(ra, SYNTHETIC_ERRNO(EADDRINUSE), "Received RS from the same interface, ignoring.");
  
 -        r = radv_send_router(ra, &src, ra->lifetime_usec);
 +        r = radv_send_router(ra, &src);
          if (r < 0)
                  return log_radv_errno(ra, r, "Unable to send solicited Router Advertisement to %s, ignoring: %m", IN6_ADDR_TO_STRING(&src));