Re: get_proximity() crashes on interfaces with no addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 12, 2013 at 5:48 PM, Doug Nazar <nazard@xxxxxxxx> wrote:
> Since commit aa6f7793 [autofs-5.0.7 - fix ipv6 proximity calculation] uses
> getifaddrs however it crashes on interfaces with no addresses. Fix the NULL
> check to ignore interfaces with no addresses.

Hi,

Your patch removes the check on ifa_addr->sa_data. I'm wondering if
it's possible to have a valid ifa_addr and a NULL sa_data. Do you know?
Maybe it's safer to just test both:

 		if (this->ifa_flags & IFF_POINTOPOINT ||
		    this->ifa_addr == NULL ||
		    this->ifa_addr->sa_data == NULL) {
 			this = this->ifa_next;
 			continue;
 		}

> Should it also check for the IFF_UP flag?

I think it makes sense to test it.

Thanks,
Leonardo
--
To unsubscribe from this list: send the line "unsubscribe autofs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux