From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754638AbbBGMed (ORCPT ); Sat, 7 Feb 2015 07:34:33 -0500 Received: from mail-la0-f47.google.com ([209.85.215.47]:34518 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373AbbBGMeb (ORCPT ); Sat, 7 Feb 2015 07:34:31 -0500 From: Rasmus Villemoes To: Cong Wang Cc: "David S. Miller" , Pravin B Shelar , Nicolas Dichtel , Linux Kernel Network Developers , LKML Subject: Re: [PATCH] vxlan: Wrong type passed to %pIS Organization: D03 References: <1423275451-3663-1-git-send-email-linux@rasmusvillemoes.dk> X-Hashcash: 1:20:150207:netdev@vger.kernel.org::DfJNvxtJcEWO2bIw:00000000000000000000000000000000000000015/x X-Hashcash: 1:20:150207:xiyou.wangcong@gmail.com::Rxzbeu945uOWunLV:000000000000000000000000000000000000028UV X-Hashcash: 1:20:150207:davem@davemloft.net::W2yujwmiV8qVVba8:0000000000000000000000000000000000000000003rGm X-Hashcash: 1:20:150207:nicolas.dichtel@6wind.com::LDqJXGxcdIu2BuT3:0000000000000000000000000000000000008RvO X-Hashcash: 1:20:150207:pshelar@nicira.com::ad34esHZbcCdaFl9:0000000000000000000000000000000000000000000AWR8 X-Hashcash: 1:20:150207:linux-kernel@vger.kernel.org::SzG5O3jVq1uDBApT:0000000000000000000000000000000007pzu Date: Sat, 07 Feb 2015 13:34:27 +0100 In-Reply-To: (Cong Wang's message of "Fri, 6 Feb 2015 21:13:31 -0800") Message-ID: <87wq3tnbn0.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 07 2015, Cong Wang wrote: > On Fri, Feb 6, 2015 at 6:17 PM, Rasmus Villemoes > wrote: >> src_ip is a pointer to a union vxlan_addr, one member of which is a >> struct sockaddr. Passing a pointer to src_ip is wrong; one should pass >> the value of src_ip itself. Since %pIS formally expects something of >> type struct sockaddr*, let's pass a pointer to the appropriate union >> member, though this of course doesn't change the generated code. >> > > > It is a union, this doesn't harm. > Just to be clear: This fixes a real bug. The minimal fix had been - src_mac, &rdst->remote_ip, &src_ip); + src_mac, &rdst->remote_ip, src_ip); but I through in the cosmetic improvements while the line needed changing anyway. > Since you are on it, there is another similar place in vxlan too. ... which is why I didn't change that other occurrence. Rasmus