From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 01:25:50 2015 Return-Path: Delivered-To: svn-src-all@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 25889B4E; Mon, 16 Feb 2015 01:25:50 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BCE55176; Mon, 16 Feb 2015 01:25:49 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 6FD0125D3A8F; Mon, 16 Feb 2015 01:25:40 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id A02A8C77045; Mon, 16 Feb 2015 01:25:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Qlkp5B-Jo7fJ; Mon, 16 Feb 2015 01:25:37 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:75b7:e357:a2dd:8cdb] (unknown [IPv6:fde9:577b:c1a9:4410:75b7:e357:a2dd:8cdb]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 3025CC77043; Mon, 16 Feb 2015 01:25:37 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278828 - head/sys/netinet6 From: "Bjoern A. Zeeb" In-Reply-To: <201502160112.t1G1CKd0074570@svn.freebsd.org> Date: Mon, 16 Feb 2015 01:25:05 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201502160112.t1G1CKd0074570@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2015 01:25:50 -0000 > On 16 Feb 2015, at 01:12 , Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Mon Feb 16 01:12:20 2015 > New Revision: 278828 > URL: https://svnweb.freebsd.org/changeset/base/278828 >=20 > Log: > Factor out ip6_deletefraghdr() function, to be shared between IPv6 > stack and pf(4). >=20 > Submitted by: Kristof Provost > Reviewed by: ae > Differential Revision: D1764 >=20 > Modified: > head/sys/netinet6/frag6.c > head/sys/netinet6/ip6_output.c Why did it have to move file? > head/sys/netinet6/ip6_var.h >=20 > Modified: head/sys/netinet6/frag6.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/netinet6/frag6.c Sun Feb 15 23:58:57 2015 = (r278827) > +++ head/sys/netinet6/frag6.c Mon Feb 16 01:12:20 2015 = (r278828) > @@ -541,27 +541,16 @@ insert: > *q6->ip6q_nxtp =3D (u_char)(nxt & 0xff); > #endif >=20 > - /* Delete frag6 header */ > - if (m->m_len >=3D offset + sizeof(struct ip6_frag)) { > - /* This is the only possible case with !PULLDOWN_TEST */ > - ovbcopy((caddr_t)ip6, (caddr_t)ip6 + sizeof(struct = ip6_frag), > - offset); > - m->m_data +=3D sizeof(struct ip6_frag); > - m->m_len -=3D sizeof(struct ip6_frag); > - } else { > - /* this comes with no copy if the boundary is on cluster = */ > - if ((t =3D m_split(m, offset, M_NOWAIT)) =3D=3D NULL) { > - frag6_remque(q6); > - V_frag6_nfrags -=3D q6->ip6q_nfrag; > + if (ip6_deletefraghdr(m, offset, M_NOWAIT) !=3D 0) { > + frag6_remque(q6); > + V_frag6_nfrags -=3D q6->ip6q_nfrag; > #ifdef MAC > - mac_ip6q_destroy(q6); > + mac_ip6q_destroy(q6); > #endif > - free(q6, M_FTABLE); > - V_frag6_nfragpackets--; > - goto dropfrag; > - } > - m_adj(t, sizeof(struct ip6_frag)); > - m_cat(m, t); > + free(q6, M_FTABLE); > + V_frag6_nfragpackets--; > + > + goto dropfrag; > } >=20 > /* >=20 > Modified: head/sys/netinet6/ip6_output.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/netinet6/ip6_output.c Sun Feb 15 23:58:57 2015 = (r278827) > +++ head/sys/netinet6/ip6_output.c Mon Feb 16 01:12:20 2015 = (r278828) > @@ -1206,6 +1206,30 @@ ip6_insertfraghdr(struct mbuf *m0, struc > return (0); > } >=20 > +int > +ip6_deletefraghdr(struct mbuf *m, int offset, int wait) > +{ > + struct ip6_hdr *ip6 =3D mtod(m, struct ip6_hdr *); > + struct mbuf *t; > + > + /* Delete frag6 header. */ > + if (m->m_len >=3D offset + sizeof(struct ip6_frag)) { > + /* This is the only possible case with !PULLDOWN_TEST. = */ > + bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag), > + offset); > + m->m_data +=3D sizeof(struct ip6_frag); > + m->m_len -=3D sizeof(struct ip6_frag); > + } else { > + /* This comes with no copy if the boundary is on = cluster. */ > + if ((t =3D m_split(m, offset, wait)) =3D=3D NULL) > + return (ENOMEM); > + m_adj(t, sizeof(struct ip6_frag)); > + m_cat(m, t); > + } > + > + return (0); > +} > + > static int > ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, > struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, >=20 > Modified: head/sys/netinet6/ip6_var.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/netinet6/ip6_var.h Sun Feb 15 23:58:57 2015 = (r278827) > +++ head/sys/netinet6/ip6_var.h Mon Feb 16 01:12:20 2015 = (r278828) > @@ -388,6 +388,7 @@ int ip6_setpktopts(struct mbuf *, struct > void ip6_clearpktopts(struct ip6_pktopts *, int); > struct ip6_pktopts *ip6_copypktopts(struct ip6_pktopts *, int); > int ip6_optlen(struct inpcb *); > +int ip6_deletefraghdr(struct mbuf *, int, int); >=20 > int route6_input(struct mbuf **, int *, int); >=20 >=20 =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend."