summaryrefslogtreecommitdiff
path: root/bgpd/bgp_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_attr.c')
-rw-r--r--bgpd/bgp_attr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index b63ac4c8..2d82acc2 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -319,10 +319,14 @@ bgp_attr_extra_get (struct attr *attr)
void
bgp_attr_dup (struct attr *new, struct attr *orig)
{
+ struct attr_extra *extra = new->extra;
+
*new = *orig;
if (orig->extra)
{
- new->extra = bgp_attr_extra_new();
+ /* if caller provided attr_extra space use it */
+ if (! extra)
+ new->extra = bgp_attr_extra_new();
*new->extra = *orig->extra;
}
}