2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00

lib/flow: fix minimatch_extract() ICMPv6 parsing

This patch addresses two bugs related to ICMPv6(NDP) packets:

- In miniflow_extract() push the words in the correct order
- In parse_icmpv6() use sizeof struct, not size of struct *

match_wc_init() has been modified, to include the nd_target field
when the transport layer protocol is ICMPv6

A testcase has been added to detect the bugs.

Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
Jarno Rajahalme
2014-06-02 14:02:19 -07:00
parent 0ca30f6f9b
commit b0e2ec321f
3 changed files with 24 additions and 3 deletions

View File

@@ -136,6 +136,7 @@ match_wc_init(struct match *match, const struct flow *flow)
if (flow->nw_proto == IPPROTO_ICMPV6) {
memset(&wc->masks.arp_sha, 0xff, sizeof wc->masks.arp_sha);
memset(&wc->masks.arp_tha, 0xff, sizeof wc->masks.arp_tha);
memset(&wc->masks.nd_target, 0xff, sizeof wc->masks.nd_target);
}
}