return str;
}
+/* Find an 'intern'ed community structure */
+struct community *
+community_lookup (struct community *com)
+{
+ return (struct community *) hash_lookup (comhash, com);
+}
+
/* Intern communities attribute. */
struct community *
community_intern (struct community *com)
extern void community_del_val (struct community *, u_int32_t *);
extern unsigned long community_count (void);
extern struct hash *community_hash (void);
+extern struct community *community_lookup (struct community *);
#endif /* _QUAGGA_BGP_COMMUNITY_H */
new = community_dup (rcs->com);
/* will be interned by caller if required */
- attr->community = new;
+ attr->community = community_intern (new);
attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_COMMUNITIES);
}
{
struct rmap_com_set *rcs;
struct community *com = NULL;
+ struct community *comint;
char *sp;
int additive = 0;
int none = 0;
return NULL;
}
+ comint = community_intern (com);
rcs = XCALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (struct rmap_com_set));
- rcs->com = com;
+ rcs->com = comint;
rcs->additive = additive;
rcs->none = none;
}
else
{
- binfo->attr->community = new;
+ binfo->attr->community = community_intern (new);
binfo->attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_COMMUNITIES);
}
}