diff --git a/scapy/contrib/openflow.py b/scapy/contrib/openflow.py
index dd11630acfd95fbb7c618996cf18c63631a58aa3..62c0f031d6d3199fef51d5baa9bd52dc7ec25893 100755
--- a/scapy/contrib/openflow.py
+++ b/scapy/contrib/openflow.py
@@ -1183,7 +1183,7 @@ ofpt_cls = {  0: OFPTHello,
 TCP_guess_payload_class_copy = TCP.guess_payload_class
 
 def OpenFlow(self, payload):
-    if self is None or self.dport == 6653 or self.dport == 6633 or self.sport == 6653 or self.sport == 6653:
+    if self is None or self.dport == 6653 or self.dport == 6633 or self.sport == 6653 or self.sport == 6633:
     # port 6653 has been allocated by IANA, port 6633 should no longer be used
     # OpenFlow function may be called with None self in OFPPacketField
         of_type = ord(payload[1])
diff --git a/scapy/contrib/openflow.uts b/scapy/contrib/openflow.uts
index dd2d0bf6470e7e4eae0423b598622f7c307b96e8..c58541b1da4789beabad863e05ee331ed10986bb 100755
--- a/scapy/contrib/openflow.uts
+++ b/scapy/contrib/openflow.uts
@@ -77,5 +77,4 @@ s = b'\x01#Eg\x89\xab\x00\x11"3DU\x08\x00E\x00\x000\x00\x01\x00\x00@\x06\xaf\xee
 assert(str(ofm) == s)
 e = Ether(s)
 e.show2()
-of = OFPTFeaturesRequest(e[TCP].load)
-of.xid == 23
+e[OFPTFeaturesRequest].xid == 23
diff --git a/scapy/contrib/openflow3.py b/scapy/contrib/openflow3.py
index e59e5f90e552ec15be7ec6ca870d155756e89e4f..df8ed5aab9ead909256f85ca7708366c57a2dd3b 100755
--- a/scapy/contrib/openflow3.py
+++ b/scapy/contrib/openflow3.py
@@ -3348,7 +3348,7 @@ ofpt_cls = {  0: OFPTHello,
 TCP_guess_payload_class_copy = TCP.guess_payload_class
 
 def OpenFlow(self, payload):
-    if self is None or self.dport == 6653 or self.dport == 6633 or self.sport == 6653 or self.sport == 6653:
+    if self is None or self.dport == 6653 or self.dport == 6633 or self.sport == 6653 or self.sport == 6633:
     # port 6653 has been allocated by IANA, port 6633 should no longer be used
     # OpenFlow function may be called with None self in OFPPacketField
         of_type = ord(payload[1])
diff --git a/scapy/contrib/openflow3.uts b/scapy/contrib/openflow3.uts
index b86230091c98ed9f6cfee8cef6b1fbeb03efa299..bd0cf5b3d40189b3e77548ad1655efcf56c1895f 100755
--- a/scapy/contrib/openflow3.uts
+++ b/scapy/contrib/openflow3.uts
@@ -87,5 +87,4 @@ s = b'\x01#Eg\x89\xab\x00\x11"3DU\x08\x00E\x00\x000\x00\x01\x00\x00@\x06\xaf\xee
 assert(str(ofm) == s)
 e = Ether(s)
 e.show2()
-of = OFPTFeaturesRequest(e[TCP].load)
-of.xid == 23
+e[OFPTFeaturesRequest].xid == 23