Created attachment 547465 [details] Fix IPv4 address comparison routine. Description of problem: Removing a real server from a virtual server in keepalived.conf and then reloading (eg. service keepalived reload) does not remove that real server from ipvs tables. Version-Release number of selected component (if applicable): keepalived-1.2.2-3 (F17) keepalived-1.2.2-2 (EPEL6) How reproducible: Always Steps to Reproduce: 1. Configure keepalived to have multiple real servers within a virtual server. 2. Start keepalived, verify all real servers are listed in ipvsadm output. For example: # ipvsadm IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn TCP 192.168.122.201:http rr -> 192.168.122.103:http Route 1 0 0 -> 192.168.122.104:http Route 1 0 0 -> 192.168.122.105:http Route 1 0 0 3. Now edit keepalived.conf and remove a real server. 4. Run 'service keepalived reload'. 5. Check ipvsadm output. The real server removed in step #3 should no longer be listed. Actual results: The real server removed from keepalived.conf is still listed in ipvsadm output after a reload. For example, removing 192.168.122.105 from config file then reloading, 192.168.122.105 still shows up in ipvsadm. Expected results: The real server removed from keepalived.conf should not be listed in ipvsadm after keepalived reload. Removing 192.168.122.105 from config file then reloading should give this output from ipvsadm: # ipvsadm IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn TCP 192.168.122.201:http rr -> 192.168.122.103:http Route 1 0 0 -> 192.168.122.104:http Route 1 0 0 Additional info: This problem is due to a bug in keepalived where is compares two IPv4 addresses. I have tested a patch that fixes this problem. This bug exists in the upstream git repo (version 1.2.2) and is present in at least F17 and epel6. I've applied the patch, done a scratch build (epel6) and tested. Problem solved.
Fixed in F16 (keepalived-1.2.2-4.fc16). Fixed in F17 (keepalived-1.2.2-5.fc17).
Fixed in EPEL6 (keepalived-1.2.2-3.el6)
keepalived-1.2.2-5.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/keepalived-1.2.2-5.fc17
keepalived-1.2.2-4.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/keepalived-1.2.2-4.fc16
keepalived-1.2.2-3.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/keepalived-1.2.2-3.el6
keepalived-1.2.2-4.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
keepalived-1.2.2-5.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.
keepalived-1.2.2-3.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.