
jorge at dti2
Apr 10, 2012, 7:57 AM
Post #1 of 1
(99 views)
Permalink
|
|
[PATCH 6/6] bgpd: cleanup, use correct buffer sizes for sockunion2str()
|
|
From: "Jorge Boncompte [DTI2]" <jorge [at] dti2> Signed-off-by: Jorge Boncompte [DTI2] <jorge [at] dti2> --- bgpd/bgp_fsm.c | 4 ++-- bgpd/bgp_network.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 813e59e..d920045 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -597,8 +597,6 @@ bgp_stop_with_error (struct peer *peer) static int bgp_connect_success (struct peer *peer) { - char buf1[BUFSIZ]; - if (peer->fd < 0) { zlog_err ("bgp_connect_success peer's fd is negative value %d", @@ -612,6 +610,8 @@ bgp_connect_success (struct peer *peer) if (BGP_DEBUG (normal, NORMAL)) { + char buf1[SU_ADDRSTRLEN]; + if (! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) zlog_debug ("%s open active, local address %s", peer->host, sockunion2str (peer->su_local, buf1, SU_ADDRSTRLEN)); diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index a7dca53..73234fe 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -185,7 +185,7 @@ bgp_accept (struct thread *thread) zlog_debug ("[Event] Make dummy peer structure until read Open packet"); { - char buf[SU_ADDRSTRLEN + 1]; + char buf[SU_ADDRSTRLEN]; peer = peer_create_accept (peer1->bgp); SET_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER); -- 1.7.8.3 _______________________________________________ Quagga-dev mailing list Quagga-dev [at] lists http://lists.quagga.net/mailman/listinfo/quagga-dev
|