netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf-next 4/4] openvswitch: __nf_ct_l{3,4}proto_find() always return a valid pointer
@ 2016-05-03 10:54 Pablo Neira Ayuso
       [not found] ` <1462272863-23946-1-git-send-email-pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.org>
  2016-05-03 22:12 ` [PATCH nf-next 4/4] openvswitch: __nf_ct_l{3,4}proto_find() " Joe Stringer
  0 siblings, 2 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2016-05-03 10:54 UTC (permalink / raw)
  To: netfilter-devel; +Cc: dev, joestringer

If the protocol is not natively supported, this assigns generic protocol
tracker so we can always assume a valid pointer after these calls.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/openvswitch/conntrack.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index 9741a76..9f0bc49 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -439,20 +439,12 @@ ovs_ct_find_existing(struct net *net, const struct nf_conntrack_zone *zone,
 	u8 protonum;
 
 	l3proto = __nf_ct_l3proto_find(l3num);
-	if (!l3proto) {
-		pr_debug("ovs_ct_find_existing: Can't get l3proto\n");
-		return NULL;
-	}
 	if (l3proto->get_l4proto(skb, skb_network_offset(skb), &dataoff,
 				 &protonum) <= 0) {
 		pr_debug("ovs_ct_find_existing: Can't get protonum\n");
 		return NULL;
 	}
 	l4proto = __nf_ct_l4proto_find(l3num, protonum);
-	if (!l4proto) {
-		pr_debug("ovs_ct_find_existing: Can't get l4proto\n");
-		return NULL;
-	}
 	if (!nf_ct_get_tuple(skb, skb_network_offset(skb), dataoff, l3num,
 			     protonum, net, &tuple, l3proto, l4proto)) {
 		pr_debug("ovs_ct_find_existing: Can't get tuple\n");
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH nf-next 4/4] openvswitch: __nf_ct_l{3, 4}proto_find() always return a valid pointer
       [not found] ` <1462272863-23946-1-git-send-email-pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.org>
@ 2016-05-03 16:46   ` Jarno Rajahalme
  0 siblings, 0 replies; 3+ messages in thread
From: Jarno Rajahalme @ 2016-05-03 16:46 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: ovs dev, joestringer-l0M0P4e3n4LQT0dZR+AlfA,
	netfilter-devel-u79uwXL29TY76Z2rM5mHXA

Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>

> On May 3, 2016, at 3:54 AM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> 
> If the protocol is not natively supported, this assigns generic protocol
> tracker so we can always assume a valid pointer after these calls.
> 
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
> net/openvswitch/conntrack.c | 8 --------
> 1 file changed, 8 deletions(-)
> 
> diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
> index 9741a76..9f0bc49 100644
> --- a/net/openvswitch/conntrack.c
> +++ b/net/openvswitch/conntrack.c
> @@ -439,20 +439,12 @@ ovs_ct_find_existing(struct net *net, const struct nf_conntrack_zone *zone,
> 	u8 protonum;
> 
> 	l3proto = __nf_ct_l3proto_find(l3num);
> -	if (!l3proto) {
> -		pr_debug("ovs_ct_find_existing: Can't get l3proto\n");
> -		return NULL;
> -	}
> 	if (l3proto->get_l4proto(skb, skb_network_offset(skb), &dataoff,
> 				 &protonum) <= 0) {
> 		pr_debug("ovs_ct_find_existing: Can't get protonum\n");
> 		return NULL;
> 	}
> 	l4proto = __nf_ct_l4proto_find(l3num, protonum);
> -	if (!l4proto) {
> -		pr_debug("ovs_ct_find_existing: Can't get l4proto\n");
> -		return NULL;
> -	}
> 	if (!nf_ct_get_tuple(skb, skb_network_offset(skb), dataoff, l3num,
> 			     protonum, net, &tuple, l3proto, l4proto)) {
> 		pr_debug("ovs_ct_find_existing: Can't get tuple\n");
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH nf-next 4/4] openvswitch: __nf_ct_l{3,4}proto_find() always return a valid pointer
  2016-05-03 10:54 [PATCH nf-next 4/4] openvswitch: __nf_ct_l{3,4}proto_find() always return a valid pointer Pablo Neira Ayuso
       [not found] ` <1462272863-23946-1-git-send-email-pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.org>
@ 2016-05-03 22:12 ` Joe Stringer
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Stringer @ 2016-05-03 22:12 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel, ovs dev

On 3 May 2016 at 03:54, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> If the protocol is not natively supported, this assigns generic protocol
> tracker so we can always assume a valid pointer after these calls.
>
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Thanks for the cleanup.

Acked-by: Joe Stringer <joe@ovn.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-03 22:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03 10:54 [PATCH nf-next 4/4] openvswitch: __nf_ct_l{3,4}proto_find() always return a valid pointer Pablo Neira Ayuso
     [not found] ` <1462272863-23946-1-git-send-email-pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.org>
2016-05-03 16:46   ` [PATCH nf-next 4/4] openvswitch: __nf_ct_l{3, 4}proto_find() " Jarno Rajahalme
2016-05-03 22:12 ` [PATCH nf-next 4/4] openvswitch: __nf_ct_l{3,4}proto_find() " Joe Stringer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).