]> git.puffer.fish Git - mirror/frr.git/commit
zebra: change router-id selection algo
authorStephen Hemminger <shemminger@vyatta.com>
Mon, 21 Dec 2009 15:50:43 +0000 (18:50 +0300)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 21 Dec 2009 15:50:43 +0000 (18:50 +0300)
commitb6516829595ed4fc47af955de8bda9ef5be14ffd
tree842806138758343d41598fded61943de51c4c363
parent2d362d1099f346202cb628665ff4ae563b2594f5
zebra: change router-id selection algo

The router-id table looks like is supposed to be sorted in current
quagga code, but the nodes are not added with the sorting
function.

The sorting function is host byte order dependent.
The values need to converted before comparison.

Fixing this causes Zebra to choose the largest IP address
as router-id, rather than the last address. This probably will
surprise some users. The other option would be to just remove the
comparison function and keep the existing LIFO behavior.

Lastly, simple subtraction works well for comparing.

* zebra/router-id.c
  * router_id_add_address(): employ listnode_add_sort()
  * router_id_cmp(): employ ntohl(), then compare integers
zebra/router-id.c