Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jul 1999 17:42:31 +0200 (SAT)
From:      Reinier Bezuidenhout <rbezuide@oskar.nanoteq.co.za>
To:        freebsd-hackers@freebsd.org
Subject:   if_dl.h in stable causes sendmail segmentation
Message-ID:  <199907201542.RAA02634@oskar.nanoteq.co.za>

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

I have the following situation...

A machine running a 3.2-STABLE of a few weeks ago ...

When the machine booted I saw that newaliases (sendmail -bi)
exited with a segmentation fault.

I further inspected and found that if I do a ifconfig of a interface
(fxp0 or de0) newaliases is ok, but when I do an ifconfig fxp0 delete
the newaliases exits on a segmentation fault.

e.g.
---------------------

Amnesiac# ifconfig -au
de0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 196.37.91.253 netmask 0xffffff00 broadcast 196.37.91.255
        ether 00:e0:29:00:e5:19 
        media: autoselect (10baseT/UTP) status: active
        supported media: autoselect 100baseTX <full-duplex> 100baseTX 10baseT/UTP <full-duplex> 10baseT/UTP
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet 127.0.0.1 netmask 0xff000000 
Amnesiac# newaliases
/etc/aliases: 19 aliases, longest 10 bytes, 190 bytes total
Amnesiac# ifconfig de0 delete
Amnesiac# newaliases
Segmentation fault
Amnesiac# ifconfig de0 up
Amnesiac# newaliases
/etc/aliases: 19 aliases, longest 10 bytes, 190 bytes total
Amnesiac# 

----------------------


I then used the kernel sources from a few weeks after the 3.2-RELEASE
and compiled the kernel - now everything works ok ... no segmentation
fault. 

I eventually traced the problem down to the following header file

/usr/src/sys/net/if_dl.h

If I use the old header file ... no problem ... use the latest one ..
sendmail crashes (and looks like gated also does this).  Here is the diff

jarrow# diff -c if_dl.h ../../sys.new/net/if_dl.h
*** if_dl.h     Tue Jul 20 16:18:54 1999
--- ../../sys.new/net/if_dl.h   Thu May 27 05:06:41 1999
***************
*** 31,37 ****
   * SUCH DAMAGE.
   *
   *    @(#)if_dl.h     8.1 (Berkeley) 6/10/93
!  * $Id: if_dl.h,v 1.6 1997/02/22 09:41:00 peter Exp $
   */
  
  #ifndef _NET_IF_DL_H_
--- 31,37 ----
   * SUCH DAMAGE.
   *
   *    @(#)if_dl.h     8.1 (Berkeley) 6/10/93
!  * $Id: if_dl.h,v 1.6.4.1 1999/05/27 03:06:41 julian Exp $
   */
  
  #ifndef _NET_IF_DL_H_
***************
*** 68,73 ****
--- 68,75 ----
        u_char  sdl_slen;       /* link layer selector length */
        char    sdl_data[12];   /* minimum work area, can be larger;
                                   contains both if name and ll address */
+       u_short sdl_rcf;        /* source routing control */
+       u_short sdl_route[16];  /* source routing information */
  };
  
  #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))

----------------------
Looks like the addition of the two last entries in the structure is the
problem ?? Any ideas ??

Sendmail crashes in the routine in conf.c called "load_if_names()"
where it cycles through the interfaces round line 4444

if (sa->sa.sa_len > sizeof ifr->ifr_addr)

the address sa->sa seems to point so where

If you want any more info .. just ask :)

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?199907201542.RAA02634>