From owner-freebsd-net@FreeBSD.ORG Sun Dec 28 19:17:59 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36C299AE for ; Sun, 28 Dec 2014 19:17:59 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17CFE1318 for ; Sun, 28 Dec 2014 19:17:59 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id sBSJHw8T093976 for ; Sun, 28 Dec 2014 19:17:58 GMT (envelope-from root@phabric-backend.isc.freebsd.org) Received: (from root@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id sBSJHwYi093975; Sun, 28 Dec 2014 19:17:58 GMT (envelope-from root) Date: Sun, 28 Dec 2014 19:17:58 +0000 To: freebsd-net@freebsd.org From: "kibab (Ilya Bakulin)" Subject: [Differential] [Commented On] D1388: IP6: Turned on verbose logging for fragment handling code Message-ID: X-Priority: 3 Thread-Topic: D1388: IP6: Turned on verbose logging for fragment handling code X-Herald-Rules: none X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: In-Reply-To: References: Thread-Index: NzQ2MGZiNWU2MzVkYmUyNmI0Mzg5NzkzYTJjIFSgV2Y= X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2014 19:17:59 -0000 kibab added a comment. I have added the wrong revision to the review! This is the correct one, I couldn't edit the patch itself :-( --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -63,7 +63,7 @@ static void frag6_enq(struct ip6asfrag *, struct ip6asfrag *); static void frag6_deq(struct ip6asfrag *); static void frag6_insque(struct ip6q *, struct ip6q *); static void frag6_remque(struct ip6q *); -static void frag6_freef(struct ip6q *); +static void frag6_freef(struct ip6q *, int); static struct mtx ip6qlock; /* @@ -459,6 +459,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) i, ip6_sprintf(ip6buf, &q6->ip6q_src)); #endif free(ip6af, M_FTABLE); + frag6_freef(q6, 0); goto dropfrag; } } @@ -471,6 +472,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) i, ip6_sprintf(ip6buf, &q6->ip6q_src)); #endif free(ip6af, M_FTABLE); + frag6_freef(q6, 0); goto dropfrag; } } @@ -603,7 +605,7 @@ insert: * associated datagrams. */ void -frag6_freef(struct ip6q *q6) +frag6_freef(struct ip6q *q6, int sendicmp) { struct ip6asfrag *af6, *down6; @@ -620,7 +622,7 @@ frag6_freef(struct ip6q *q6) * Return ICMP time exceeded error for the 1st fragment. * Just free other fragments. */ - if (af6->ip6af_off == 0) { + if (af6->ip6af_off == 0 && sendicmp == 1) { struct ip6_hdr *ip6; /* adjust pointer */ @@ -719,7 +721,7 @@ frag6_slowtimo(void) if (q6->ip6q_prev->ip6q_ttl == 0) { IP6STAT_INC(ip6s_fragtimeout); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(q6->ip6q_prev); + frag6_freef(q6->ip6q_prev, 1); } } /* @@ -731,7 +733,7 @@ frag6_slowtimo(void) V_ip6q.ip6q_prev) { IP6STAT_INC(ip6s_fragoverflow); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(V_ip6q.ip6q_prev); + frag6_freef(V_ip6q.ip6q_prev, 1); } CURVNET_RESTORE(); } @@ -757,7 +759,7 @@ frag6_drain(void) while (V_ip6q.ip6q_next != &V_ip6q) { IP6STAT_INC(ip6s_fragdropped); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(V_ip6q.ip6q_next); + frag6_freef(V_ip6q.ip6q_next, 1); } CURVNET_RESTORE(); } REVISION DETAIL https://reviews.freebsd.org/D1388 To: kibab, bz Cc: freebsd-net