From owner-freebsd-stable Fri Jul 23 9:46: 4 1999 Delivered-To: freebsd-stable@freebsd.org Received: from cygnus.rush.net (cygnus.rush.net [209.45.245.133]) by hub.freebsd.org (Postfix) with ESMTP id 8459715051 for ; Fri, 23 Jul 1999 09:45:54 -0700 (PDT) (envelope-from bright@rush.net) Received: from localhost (bright@localhost) by cygnus.rush.net (8.9.3/8.9.3) with SMTP id MAA05246; Fri, 23 Jul 1999 12:45:18 -0400 (EDT) Date: Fri, 23 Jul 1999 12:45:16 -0400 (EDT) From: Alfred Perlstein To: Maxim Sobolev Cc: stable@FreeBSD.ORG Subject: Re: Tun interface related panic In-Reply-To: <379829EC.A575FC89@altavista.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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