summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-11-01 10:37:50 +0100
committerRenato Westphal <renato@opensourcerouting.org>2016-11-28 19:15:27 +0100
commit658bbf6d704a776495dd7914c45efc399f03da52 (patch)
treeb34b9cb30507481bca40539ff1491eb0e274d4d7 /bgpd
parentbgpd: use loops to reduce code duplication (diff)
downloadfrr-658bbf6d704a776495dd7914c45efc399f03da52.tar.xz
frr-658bbf6d704a776495dd7914c45efc399f03da52.zip
bgpd: optimize copy of strings on peer_xfer_conn()
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_fsm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index ab4ea71d6..e669b4f9b 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -171,8 +171,7 @@ peer_xfer_conn(struct peer *from_peer)
peer->hostname = NULL;
}
- peer->hostname = XSTRDUP(MTYPE_BGP_PEER_HOST, from_peer->hostname);
- XFREE(MTYPE_BGP_PEER_HOST, from_peer->hostname);
+ peer->hostname = from_peer->hostname;
from_peer->hostname = NULL;
}
@@ -184,8 +183,7 @@ peer_xfer_conn(struct peer *from_peer)
peer->domainname= NULL;
}
- peer->domainname = XSTRDUP(MTYPE_BGP_PEER_HOST, from_peer->domainname);
- XFREE(MTYPE_BGP_PEER_HOST, from_peer->domainname);
+ peer->domainname = from_peer->domainname;
from_peer->domainname = NULL;
}