Torsten Landschoff wrote:
> 
> On Mon, Mar 19, 2001 at 02:05:34PM +0300, Michael Tokarev wrote:
[]
> > I did some investigations -- yes, machine in question is the only one
> > that has /etc/ethers file with one line in it.  If I remove this file,
> > tcpdump works fine.  I looked to source -- it crashes in libc's nss
> > stuff trying to resolve all-ones ethernet address.  This looks like
> > glibc bug/issue, tcpdump's side is ok.
> 
> In that case it is another bug. Can you instruct me how to reproduce it?

It's easy here.  Just creating /etc/ethers file is enouth for this.

I use glibc-2.2-12.i[36]86 (RedHat's 7.0 errata), compiled by myself
using again redhat's gcc-2.96-69 (should not matter).

 tcpdump-3.6.3# ./tcpdump 
 Segmentation fault (core dumped)
 # _

 gdb> bt
 #0  0x4022d643 in _nss_files_getntohost_r (addr=0x8096330, result=0xbffff7c0, 
     buffer=0xbffff3c0 "`\003", buflen=1024, errnop=0x40216fb9)
     at nss_files/files-XXX.c:194
 #1  0x401ef98a in ether_ntohost (hostname=0xbffff810 "", addr=0x8096330)
     at ether_ntoh.c:68
 #2  0x805f4ff in init_etherarray () at ./addrtoname.c:697
 #3  0x805f5d4 in init_addrtoname (localnet=108736, mask=16777215)
     at ./addrtoname.c:757
 #4  0x804a1f8 in main (argc=1, argv=0xbffffb04) at ./tcpdump.c:404
 #5  0x40116ee1 in __libc_start_main (main=0x8049b94 <main>, argc=1, 
     ubp_av=0xbffffb04, init=0x8049454 <_init>, fini=0x8077f3c <_fini>, 
     rtld_fini=0x4000e244 <_dl_fini>, stack_end=0xbffffafc)
     at ../sysdeps/generic/libc-start.c:129
 gdb> _

addrtoname.c near line 697:

 #ifdef HAVE_ETHER_NTOHOST
   /* Use yp/nis version of name if available */
   if (ether_ntohost(name, (struct ether_addr *)el->addr) == 0) {
      tp->e_name = savestr(name);
      continue;
   }
 #endif

el-addr here contains all-ones ether_addr_octet (ff:ff:ff:ff:ff:ff),
name is an automatic char[256] variable.

I don't know what's the ether_ntohost() (guess: it's like gethostbyaddr()
but for ethernet address instead of ip one?), and found no references to
it in man and glibc's info.

But wait... unpacking glibc...done...  looking again...  Aha --
found it.  It's definitely a glibc bug:

 gdb> frame 1
 #1  0x401ef98a in ether_ntohost (hostname=0xbffff810 "", addr=0x8096330)
     at ether_ntoh.c:68
 68            status = (*fct) (addr, &etherent, buffer, sizeof buffer);
 gdb> frame 0
 #0  0x4022d643 in _nss_files_getntohost_r (addr=0x8096330, result=0xbffff7c0, 
     buffer=0xbffff3c0 "`\003", buflen=1024, errnop=0x40216fb9)
     at nss_files/files-XXX.c:194
 194               *errnop = ENOENT;
 gdb> _

See? _nss_files_getntohost_r expects 5 arguments, but caller (ether_ntohost)
calls it via function pointer with only 4 arguments, omitting last errnop.

In glibc sources:
 inet/ether_ntoh.c: ether_ntohost

BTW, before submiting bug report (I never did this before for glibc),
it should be a good idea to check 2.2.1 version (if memory server me
right).  Bugzilla database at redhat currently down (well, it gives
"software error" at query page), so I can't check this there either...

Regards,
 Michael.

P.S. I set Reply-To to list - i'm on the list.
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to