blob: 692f042218fc3c9d484036393d4b94e7980f7ffe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
From bc49a46989c98eb6ee72a379b18b77e87ed624fa Mon Sep 17 00:00:00 2001
From: Vincent Bernat <bernat@luffy.cx>
Date: Wed, 07 Dec 2011 09:17:55 +0000
Subject: Fix IPv4 address comparison routine.
Two different IPv4 addresses were returned to be equal while this was
not the case. Thanks to Ronie Gilberto Henrich for spotting this bug.
---
diff --git a/keepalived/include/check_data.h b/keepalived/include/check_data.h
index 50a4757..e3ff458 100644
--- a/keepalived/include/check_data.h
+++ b/keepalived/include/check_data.h
@@ -163,7 +163,7 @@ static inline int sockstorage_equal(const struct sockaddr_storage *s1,
struct sockaddr_in *a1 = (struct sockaddr_in *) s1;
struct sockaddr_in *a2 = (struct sockaddr_in *) s2;
- if ((a1->sin_addr.s_addr == a1->sin_addr.s_addr) &&
+ if ((a1->sin_addr.s_addr == a2->sin_addr.s_addr) &&
(a1->sin_port == a2->sin_port))
return 1;
}
--
cgit v0.8.3.4
|