Skip to contentSkip to conversation

openvswitch: __nf_ct_l{3,4}proto_find() always return a valid pointer

PATCH In review Pablo Neira Ayuso 3 participants 3 messages May 3, 2016 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 4/4 openvswitch: __nf_ct_l{3,4}proto_find() always return a valid pointer

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

---
 net/openvswitch/conntrack.c | 8 --------
 1 file changed, 8 deletions(-)
net/openvswitch/conntrack.c +0 -8
index 9741a76..9f0bc49 100644
@@ -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");
Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCH nf-next 4/4] openvswitch: __nf_ct_l{3, 4}proto_find() always return a valid pointer

In reply to a message not in the archive
Quoted 42 lines · Pablo Neira Ayuso

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

---
net/openvswitch/conntrack.c | 8 --------

1 file changed, 8 deletions(-)
net/openvswitch/conntrack.c +0 -8
index 9741a76..9f0bc49 100644
@@ -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");
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev