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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user