summaryrefslogtreecommitdiff
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r--bgpd/bgp_vty.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index bba1c7de..03746bdd 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -2943,7 +2943,6 @@ peer_update_source_vty (struct vty *vty, const char *peer_str,
const char *source_str)
{
struct peer *peer;
- union sockunion *su;
peer = peer_and_group_lookup_vty (vty, peer_str);
if (! peer)
@@ -2951,12 +2950,11 @@ peer_update_source_vty (struct vty *vty, const char *peer_str,
if (source_str)
{
- su = sockunion_str2su (source_str);
- if (su)
- {
- peer_update_source_addr_set (peer, su);
- sockunion_free (su);
- }
+ union sockunion su;
+ int ret = str2sockunion (source_str, &su);
+
+ if (ret == 0)
+ peer_update_source_addr_set (peer, &su);
else
peer_update_source_if_set (peer, source_str);
}