Subject: Re: Gated assertion "len" failed at str.c line 810
To: Curt Sampson <>
From: Acee Lindem <>
List: tech-net
Date: 01/23/1997 19:17:02
Curt Sampson <>  writes:

> Looking at the sockaddr structure, it does indeed have a length of
> zero.  Tracing back, this goes back quite some ways; in this
> particular instance redirect() was passed pointer to a sockaddr
> struct with a len and family of zero as the `src' argument. I've
> also seen this happen with the `dst' argument.
> Now I'm not really sure what's going on in krt_recv_route that's
> causing this, and not being terribly familiar with gated internals,
> it looks to me like I've got several hours of work ahead if I want
> to track this down and understand it. Before I do that, has anyone
> seen this problem before, or does anyone have any pointers as to
> why this might be happening?

You might be getting bad information from your routing socket. 
However, it looks to me like krt_xaddrs() should handle this. 
The best thing to do at this point would be to use set a
breakpoint in the krt_recv_route() and see exactly what the
kernel is passing you. 

Or if you want to try a fix based on hypothesis you can try add this 
line to krt_rt_sock.c on the assumption that the kernel is setting 
an address bit for an address that it isn't passing - however, the
address pointer may still set in static storage (addrinfo):
*** krt_rt_sock.c       Fri Jan 17 10:03:46 1997
---     Thu Jan 23 19:15:34 1997
*** 221,226 ****
--- 221,228 ----
            case RTAX_BRD:
                if (ap->sa_len) {
                    addrinfo.rti_info[i] = sock2gated(ap, (size_t) ap->sa_len);
+               } else {
+                   addrinfo.rti_info[i] = (sockaddr_un *) ap;