diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2013-06-04 02:34:49 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2013-06-04 02:34:49 +0000 |
commit | 58e79569174ae7812da7dbfc19b71709322a4c20 (patch) | |
tree | 5bdcc2b6d15a01c14a7f7bd4ab668c4358c524db /usr.sbin/ldpd/notification.c | |
parent | 15bd6634743ea4d81165efd81c60d5aa3711c0ac (diff) |
Always accept TCP connection requests and identify to which neighbor
it belongs only _after_ receiving an Initialization message containing
the information we need. Before an Initialization message is received,
the TCP connection shouldn't be associated with any neighbor/adjacency.
Therefor refactor that part into a own module.
From Renato Westphal
Diffstat (limited to 'usr.sbin/ldpd/notification.c')
-rw-r--r-- | usr.sbin/ldpd/notification.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.sbin/ldpd/notification.c b/usr.sbin/ldpd/notification.c index be57dd1acc4..f3e62868767 100644 --- a/usr.sbin/ldpd/notification.c +++ b/usr.sbin/ldpd/notification.c @@ -1,4 +1,4 @@ -/* $OpenBSD: notification.c,v 1.13 2013/06/04 01:32:16 claudio Exp $ */ +/* $OpenBSD: notification.c,v 1.14 2013/06/04 02:34:48 claudio Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -43,15 +43,13 @@ void send_notification_nbr(struct nbr *nbr, u_int32_t status, u_int32_t msgid, u_int32_t type) { - struct ibuf *buf; - - buf = send_notification(status, msgid, type); - evbuf_enqueue(&nbr->wbuf, buf); + send_notification(status, nbr->tcp, msgid, type); nbr_fsm(nbr, NBR_EVT_PDU_SENT); } -struct ibuf * -send_notification(u_int32_t status, u_int32_t msgid, u_int32_t type) +void +send_notification(u_int32_t status, struct tcp_conn *tcp, u_int32_t msgid, + u_int32_t type) { struct ibuf *buf; u_int16_t size; @@ -71,7 +69,7 @@ send_notification(u_int32_t status, u_int32_t msgid, u_int32_t type) gen_status_tlv(buf, status, msgid, type); - return (buf); + evbuf_enqueue(&tcp->wbuf, buf); } int |