]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: require port match in address update
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 9 Feb 2021 12:07:37 +0000 (13:07 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 11 Feb 2021 08:52:57 +0000 (09:52 +0100)
In NSR_UpdateSourceNtpAddress() and other updates of the address require
that the old port matches the current source's port.

ntp_sources.c

index 63e16de39a59eb937bb35454aff6a75d690355c3..537f65195fd03148997351d9b0913c7b44c3eb16 100644 (file)
@@ -370,7 +370,7 @@ change_source_address(NTP_Remote_Address *old_addr, NTP_Remote_Address *new_addr
   char *name;
 
   found = find_slot2(old_addr, &slot1);
-  if (found == 0)
+  if (found != 2)
     return NSR_NoSuchSource;
 
   /* Make sure there is no other source using the new address (with the same