2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ofp-actions: Make ofpact_finish() harder to misuse.

It's pretty easy to forget to update the pointer to an ofpact when
finishing it.  This commit forces the caller to pass a pointer-to-pointer
instead, and uses that to automatically update the pointer.  There still
could be cases that retain other pointers into the ofpbuf, but I imagine
that this is harder to misuse.

Suggested-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
This commit is contained in:
Ben Pfaff
2016-04-12 22:00:25 -07:00
parent 6e3a764c9e
commit ce05810425
6 changed files with 42 additions and 22 deletions

View File

@@ -380,7 +380,7 @@ learn_parse__(char *orig, char *arg, struct ofpbuf *ofpacts)
}
}
}
ofpact_finish(ofpacts, &learn->ofpact);
ofpact_finish_LEARN(ofpacts, &learn);
return NULL;
}