aboutsummaryrefslogtreecommitdiff
path: root/lib/packets.h
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2013-02-06 22:53:54 +0900
committerBen Pfaff <blp@nicira.com>2013-02-06 09:20:04 -0800
commite8c16d83665f4a4e74e3cc7f736b3802b46f660c (patch)
treec260ee091f8aa5b35b3e91f44d42c251eece9a66 /lib/packets.h
parent3779fc82d4822d0d688a65f47c0abb9657a1cf21 (diff)
packet: packet_get_tcp_flags: use flow's innermost dl_type
Use the innermost dl_type when decoding L3 and L4 data from a packet. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/packets.h')
-rw-r--r--lib/packets.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/packets.h b/lib/packets.h
index 973f3e87..0f97fe62 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -548,10 +548,15 @@ static inline bool ipv6_mask_is_exact(const struct in6_addr *mask) {
return ipv6_addr_equals(mask, &in6addr_exact);
}
+static inline bool dl_type_is_ip_any(ovs_be16 dl_type)
+{
+ return dl_type == htons(ETH_TYPE_IP)
+ || dl_type == htons(ETH_TYPE_IPV6);
+}
+
static inline bool is_ip_any(const struct flow *flow)
{
- return flow->dl_type == htons(ETH_TYPE_IP)
- || flow->dl_type == htons(ETH_TYPE_IPV6);
+ return dl_type_is_ip_any(flow->dl_type);
}
void format_ipv6_addr(char *addr_str, const struct in6_addr *addr);