components/ntp/patches/40-norefresh.patch
changeset 4486 8a12763ec19a
equal deleted inserted replaced
4485:ccd96394d501 4486:8a12763ec19a
       
     1 Don't change interfaces unless there is something wrong with the old one.
       
     2 This is NTP bug [2043] and this patch should be removed after upgrading to
       
     3 a version of NTP with a fix for that bug.
       
     4 
       
     5 --- ntpd/ntp_peer.c
       
     6 +++ ntpd/ntp_peer.c
       
     7 @@ -718,9 +718,13 @@
       
     8  	/*
       
     9  	 * this is called when the interface list has changed
       
    10  	 * give all peers a chance to find a better interface
       
    11 +	 * but only if either they don't have an address already
       
    12 +	 * or if the one they have hasn't worked for a while.
       
    13  	 */
       
    14 -	for (p = peer_list; p != NULL; p = p->p_link)
       
    15 -		peer_refresh_interface(p);
       
    16 +	for (p = peer_list; p != NULL; p = p->p_link) {
       
    17 +		if (!(p->dstadr && (p->reach & 0x3)))
       
    18 +			peer_refresh_interface(p);
       
    19 +	}
       
    20  }
       
    21  
       
    22