Subject: Re: mbuf lost in udp_usrreq?
To: None <tech-kern@NetBSD.org>
From: =?iso-8859-1?q?J=F6rn=20Seger?= <joern.seger@uni-dortmund.de>
List: tech-kern
Date: 04/23/2004 09:22:27
sorry, got the point ;-) - I was a bit fast this morning

Am Freitag, 23. April 2004 09:18 schrieben Sie:
> Hi,
>
> maybe I'm completely wrong, but I found the following code in
> udp_usrreq(v1.39):
>
> starting at line 249:
> #ifndef PULLDOWN_TEST
> 	if (m->m_len < iphlen + sizeof(struct udphdr)) {
> 		if ((m =3D m_pullup(m, iphlen + sizeof(struct udphdr))) =3D=3D 0) {
> 			udpstat.udps_hdrops++;
> 			return;
> 		}
> 		ip =3D mtod(m, struct ip *);
> 	}
> 	uh =3D (struct udphdr *)((caddr_t)ip + iphlen);
> #else
> 	IP6_EXTHDR_GET(uh, struct udphdr *, m, iphlen, sizeof(struct udphdr));
> 	if (uh =3D=3D NULL) {
> 		udpstat.udps_hdrops++;
> 		return;
> 	}
> #endif
>
> isn't it that when the function returns, the mbuffer (m) got lost on the
> heap? The other times, the "return" is a "goto bad", which frees the
> mbuffer.
>
> Best regards - J=F6rn

=2D-=20
Dipl.-Ing. J=F6rn Seger
Elektronische Systeme und Vermittlungstechnik
Raum: C1-04-177a
Otto-Hahn-Str. 6
Universit=E4t Dortmund

Tel: +49-231-97595-55 Fax: +49-231-97595-23
http://www-esv.e-technik.uni-dortmund.de/content/Mitarbeiter/Seger/Seger.ht=
ml