classifier: Fix segfault iterating with rules that differ only in priority.
authorBen Pfaff <blp@nicira.com>
Sat, 20 Nov 2010 00:41:02 +0000 (16:41 -0800)
committerBen Pfaff <blp@nicira.com>
Sat, 20 Nov 2010 00:41:02 +0000 (16:41 -0800)
commit955f579d42ff86c5cac4c3913b1cf42c27ebcc04
treed3bf597cccd5c8b4ea43864bc1856a9e98c5cf9f
parent44471ad36d13da6563a2244dcac863ac5e9e829b
classifier: Fix segfault iterating with rules that differ only in priority.

When CLS_CURSOR_FOR_EACH(_SAFE) iterated through a classifier, the
cls_cursor_next() function did not properly handle the case where there was
more than a single rule on a list.  This commit fixes the problem.

The addition to the testsuite would have found the problem earlier.

Reported-by: Teemu Koponen <koponen@nicira.com>
CC: Teemu Koponen <koponen@nicira.com>
lib/classifier.c
tests/test-classifier.c