Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1215654 > unrolled thread

[PATCH net-next] openvswitch: Fix conntrack compilation without mark.

Started byJoe Stringer <joestringer@nicira.com>
First post2015-08-29 04:30 +0200
Last post2015-08-29 07:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net-next] openvswitch: Fix conntrack compilation without mark. Joe Stringer <joestringer@nicira.com> - 2015-08-29 04:30 +0200
    Re: [PATCH net-next] openvswitch: Fix conntrack compilation without  mark. Simon Horman <simon.horman@netronome.com> - 2015-08-29 04:40 +0200
    Re: [PATCH net-next] openvswitch: Fix conntrack compilation  without mark. David Miller <davem@davemloft.net> - 2015-08-29 07:30 +0200

#1215654 — [PATCH net-next] openvswitch: Fix conntrack compilation without mark.

FromJoe Stringer <joestringer@nicira.com>
Date2015-08-29 04:30 +0200
Subject[PATCH net-next] openvswitch: Fix conntrack compilation without mark.
Message-ID<q2E42-592-11@gated-at.bofh.it>
Fix build with !CONFIG_NF_CONNTRACK_MARK && CONFIG_OPENVSWITCH_CONNTRACK

Fixes: 182e304 ("openvswitch: Allow matching on conntrack mark")
Reported-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
---
 net/openvswitch/conntrack.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index 886bd27..e8e524a 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -100,6 +100,15 @@ static u8 ovs_ct_get_state(enum ip_conntrack_info ctinfo)
 	return ct_state;
 }
 
+static u32 ovs_ct_get_mark(const struct nf_conn *ct)
+{
+#if IS_ENABLED(CONFIG_NF_CONNTRACK_MARK)
+	return ct ? ct->mark : 0;
+#else
+	return 0;
+#endif
+}
+
 static void ovs_ct_get_label(const struct nf_conn *ct,
 			     struct ovs_key_ct_label *label)
 {
@@ -124,7 +133,7 @@ static void __ovs_ct_update_key(struct sw_flow_key *key, u8 state,
 {
 	key->ct.state = state;
 	key->ct.zone = zone->id;
-	key->ct.mark = ct ? ct->mark : 0;
+	key->ct.mark = ovs_ct_get_mark(ct);
 	ovs_ct_get_label(ct, &key->ct.label);
 }
 
@@ -180,12 +189,11 @@ int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb)
 static int ovs_ct_set_mark(struct sk_buff *skb, struct sw_flow_key *key,
 			   u32 ct_mark, u32 mask)
 {
+#if IS_ENABLED(CONFIG_NF_CONNTRACK_MARK)
 	enum ip_conntrack_info ctinfo;
 	struct nf_conn *ct;
 	u32 new_mark;
 
-	if (!IS_ENABLED(CONFIG_NF_CONNTRACK_MARK))
-		return -ENOTSUPP;
 
 	/* The connection could be invalid, in which case set_mark is no-op. */
 	ct = nf_ct_get(skb, &ctinfo);
@@ -200,6 +208,9 @@ static int ovs_ct_set_mark(struct sk_buff *skb, struct sw_flow_key *key,
 	}
 
 	return 0;
+#else
+	return -ENOTSUPP;
+#endif
 }
 
 static int ovs_ct_set_label(struct sk_buff *skb, struct sw_flow_key *key,
-- 
2.1.4

--
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/

[toc] | [next] | [standalone]


#1215656 — Re: [PATCH net-next] openvswitch: Fix conntrack compilation without mark.

FromSimon Horman <simon.horman@netronome.com>
Date2015-08-29 04:40 +0200
SubjectRe: [PATCH net-next] openvswitch: Fix conntrack compilation without mark.
Message-ID<q2EdI-5ka-7@gated-at.bofh.it>
In reply to#1215654
On Fri, Aug 28, 2015 at 07:22:11PM -0700, Joe Stringer wrote:
> Fix build with !CONFIG_NF_CONNTRACK_MARK && CONFIG_OPENVSWITCH_CONNTRACK
> 
> Fixes: 182e304 ("openvswitch: Allow matching on conntrack mark")
> Reported-by: Simon Horman <simon.horman@netronome.com>
> Signed-off-by: Joe Stringer <joestringer@nicira.com>

Thanks Joe,

this seems to solve the build problem that I observed.

Tested-by: Simon Horman <simon.horman@netronome.com>
--
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/

[toc] | [prev] | [next] | [standalone]


#1215718 — Re: [PATCH net-next] openvswitch: Fix conntrack compilation without mark.

FromDavid Miller <davem@davemloft.net>
Date2015-08-29 07:30 +0200
SubjectRe: [PATCH net-next] openvswitch: Fix conntrack compilation without mark.
Message-ID<q2GSe-L5-5@gated-at.bofh.it>
In reply to#1215654
From: Joe Stringer <joestringer@nicira.com>
Date: Fri, 28 Aug 2015 19:22:11 -0700

> Fix build with !CONFIG_NF_CONNTRACK_MARK && CONFIG_OPENVSWITCH_CONNTRACK
> 
> Fixes: 182e304 ("openvswitch: Allow matching on conntrack mark")
> Reported-by: Simon Horman <simon.horman@netronome.com>
> Signed-off-by: Joe Stringer <joestringer@nicira.com>

Applied, thanks.
--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web