Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jul 1999 12:45:16 -0400 (EDT)
From:      Alfred Perlstein <bright@rush.net>
To:        Maxim Sobolev <sobomax@altavista.net>
Cc:        stable@FreeBSD.ORG
Subject:   Re: Tun interface related panic
Message-ID:  <Pine.BSF.3.96.990723123524.27774N-100000@cygnus.rush.net>
In-Reply-To: <379829EC.A575FC89@altavista.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 23 Jul 1999, Maxim Sobolev wrote:

> Alfred Perlstein wrote:
> 
> > when entering gdb, please try to show me the variables in the
> > tunwrite function, for some reason i think it's barfing becasue
> > of a zero length write but i'm unsure.
> >
> > use the "up" command to get to tunwrite
> > then "list" and try to show me the output
> > of "print uio, top, mp" seperate though.
> >
> > try to give me as many vars as possible in the function via print.
> 
> Following is information you have requested (if I did something wrong, please
> let me know with exact instructions):
> 
> (kgdb) up
> #5  0xc01630f9 in tunwrite (dev=13312, uio=0xc2d15f14, flag=1)
>     at ../../net/if_tun.c:559
> 559  top->m_pkthdr.len = tlen;
> (kgdb) list
> 554   if (top)
> 555    m_freem (top);
> 556   return error;
> 557  }
> 558
> 559  top->m_pkthdr.len = tlen;
> 560  top->m_pkthdr.rcvif = ifp;
> 561
> 562 #if NBPFILTER > 0
> 563  if (ifp->if_bpf) {
> (kgdb) print top
> $1 = (struct mbuf *) 0x0
> (kgdb) print uio
> $2 = (struct uio *) 0xc2d15f14
> (kgdb) print mp
> $3 = (struct mbuf **) 0xc2d15e28
> (kgdb) print tlen
> $4 = 0
> (kgdb) print ifp
> $5 = (struct ifnet *) 0xc0225a84
> (kgdb) q

oops, ok, I wasn't clear, I need to know the contents of the structs
that those pointers point to, try this:

print *uio
print *top
print **mp

in, the meanwhile, try this patch:


cvs diff: Diffing .
Index: if_tun.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_tun.c,v
retrieving revision 1.51
diff -u -r1.51 if_tun.c
--- if_tun.c    1999/01/17 20:53:47     1.51
+++ if_tun.c    1999/07/23 20:42:34
@@ -521,7 +521,7 @@

        TUNDEBUG("%s%d: tunwrite\n", ifp->if_name, ifp->if_unit);

-       if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) {
+       if (uio->uio_resid <= 0 || uio->uio_resid > TUNMRU) {
                TUNDEBUG("%s%d: len=%d!\n", ifp->if_name, ifp->if_unit,
                    uio->uio_resid);
                return EIO;


please please tell me if it works for you so I can file a proper PR.

thanks,
-Alfred



> 
> 
> -Maxim
> 

-Alfred Perlstein - [bright@rush.net|bright@wintelcom.net] 
systems administrator and programmer
    Win Telecom - http://www.wintelcom.net/



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990723123524.27774N-100000>