summaryrefslogtreecommitdiff
path: root/bgpd/bgp_attr.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-09-07 15:19:06 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-09-07 15:19:06 +0200
commitb4cb15c6670f649b62595793857f794fad41f884 (patch)
treeaef113cbeda13d760e1e7ce3e69df5836ce24339 /bgpd/bgp_attr.c
parent7c87afac92b94cd26c1a74df0e499a7a05603aa7 (diff)
bgpd: rip out bgp_attr_deep_dup(), fix table-map
bgp_attr_deep_dup is based on a misunderstanding of how route-maps work. They never change actual data, just pointers & fields in "struct attr". The correct thing to do is copy struct attr and call bgp_attr_flush() afterwards. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_attr.c')
-rw-r--r--bgpd/bgp_attr.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index d3f1294751..338fb6cd40 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -508,50 +508,6 @@ void bgp_attr_dup(struct attr *new, struct attr *orig)
*new = *orig;
}
-void bgp_attr_deep_dup(struct attr *new, struct attr *orig)
-{
- if (orig->aspath)
- new->aspath = aspath_dup(orig->aspath);
-
- if (orig->community)
- new->community = community_dup(orig->community);
-
- if (orig->ecommunity)
- new->ecommunity = ecommunity_dup(orig->ecommunity);
- if (orig->cluster)
- new->cluster = cluster_dup(orig->cluster);
- if (orig->transit)
- new->transit = transit_dup(orig->transit);
- if (orig->encap_subtlvs)
- new->encap_subtlvs = encap_tlv_dup(orig->encap_subtlvs);
-#if ENABLE_BGP_VNC
- if (orig->vnc_subtlvs)
- new->vnc_subtlvs = encap_tlv_dup(orig->vnc_subtlvs);
-#endif
-}
-
-void bgp_attr_deep_free(struct attr *attr)
-{
- if (attr->aspath)
- aspath_free(attr->aspath);
-
- if (attr->community)
- community_free(attr->community);
-
- if (attr->ecommunity)
- ecommunity_free(&attr->ecommunity);
- if (attr->cluster)
- cluster_free(attr->cluster);
- if (attr->transit)
- transit_free(attr->transit);
- if (attr->encap_subtlvs)
- encap_free(attr->encap_subtlvs);
-#if ENABLE_BGP_VNC
- if (attr->vnc_subtlvs)
- encap_free(attr->vnc_subtlvs);
-#endif
-}
-
unsigned long int attr_count(void)
{
return attrhash->count;