[ovs-dev] [PATCH 03/16] packet: packet_get_tcp_flags: use flow's innermost dl_type
Simon Horman
horms at verge.net.au
Wed Feb 6 09:04:30 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.12 - v2.17
* 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 3e6011e..68a516c 100644
--- a/lib/packets.c
+++ b/lib/packets.c
@@ -875,8 +875,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