From patchwork Mon Jun 28 18:46:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Steffen X-Patchwork-Id: 57181 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D54C9B6EEB for ; Tue, 29 Jun 2010 04:58:01 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752703Ab0F1S55 (ORCPT ); Mon, 28 Jun 2010 14:57:57 -0400 Received: from hsrmx1.hsr.ch ([152.96.36.50]:48665 "EHLO hsrmx1.hsr.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751145Ab0F1S55 (ORCPT ); Mon, 28 Jun 2010 14:57:57 -0400 X-Greylist: delayed 663 seconds by postgrey-1.27 at vger.kernel.org; Mon, 28 Jun 2010 14:57:56 EDT Received: from localhost (localhost.localdomain [127.0.0.1]) by hsrmx1.hsr.ch (Postfix) with ESMTP id 8A42321085F for ; Mon, 28 Jun 2010 20:46:53 +0200 (CEST) Received: from hsrmx1.hsr.ch ([127.0.0.1]) by localhost (hsrmx1.hsr.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id zkqYOHEV-747 for ; Mon, 28 Jun 2010 20:46:51 +0200 (CEST) Received: from sid00101.hsr.ch (sid00100.hsr.ch [152.96.20.160]) by hsrmx1.hsr.ch (Postfix) with ESMTP id CCCCB210840 for ; Mon, 28 Jun 2010 20:46:51 +0200 (CEST) Received: from sid00100.hsr.ch (152.96.22.100) by sid00101.hsr.ch (152.96.20.160) with Microsoft SMTP Server (TLS) id 8.2.247.2; Mon, 28 Jun 2010 20:46:51 +0200 Received: from [10.10.0.20] (152.96.22.15) by smtp.hsr.ch (152.96.22.101) with Microsoft SMTP Server (TLS) id 8.2.247.2; Mon, 28 Jun 2010 20:46:50 +0200 Message-ID: <4C28EE19.2090502@hsr.ch> Date: Mon, 28 Jun 2010 20:46:49 +0200 From: Andreas Steffen Organization: HSR Hochschule fuer Technik Rapperswil User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: Subject: static inline int xfrm_mark_get() broken Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, experimenting with the new XFRM_MARK feature of the 2.6.34 kernel I found out that the extraction of the mark mask might accidentally work on 64 bit platforms but on 32 bit platforms the function is awfully broken. The rather trivial patch attached to this mail fixes the problem. Otherwise the XFRM_MARK feature seems quite promising! Best regards Andreas ====================================================================== Andreas Steffen e-mail: andreas.steffen@hsr.ch Institute for Internet Technologies and Applications Hochschule fuer Technik Rapperswil phone: +41 55 222 42 68 CH-8640 Rapperswil (Switzerland) mobile: +41 76 340 25 56 ===========================================================[ITA-HSR]== --- linux/include/net/xfrm.h.ori 2010-06-28 18:53:28.229489876 +0200 +++ linux/include/net/xfrm.h 2010-06-28 18:53:50.745487383 +0200 @@ -1587,7 +1587,7 @@ static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m) { if (attrs[XFRMA_MARK]) - memcpy(m, nla_data(attrs[XFRMA_MARK]), sizeof(m)); + memcpy(m, nla_data(attrs[XFRMA_MARK]), sizeof(struct xfrm_mark)); else m->v = m->m = 0;