From patchwork Wed Oct 16 02:01:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Yasevich X-Patchwork-Id: 283814 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 7B7462C0344 for ; Wed, 16 Oct 2013 13:02:06 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932877Ab3JPCCB (ORCPT ); Tue, 15 Oct 2013 22:02:01 -0400 Received: from mail-qe0-f45.google.com ([209.85.128.45]:56937 "EHLO mail-qe0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932759Ab3JPCB7 (ORCPT ); Tue, 15 Oct 2013 22:01:59 -0400 Received: by mail-qe0-f45.google.com with SMTP id 8so86680qea.32 for ; Tue, 15 Oct 2013 19:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zkyWlmuUymOzW0iyyisCvemz3hjk3sj7bXuNaNXrFUo=; b=mCAgrSM7SvqWdAzQxVeyC9LJvQhClEcraZQP72r4vx0+2qxuxSwS7WsnGrw2AXvyiO 1HNtS+P+Qx6tuc89w5c/C5FqOoq+3805nwIrZRk/+zmWgeQ99eIwusFlZRA0UKZu5acq Wf34lqUr7rUXPDs/O3jH/WvNiD2kmPvVk9AUdTE1XWzc5peZUGE3LiC7FuOty/wLoBss XL24Pt7FD30j/9t0ruxdoS8YJd5qS9RsqZR5eIQ/1Ct4Zx49ol8lciGkwnoNOM7d3NgE zy1DyF8QdUv1uiet96MDkg6cczAMWugxV8QIkgNngW9+nVdPSFMZtbhWiLc3/M3ewPyC Ig5A== X-Received: by 10.49.82.52 with SMTP id f20mr269277qey.73.1381888919118; Tue, 15 Oct 2013 19:01:59 -0700 (PDT) Received: from localhost.localdomain (pool-70-109-158-146.cncdnh.east.myfairpoint.net. [70.109.158.146]) by mx.google.com with ESMTPSA id fx6sm143439510qeb.1.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 15 Oct 2013 19:01:58 -0700 (PDT) From: Vlad Yasevich To: netdev@vger.kernel.org Cc: linux-sctp@vger.kernel.org, fan.du@windriver.com, Vlad Yasevich Subject: [PATCH v4 net 1/3] net: dst: provide accessor function to dst->xfrm Date: Tue, 15 Oct 2013 22:01:29 -0400 Message-Id: <1381888891-31186-2-git-send-email-vyasevich@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1381888891-31186-1-git-send-email-vyasevich@gmail.com> References: <1381888891-31186-1-git-send-email-vyasevich@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org dst->xfrm is conditionally defined. Provide accessor funtion that is always available. Signed-off-by: Vlad Yasevich Acked-by: Neil Horman --- include/net/dst.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/net/dst.h b/include/net/dst.h index 3bc4865..3c4c944 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -479,10 +479,22 @@ static inline struct dst_entry *xfrm_lookup(struct net *net, { return dst_orig; } + +static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) +{ + return NULL; +} + #else extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, const struct flowi *fl, struct sock *sk, int flags); + +/* skb attached with this dst needs transformation if dst->xfrm is valid */ +static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) +{ + return dst->xfrm; +} #endif #endif /* _NET_DST_H */