Date: Tue, 30 Mar 2010 09:17:22 GMT From: Ana Kukec <anchie@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 176275 for review Message-ID: <201003300917.o2U9HMgX027032@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=176275 Change 176275 by anchie@anchie_malimis on 2010/03/30 09:16:35 Still trying to get rid of the panic soreceive_generic(). Affected files ... .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#36 edit Differences ... ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#36 (text+ko) ==== @@ -236,7 +236,7 @@ { u_int len; struct ip6_hdr *ip6; - struct snd_hdr *snd_hdr; + struct snd_hdr *snd_hdr = NULL; printf("send_sendso_input \n"); @@ -253,19 +253,29 @@ if (len != msglen) printf("XXX-BZ %s: (m)len=%u (ip6)msglen=%d", __func__, len, msglen); - M_PREPEND(m, SEND_HDR_LEN, M_DONTWAIT); - if (m == NULL) { - m_freem(m); - return (ENOBUFS); - } +printf("M_LEADINGSPACE(%d) >= SEND_HDR_LEN(%d)?\n", M_LEADINGSPACE(m), SEND_HDR_LEN); + if (M_LEADINGSPACE(m) >= SEND_HDR_LEN) { + M_PREPEND(m, SEND_HDR_LEN, M_PKTHDR|M_DONTWAIT); + snd_hdr = mtod(m, struct snd_hdr *); + snd_hdr->direction = direction; + snd_hdr->ifidx = -1; + } else { + struct mbuf *n; + MGET(n, M_PKTHDR|M_DONTWAIT, MT_DATA); + if (n == NULL) { + m_freem(m); + return ENOBUFS; + } - m->m_flags &= M_PKTHDR; -printf("MLEN: %d, MHLEN: %d, SEND_HDR_LEN: %d \n", MLEN, MHLEN, SEND_HDR_LEN); + snd_hdr = mtod(n, struct snd_hdr *); + snd_hdr->direction = direction; + snd_hdr->ifidx = -1; - snd_hdr = mtod(m, struct snd_hdr *); - snd_hdr->direction = direction; - snd_hdr->ifidx = -1; -printf("direction: %d \n", snd_hdr->direction); + n->m_len = SEND_HDR_LEN; + n->m_next = m->m_next; + m->m_next = n; + m->m_pkthdr.len += SEND_HDR_LEN; + } /* * Send incoming or outgoing traffic to the user space either to be @@ -275,7 +285,6 @@ SOCKBUF_LOCK(&s->so_rcv); sbappendrecord_locked(&s->so_rcv, m); sorwakeup_locked(s); -printf("Nakon sorwakeup \n"); return 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003300917.o2U9HMgX027032>