summaryrefslogtreecommitdiff
path: root/ldpd/init.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-03-01 15:31:28 -0300
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-09-23 09:31:09 -0400
commiteac6e3f027356c25a8c8fddf921f769b79945fcc (patch)
tree69d5a17fb3f95934bafa22f8a3aee28c92780d62 /ldpd/init.c
parente30090a678e45aee2755c492212c5a478b9dcfcc (diff)
ldpd: adapt the code for Quagga
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd/init.c')
-rw-r--r--ldpd/init.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ldpd/init.c b/ldpd/init.c
index eb22bf52ac..ed6b53c02d 100644
--- a/ldpd/init.c
+++ b/ldpd/init.c
@@ -16,13 +16,12 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
-#include <arpa/inet.h>
-#include <string.h>
+#include <zebra.h>
#include "ldpd.h"
#include "ldpe.h"
#include "log.h"
+#include "ldp_debug.h"
static int gen_init_prms_tlv(struct ibuf *, struct nbr *);
@@ -33,7 +32,7 @@ send_init(struct nbr *nbr)
uint16_t size;
int err = 0;
- log_debug("%s: lsr-id %s", __func__, inet_ntoa(nbr->id));
+ debug_msg_send("initialization: lsr-id %s", inet_ntoa(nbr->id));
size = LDP_HDR_SIZE + LDP_MSG_SIZE + SESS_PRMS_SIZE;
if ((buf = ibuf_open(size)) == NULL)
@@ -59,7 +58,7 @@ recv_init(struct nbr *nbr, char *buf, uint16_t len)
struct sess_prms_tlv sess;
uint16_t max_pdu_len;
- log_debug("%s: lsr-id %s", __func__, inet_ntoa(nbr->id));
+ debug_msg_recv("initialization: lsr-id %s", inet_ntoa(nbr->id));
memcpy(&msg, buf, sizeof(msg));
buf += LDP_MSG_SIZE;
@@ -82,7 +81,7 @@ recv_init(struct nbr *nbr, char *buf, uint16_t len)
session_shutdown(nbr, S_KEEPALIVE_BAD, msg.id, msg.type);
return (-1);
}
- if (sess.lsr_id != leconf->rtr_id.s_addr ||
+ if (sess.lsr_id != ldp_rtr_id_get(leconf) ||
ntohs(sess.lspace_id) != 0) {
session_shutdown(nbr, S_NO_HELLO, msg.id, msg.type);
return (-1);