[ovs-dev] [PATCH 09/16] packet: packet_get_tcp_flags: use flow's innermost dl_type

Simon Horman horms at verge.net.au
Thu Jan 3 02:53:43 UTC 2013


Use the innermost dl_type when decoding L3 and L4 data from a packet.

Signed-off-by: Simon Horman <horms at verge.net.au>

---

v2.13
* No change

v2.12
* Use flow_innermost_dl_type helper

v2.11
* First post
---
 lib/packets.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/packets.c b/lib/packets.c
index 3e7279c..3f56725 100644
--- a/lib/packets.c
+++ b/lib/packets.c
@@ -898,8 +898,8 @@ packet_set_udp_port(struct ofpbuf *packet, ovs_be16 src, ovs_be16 dst)
 uint8_t
 packet_get_tcp_flags(const struct ofpbuf *packet, const struct flow *flow)
 {
-    if ((flow->dl_type == htons(ETH_TYPE_IP) ||
-         flow->dl_type == htons(ETH_TYPE_IPV6)) &&
+    ovs_be16 dl_type = flow_innermost_dl_type(flow);
+    if ((dl_type == htons(ETH_TYPE_IP) || dl_type == htons(ETH_TYPE_IPV6)) &&
         flow->nw_proto == IPPROTO_TCP && packet->l7) {
         const struct tcp_header *tcp = packet->l4;
         return TCP_FLAGS(tcp->tcp_ctl);
-- 
1.7.10.4




More information about the dev mailing list