Blame SOURCES/autofs-5.0.7-fix-interface-address-null-check.patch

304803
autofs-5.0.7 - fix interface address null check
304803
304803
From: Doug Nazar <nazard@nazar.ca>
304803
304803
Since commit aa6f7793 [autofs-5.0.7 - fix ipv6 proximity calculation]
304803
get_proximity() uses getifaddrs however it crashes on interfaces with
304803
no addresses.
304803
304803
Fix the NULL check to ignore interfaces with no addresses.
304803
Also skip interfaces which are not currently running.
304803
---
304803
 CHANGELOG            |    1 +
304803
 modules/replicated.c |   10 ++++++----
304803
 2 files changed, 7 insertions(+), 4 deletions(-)
304803
304803
diff --git a/CHANGELOG b/CHANGELOG
304803
index 66c11de..50e83d7 100644
304803
--- a/CHANGELOG
304803
+++ b/CHANGELOG
304803
@@ -43,6 +43,7 @@
304803
 - make dump maps check for duplicate indirect mounts.
304803
 - document allowed map sources in auto.master.
304803
 - add enable sloppy mount option to configure.
304803
+- fix interface address null check.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
diff --git a/modules/replicated.c b/modules/replicated.c
304803
index 26f64b8..6dbdade 100644
304803
--- a/modules/replicated.c
304803
+++ b/modules/replicated.c
304803
@@ -165,8 +165,9 @@ static unsigned int get_proximity(struct sockaddr *host_addr)
304803
 
304803
 	this = ifa;
304803
 	while (this) {
304803
-		if (this->ifa_flags & IFF_POINTOPOINT ||
304803
-		    this->ifa_addr->sa_data == NULL) {
304803
+		if (!(this->ifa_flags & IFF_UP) ||
304803
+		    this->ifa_flags & IFF_POINTOPOINT ||
304803
+		    this->ifa_addr == NULL) {
304803
 			this = this->ifa_next;
304803
 			continue;
304803
 		}
304803
@@ -202,8 +203,9 @@ static unsigned int get_proximity(struct sockaddr *host_addr)
304803
 
304803
 	this = ifa;
304803
 	while (this) {
304803
-		if (this->ifa_flags & IFF_POINTOPOINT ||
304803
-		    this->ifa_addr->sa_data == NULL) {
304803
+		if (!(this->ifa_flags & IFF_UP) ||
304803
+		    this->ifa_flags & IFF_POINTOPOINT ||
304803
+		    this->ifa_addr == NULL) {
304803
 			this = this->ifa_next;
304803
 			continue;
304803
 		}