From owner-svn-src-head@FreeBSD.ORG Sat Nov 2 05:53:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA743232; Sat, 2 Nov 2013 05:53:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-x22a.google.com (mail-qe0-x22a.google.com [IPv6:2607:f8b0:400d:c02::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38895229B; Sat, 2 Nov 2013 05:53:28 +0000 (UTC) Received: by mail-qe0-f42.google.com with SMTP id gc15so3091213qeb.29 for ; Fri, 01 Nov 2013 22:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=tZ7UBKWXg7OCKLk7eEXgmDqvNXv2QLN6Jg88y81JQoY=; b=aW8M3oFc1HD27SEsFdcXzIATTlsKLgYMKKph3bJsYrWf6RtEORjWMfwlvMLsAatwrA VssjjghC0TD8E0GlXo52Euc82MTW6LMad9SnZ7tVSXYBtKdXNoDd9QiFOIJrA1QBWRze h7riirLVzB15NstXBhZKipDH2vQfjREnI0KldgUYn0TvceeEaGc4sGiAgR2Ax6EMEy71 MHykQD/Cw9Y4cKYFPXUDCDsmhANeaeOd/JpQTTOhiG2w9ab67B+ujj9X3Jj33srX7W82 u0XuC3LtsUSXo537NBM1l+G9y6U67BsNuh0fCOV2KnwlphTGqKa8poX0wSeLmsq9Kb85 RIUA== MIME-Version: 1.0 X-Received: by 10.224.55.80 with SMTP id t16mr151379qag.106.1383371607473; Fri, 01 Nov 2013 22:53:27 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Fri, 1 Nov 2013 22:53:27 -0700 (PDT) In-Reply-To: <20131102151309.A1102@besplex.bde.org> References: <201311020011.rA20BchL020170@svn.freebsd.org> <20131102151309.A1102@besplex.bde.org> Date: Fri, 1 Nov 2013 22:53:27 -0700 X-Google-Sender-Auth: ZIAPvzuNc4eorAPqzlZIX3ju758 Message-ID: Subject: Re: svn commit: r257535 - head/sys/netgraph From: Adrian Chadd To: Bruce Evans , Mark Murray Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2013 05:53:28 -0000 Hm! A good question! On 1 November 2013 22:22, Bruce Evans wrote: >> if (harvest.point_to_point) >> - random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG); > > > '&(m->m_data)' is not just a pair of style bugs. It gives address of > the pointer (somewhere in the mbuf header), not the address of pointed- > to data, so the randomness was almost null. The style bugs are > excessive parentheses and chumminess with the implementation (non-use > of the accessor function mtod()). > > >> + random_harvest(mtod(m, const void *), 12, 2, >> RANDOM_NET_NG); > > > Presumably you really do want to harvest the pointed-to data and there > are at least 12 bytes of it, so the semantic fix isn't backwards or a > buffer overrun. > Mark - did you initially mean the address of the mbuf m_data pointer, or the data payload itself? -adrian