[lkml]   [1997]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: arp problems with 2.1.21
On Thu, 16 Jan 1997, Richard Gooch wrote:

> Hi, all. I find that I can't manually set up an ARP cache entry with
> linux 2.1.21 (worked fine with 2.0.x). If I do:
> # arp -v -i eth1 -s <ipaddr> <hw_addr>
> arp: SIOCSARP()
> SIOCSARP and OLD_SIOCSARP: Invalid argument
> Probably destination is on different Interface. See arp(8)
> This is with the arp compiled from net-tools-1.32-alpha, with libc
> 5.4.17, gcc 2.7.2. It doesn't matter if my /usr/include/{linux|asm}
> files are from 2.0.0 or 2.1.21, I get the same effect.
> The old arp I was running (compiled from net-tools-1.3.6-BETA5, with
> libc 5.3.7) gives the following:
> # arp -v -i eth1 -s <ipaddr> <hw_addr>
> has_mask=1
> has_device=1
> SIOCSARP: Invalid argument
> Note that eth1 has been set up as a point-to-point interface, and
> <ipaddr> has been set up in the routing table correctly. So, is this
> sort of thing no longer possible? What has changed?
> Regards,
> Richard....

I have exactly the same problem and have been hopeing that there is a fix
in the works sometime soon.

This is a code-fragment that I use to perform automatic routing from my
remote ppp-connected machines. I am on one of those machines now. It
has not worked since about 2.0.16++ .

I can't use newer network code on my ppp server (which is the only machine
that has a direct connection to an outside line in the whole company).

I use this with a 'callback` program so I don't have $400.00 phone bills.
The company has wide-area calling so it costs them nothing.

* Add remote IP addresses and the local hardware address to the ARP
* cache.
int add_arp(int arp_fd, char *name, HW *hw)
struct arpreq arp;

int status;
#ifndef DEBUG
sprintf(scratch,"ARP address added: %s", name);
memset(UCP &arp, UCR 0x00, sizeof(arp));
arp.arp_pa.sa_family = AF_INET;
arp.arp_ha.sa_family = ARPHRD_ETHER;
arp.arp_netmask.sa_family = AF_INET;
makeaddr(&arp.arp_pa.sa_data[2], name); /* Protocol address */
memcpy(UCP &arp.arp_ha.sa_data[0], hw, sizeof(HW));
arp.arp_flags = (ATF_PERM | ATF_PUBL | ATF_NETMASK);
strcpy(arp.arp_dev, dev);
memset(UCP &arp.arp_netmask.sa_data[2], UCR 0xff, 0x03); /* */

status = ioctl(arp_fd, SIOCSARP, &arp);
if(status < 0)
return errno;
return 0;

It isn't your network tools. The SIOCSARP ioctl call returns:

Jan 15 21:06:15 quark pppd_cache[84]: ARP address added:
Jan 15 21:06:15 quark pppd_cache[84]: (arp_update.c) ioctl(SIOCSARP)
Invalid argument
Jan 15 21:06:18 quark pppd_cache[84]: ARP address added:
Jan 15 21:06:18 quark pppd_cache[84]: (arp_update.c) ioctl(SIOCSARP) Invalid argument

Dick Johnson
Richard B. Johnson
Project Engineer
Analogic Corporation
Voice : (508) 977-3000 ext. 3754
Fax : (508) 532-6097
Modem : (508) 977-6870
Ftp :
Email :,
Penguin : Linux version 2.1.21 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

 \ /
  Last update: 2005-03-22 13:38    [W:0.037 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site