aboutsummaryrefslogtreecommitdiff
path: root/lib/packets.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2012-03-26 12:56:14 -0700
committerJesse Gross <jesse@nicira.com>2012-03-26 15:53:42 -0700
commit734ec5ec13499a2e7112626564cc9bd0c2d06600 (patch)
tree4926f8f1b69d82839a16f5cd7e61d7a8b2e9432d /lib/packets.c
parent42d89d2a61a8c9e550a3a98cf7aaebce23f1b033 (diff)
packet: Add additional TCP flags extraction on IPv6.
Commit 11460e2316b88f0bd0ea0005d94338d800ea16bd (flow: Enable retrieval of TCP flags from IPv6 traffic.) updated one of the TCP flags extraction functions in userspace but missed the other. This updates that function and converts the other to use it to reduce duplication. Bug #10194 Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'lib/packets.c')
-rw-r--r--lib/packets.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/packets.c b/lib/packets.c
index 9d861dab..8fb7f6b0 100644
--- a/lib/packets.c
+++ b/lib/packets.c
@@ -487,9 +487,9 @@ 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)
{
- /* XXX IPv6? */
- if (flow->dl_type == htons(ETH_TYPE_IP) && packet->l4
- && flow->nw_proto == IPPROTO_TCP && packet->l7) {
+ if ((flow->dl_type == htons(ETH_TYPE_IP) ||
+ flow->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);
} else {