Re: No proxy-arp with alias interfaces -- why?

Andi Kleen (ak@muc.de)
Tue, 13 Oct 1998 18:38:00 +0200


On Tue, Oct 13, 1998 at 05:25:50PM +0200, Hannu Koivisto wrote:
> Andi Kleen <ak@muc.de> writes:
>
> | The fix is easy, just change pppd to not set the ATF_COM flag in the
> | SIOCSARP ioctl. If it is set the kernel thinks it contains a valid hardware
> | address, and if it can't find that address it will return ENODEV (as in
> | your case).
>
> Hmmm. But it seems that pppd does not set the ATF_COM flag in
> SIOCSARP ioctl. This is the function in question:
>
> """
> int sifproxyarp (int unit, u_int32_t his_adr)
> {
> struct arpreq arpreq;
>
> if (has_proxy_arp == 0)
> {
> memset (&arpreq, '\0', sizeof(arpreq));
>
> SET_SA_FAMILY(arpreq.arp_pa, AF_INET);
> ((struct sockaddr_in *) &arpreq.arp_pa)->sin_addr.s_addr = his_adr;
> arpreq.arp_flags = ATF_PERM | ATF_PUBL;
> /*
> * Get the hardware address of an interface on the same subnet
> * as our local address.
> */
> if (!get_ether_addr(his_adr, &arpreq.arp_ha, arpreq.arp_dev))
> {
> syslog(LOG_ERR, "Cannot determine ethernet address for proxy ARP");
> return 0;
> }
>
> if (ioctl(sock_fd, SIOCSARP, (caddr_t)&arpreq) < 0)
> {
> if ( ! ok_error ( errno ))
> {
> syslog(LOG_ERR, "ioctl(SIOCSARP): %m(%d)", errno);
> }
> return 0;
> }
> }
>
> proxy_arp_addr = his_adr;
> has_proxy_arp = 1;
> return 1;
> }
> """
>
> I tried to decipher arp_ioctl() in kernel sources to understand
> what else could be the reason but trying to understand
> networking code is really not what I'm best at :)
>
> If you have other suggestions, I'd be pleased to hear about
> them.

Two other possibilities:

- Your pppd binary is very old and was compiled with pre-2.0 includes
that had a different arpreq structure for some reason. If the missing
arp_dev entry contains garbage that could happen.

- The new routing code is intolerant to any operations on device that
are not up. It could be similar to the problem described in
Documentation/networking/ppp.txt. Make sure that the interface and the
routes are up (IFF_UP set) before installing proxy arp.

-A.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/