Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jul 1999 13:57:18 +0200 (SAT)
From:      Reinier Bezuidenhout <rbezuide@oskar.nanoteq.co.za>
To:        freebsd-hackers@freebsd.org
Subject:   newaliases and 256 tun devices
Message-ID:  <199907281157.NAA00418@oskar.nanoteq.co.za>

next in thread | raw e-mail | index | archive | help
Hi ...


I previously mailed the same error ... and then I thought
it was a "miss-corrolation" between kernel sources and 
userland.  Since then I built a SNAP of 990726 sources
and tried the same thing and the error occured again .

Same sources used for the compile of the kernel and userlevel
binaries.

I've now traced the following down ... it has something todo 
with the changes in net/if_dl.h (the entries added for 
source routing and the fact that my kernel has 
pseudo-device tun 255
in the config.

Setup.
PII400 / Asus P2-99  990726 SNAP / fxp and de0 cards.

When I do a "ifconfig fxp0 delete" and then a newaliases
the newaliases exits with a segmentation failt.
If I reconfig the device or up the device ... newaliases works
ok.

I then built a kernel with only 200 tun devices.  Then newaliases
works everytime.  It seems that gated also suffers from the same
problem in that if no device is configured it exits on signal 6
(core dumped)

Just for reference this works fine on a 2.2.7/8 FreeBSD without
any problems ...

The problem seems to be in conf.c of sendmail round line 4429
if there is 255 tun devices the for loop below only gets to 
234 +/- and then doesn't check anything further and crashes
(but only if the working interface is deleted)
gdb shows that the pointer *sa points to somewhere wonderful :)
It must have something todo with the moving of this pointer
through the list ???

Was anything changed for the amount of tun devices allowed ??

        for (i = 0; i < ifc.ifc_len; )
        {
                struct ifreq *ifr = (struct ifreq *) &ifc.ifc_buf[i];
                SOCKADDR *sa = (SOCKADDR *) &ifr->ifr_addr;
                struct in_addr ia;
#ifdef SIOCGIFFLAGS
                struct ifreq ifrf;
#endif
                char ip_addr[256];
                extern char *inet_ntoa();

#ifdef BSD4_4_SOCKADDR
                if (sa->sa.sa_len > sizeof ifr->ifr_addr)
                        i += sizeof ifr->ifr_name + sa->sa.sa_len;
                else
#endif
                        i += sizeof *ifr;

                if (tTd(0, 20))
                        printf("%s\n", anynet_ntoa(sa));



Thanx
Reinier


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907281157.NAA00418>