From 1d8b891867153a6c3daf5a7f4dbb638a46f8063a Mon Sep 17 00:00:00 2001 From: itojun Date: Sat, 18 May 2002 22:52:44 +0000 Subject: [PATCH] sync with KAME. - make altq_etherclassify() able to handle packets whose ethernet header is in a separate mbuf. closes netbsd PR 16559 --- sys/net/if_ethersubr.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index cdb1317668dd..08263aaf5a4f 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ethersubr.c,v 1.94 2002/04/27 02:38:47 enami Exp $ */ +/* $NetBSD: if_ethersubr.c,v 1.95 2002/05/18 22:52:44 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.94 2002/04/27 02:38:47 enami Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.95 2002/05/18 22:52:44 itojun Exp $"); #include "opt_inet.h" #include "opt_atalk.h" @@ -595,12 +595,15 @@ altq_etherclassify(struct ifaltq *ifq, struct mbuf *m, break; } + while (m->m_len <= hlen) { + hlen -= m->m_len; + m = m->m_next; + } if (m->m_len < (hlen + hdrsize)) { /* - * Ethernet and protocol header not in a single - * mbuf. We can't cope with this situation right + * protocol header not in a single mbuf. + * We can't cope with this situation right * now (but it shouldn't ever happen, really, anyhow). - * XXX Should use m_pulldown(). */ #ifdef DEBUG printf("altq_etherclassify: headers span multiple mbufs: "