From owner-svn-src-all@freebsd.org Thu Aug 27 14:07:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4B149C308A; Thu, 27 Aug 2015 14:07:29 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 C54A81F2B; Thu, 27 Aug 2015 14:07:29 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RE7TJk074802; Thu, 27 Aug 2015 14:07:29 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RE7T3T074801; Thu, 27 Aug 2015 14:07:29 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508271407.t7RE7T3T074801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 27 Aug 2015 14:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r287207 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Thu, 27 Aug 2015 14:07:29 -0000 Author: loos Date: Thu Aug 27 14:07:28 2015 New Revision: 287207 URL: https://svnweb.freebsd.org/changeset/base/287207 Log: MFC r287119: Reapply r196551 which was accidentally reverted by r223637 (update to OpenBSD pf 4.5). Fix argument ordering to memcpy as well as the size of the copy in the (theoretical) case that pfi_buffer_cnt should be greater than ~_max. This fix the failure when you hit the self table size and force it to be resized. Sponsored by: Rubicon Communications (Netgate) Modified: stable/10/sys/netpfil/pf/pf_if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_if.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_if.c Thu Aug 27 14:00:23 2015 (r287206) +++ stable/10/sys/netpfil/pf/pf_if.c Thu Aug 27 14:07:28 2015 (r287207) @@ -578,7 +578,7 @@ pfi_address_add(struct sockaddr *sa, int __func__, V_pfi_buffer_cnt, PFI_BUFFER_MAX); return; } - memcpy(V_pfi_buffer, p, V_pfi_buffer_cnt * sizeof(*V_pfi_buffer)); + memcpy(p, V_pfi_buffer, V_pfi_buffer_max * sizeof(*V_pfi_buffer)); /* no need to zero buffer */ free(V_pfi_buffer, PFI_MTYPE); V_pfi_buffer = p;