Subject: arpresolve: can't allocate llinfo
To: None <tech-net@NetBSD.ORG>
From: John Messenger <John.Messenger@proteon.com>
List: tech-net
Date: 05/01/1995 14:11:58
Dear Tech-netters

I'm writing a NetBSD-1.0/i386 driver for a token ring card.  I fully
understand the card.  I don't understand all that much of the software
above the network driver.  So far, I have transmit code and no receive
code.

The test setup is a machine with an Ethernet connection (ed1) and my
test network (pa0).

/etc/hostname.pa0 says: inet puma-pa.proteon.com 0xffffffc0
/etc/hostname.ed1 says: inet puma.proteon.com 0xffffffc0

/etc/hosts:
128.185.63.158   puma-pa.proteon.com puma-pa
128.185.63.159   cervil-pa.proteon.com cervil-pa

When I try to transmit a packet (which I do by pinging a host whose IP
address indicates it is on the same segment as my NIC), arpresolve is
called (presumably from token_output, my hacked equivalent of
ether_output).  Arpresolve complains:

  arpresolve:jlm: rt=0xf8723800
  arpresolve:jlm: la=0x0
  arpresolve: can't allocate llinfo

So it looks like there is a route, but no "link-level info cache".
Could someone fill me in as to what I need to do to enable arpresolve
to get the address it needs to send the packet?

To test my transmit code, I have hacked arpresolve to return a
broadcast address in this situation!  Then my ping packet makes it
onto the ring.

Here's a segment from arpresolve, as munged.
#ifdef JLM_ARP_DEBUG
        printf("arpresolve:jlm: rt=0x%x\n", rt);
#endif
...
	if (rt)
		la = (struct llinfo_arp *)rt->rt_llinfo;
	else {
		if (la = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0))
			rt = la->la_rt;
	}

#ifdef JLM_ARP_DEBUG
        printf("arpresolve:jlm: la=0x%x\n", la);
#endif
        
	if (la == 0 || rt == 0) {
		log(LOG_DEBUG, "arpresolve: can't allocate llinfo");

-- 
        -- John Messenger, Proteon International (jlm@proteon.com)
	   "Mind like parachute: only works when open" -- Charlie Chang
           I am not speaking for my employer