Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755344AbYJWUz6 (ORCPT ); Thu, 23 Oct 2008 16:55:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751852AbYJWUzq (ORCPT ); Thu, 23 Oct 2008 16:55:46 -0400 Received: from kandzendo.ru ([195.178.208.66]:48276 "EHLO tservice.net.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751818AbYJWUzq (ORCPT ); Thu, 23 Oct 2008 16:55:46 -0400 Date: Fri, 24 Oct 2008 00:55:43 +0400 From: Evgeniy Polyakov To: David Miller Cc: michellammertink@gmail.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] netlink: fix append of whole original message on negative ack. Message-ID: <20081023205543.GA19462@ioremap.net> References: <4900BFCF.2030707@gmail.com> <20081023.134513.267548182.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081023.134513.267548182.davem@davemloft.net> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1255 Lines: 22 Hi. On Thu, Oct 23, 2008 at 01:45:13PM -0700, David Miller (davem@davemloft.net) wrote: > > Netlink can return an negative acknowledgement, which AFAICT should include an error code and the whole original message. This patch fixes the size argument given to the __nlmsg_put call. Without this patch only the original header was attached. > > --- > > > > Can anyone explain to me why struct nlmsgerr contains an int error and the nlmsghdr struct. The comment in netlink_ack states that the whole message should be appended. Why not only include an int error in struct nlmsgerr and just append the original message? Having header (even seq/pid only) is enough to find a message for that userspace which cares. Looks like your patch can break existing applications which are used to work with header only, even if that was a mistake? Although application is supposed to check the length, it still can expect only a header. I have to note, that I do not know any such application though. -- Evgeniy Polyakov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/