diff options
author | Ben Pfaff <blp@ovn.org> | 2018-03-19 13:11:26 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-03-31 11:31:36 -0700 |
commit | 1f7270d737c7fc1b2cd49bc34048198f0201201b (patch) | |
tree | 741f123b426eb9c7b19296aebaaf35ccfedce4bf /lib/tun-metadata.c | |
parent | 3829cad68a7e68760046a4903d60c0a4ee9b65c2 (diff) | |
download | openvswitch-1f7270d737c7fc1b2cd49bc34048198f0201201b.tar.gz |
match: Add 'tun_md' member to struct minimatch.
struct match has had a 'tun_md' member for a long time, but struct
minimatch has never had one. This doesn't matter for the purposes for
which minimatch is currently used, but it means that a minimatch is not
completely substitutable for a match and therefore blocks some new uses.
This patch adds the member.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Reviewed-by: Armando Migliaccio <armamig@gmail.com>
Diffstat (limited to 'lib/tun-metadata.c')
-rw-r--r-- | lib/tun-metadata.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/tun-metadata.c b/lib/tun-metadata.c index c0d9180e0..f8a0e1952 100644 --- a/lib/tun-metadata.c +++ b/lib/tun-metadata.c @@ -924,3 +924,20 @@ tun_metadata_match_format(struct ds *s, const struct match *match) ds_put_char(s, ','); } } + +struct tun_metadata_allocation * +tun_metadata_allocation_clone(const struct tun_metadata_allocation *src) +{ + return src && src->valid ? xmemdup(src, sizeof *src) : NULL; +} + +void +tun_metadata_allocation_copy(struct tun_metadata_allocation *dst, + const struct tun_metadata_allocation *src) +{ + if (src && src->valid) { + *dst = *src; + } else { + memset(dst, 0, sizeof *dst); + } +} |