Port-xen archive

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

Re: static ARP entry bug?



On Wed, Aug 12, 2009 at 08:59:18AM -0400, Greg Troxel wrote:
> 
> You are right - I am having the same problem.
> 
> So I think something is wrong with if_xennet.

What's wrong is the name is too long :)

The problem is in if_arp.c:
        case RTM_RESOLVE:
                if (gate->sa_family != AF_LINK ||
                    gate->sa_len < sockaddr_dl_measure(namelen, addrlen)) {

gate->sa_family is correct, but gate->sa_len is shorter by one.
'struct sockaddr_dl' has by default 12 bytes for address+ifname, which leaves
6 bytes for the interface name, which is one too short for xennet0.
One obvious workaround would be to bump sockaddr_dl->sdl_data to 16 I guess.
But it's only a workaround. My guess is that arp_setgate() should
handle this case and allocate a larger struct sockaddr_dl when needed,
but I don't know what the side effect of doing a rt_setgate() in
the !RTF_CLONING could be.

-- 
Manuel Bouyer, LIP6, Universite Paris VI.           
Manuel.Bouyer%lip6.fr@localhost
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index