diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-10-29 20:05:27 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-11-02 16:13:44 -0400 | 
| commit | 63265b5c1f9fb28946376b535a814bec1dbd19ed (patch) | |
| tree | e244c4ed35ac29185f6d77092f646f19fa704b65 /lib/prefix.h | |
| parent | 7a6fc8774ddf74df312c7d4ce0bbdbb5ac01c5fa (diff) | |
*: Convert prefix_free to double pointer
Have the prefix_free code take a double pointer to free the data.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/prefix.h')
| -rw-r--r-- | lib/prefix.h | 10 | 
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index 784927616a..7a93c766a3 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -396,7 +396,11 @@ extern unsigned int prefix6_bit(const struct in6_addr *prefix,  				const uint16_t prefixlen);  extern struct prefix *prefix_new(void); -extern void prefix_free(struct prefix *); +extern void prefix_free(struct prefix **p); +/* + * Function to handle prefix_free being used as a del function. + */ +extern void prefix_free_lists(void *arg);  extern const char *prefix_family_str(const struct prefix *);  extern int prefix_blen(const struct prefix *);  extern int str2prefix(const char *, struct prefix *); @@ -435,7 +439,7 @@ extern void prefix2sockunion(const struct prefix *, union sockunion *);  extern int str2prefix_eth(const char *, struct prefix_eth *);  extern struct prefix_ipv4 *prefix_ipv4_new(void); -extern void prefix_ipv4_free(struct prefix_ipv4 *); +extern void prefix_ipv4_free(struct prefix_ipv4 **p);  extern int str2prefix_ipv4(const char *, struct prefix_ipv4 *);  extern void apply_mask_ipv4(struct prefix_ipv4 *); @@ -460,7 +464,7 @@ extern in_addr_t ipv4_broadcast_addr(in_addr_t hostaddr, int masklen);  extern int netmask_str2prefix_str(const char *, const char *, char *);  extern struct prefix_ipv6 *prefix_ipv6_new(void); -extern void prefix_ipv6_free(struct prefix_ipv6 *); +extern void prefix_ipv6_free(struct prefix_ipv6 **p);  extern int str2prefix_ipv6(const char *, struct prefix_ipv6 *);  extern void apply_mask_ipv6(struct prefix_ipv6 *);  | 
