Re: [Exim] bug in os_common_find_running_interfaces?

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Rick Byers
Dátum:  
Címzett: exim-users
Tárgy: Re: [Exim] bug in os_common_find_running_interfaces?
On Mon, 19 Aug 2002, Philip Hazel wrote:

> > I just upgraded from Exim3 to Exim 4.05 and it seems to be working great.
> > However, I get messages like the following in my paniclog:
> > "Unable to get flags for <garbage> interface: 6 Device not configured".
> > Where <garbage> is some binary junk. I'm using NetBSD-1.6. I started
> > looking at the code to figure out whats going on, but I don't have time
> > at the moment, so I was hoping someone else might have some insight to
> > point me in the right direction.
>
> I don't think that code has changed between Exim 3 and 4, but I might
> have forgotten something. The message is a result of
>
> if (ioctl(vs, V_GIFFLAGS, (char *)&ifreq) < 0)
>
> which is a call to get the flags for a TCP/IP interface. Exim is trying
> to get a list of all local interfaces. This something which different OS
> seem do differently, and as I don't use NetBSD, I can't really help with
> debugging, I'm afraid.


After a bit of investigation I've discovered the cause of the problem.
The machine has a whole tonne of interface aliases (255) and so more
than MAX_INTERFACES show up. Also ifc.V_ifc_len gets overwritten by
the ioctl with the length needed to store ALL the interfaces (which is
greater than sizeof(buf)), so the loop ends up running past the end of the
buffer.

I read the comment about hosts with large numbers of virtual interfaces
being reccomended to use "local_interfaces", so I just did that and things
are fine now. However, I think that the code should check that its not
overrunning the length of "buf".

Thanks,
    Rick