-/* $OpenBSD: database.c,v 1.20 2020/07/15 14:47:41 denis Exp $ */
+/* $OpenBSD: database.c,v 1.21 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
case NBR_STA_INIT:
case NBR_STA_2_WAY:
case NBR_STA_SNAP:
- log_debug("send_db_description: neighbor ID %s: "
+ log_debug("send_db_description: neighbor ID %s (%s): "
"cannot send packet in state %s", inet_ntoa(nbr->id),
- nbr_state_name(nbr->state));
+ nbr->iface->name, nbr_state_name(nbr->state));
goto fail;
case NBR_STA_XSTRT:
bits |= OSPF_DBD_MS | OSPF_DBD_M | OSPF_DBD_I;
int dupe = 0;
if (len < sizeof(dd_hdr)) {
- log_warnx("recv_db_description: neighbor ID %s: "
- "bad packet size", inet_ntoa(nbr->id));
+ log_warnx("recv_db_description: neighbor ID %s (%s): "
+ "bad packet size", inet_ntoa(nbr->id), nbr->iface->name);
return;
}
memcpy(&dd_hdr, buf, sizeof(dd_hdr));
/* db description packet sanity checks */
if (ntohs(dd_hdr.iface_mtu) > nbr->iface->mtu) {
- log_warnx("recv_db_description: neighbor ID %s: "
+ log_warnx("recv_db_description: neighbor ID %s (%s): "
"invalid MTU %d expected %d", inet_ntoa(nbr->id),
- ntohs(dd_hdr.iface_mtu), nbr->iface->mtu);
+ nbr->iface->name, ntohs(dd_hdr.iface_mtu),
+ nbr->iface->mtu);
return;
}
nbr->last_rx_bits == dd_hdr.bits &&
ntohl(dd_hdr.dd_seq_num) == nbr->dd_seq_num - nbr->dd_master ?
1 : 0) {
- log_debug("recv_db_description: dupe from neighbor ID %s",
- inet_ntoa(nbr->id));
+ log_debug("recv_db_description: dupe from "
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
dupe = 1;
}
case NBR_STA_ATTEMPT:
case NBR_STA_2_WAY:
case NBR_STA_SNAP:
- log_debug("recv_db_description: neighbor ID %s: "
+ log_debug("recv_db_description: neighbor ID %s (%s): "
"packet ignored in state %s", inet_ntoa(nbr->id),
- nbr_state_name(nbr->state));
+ nbr->iface->name, nbr_state_name(nbr->state));
return;
case NBR_STA_INIT:
/* evaluate dr and bdr after issuing a 2-Way event */
/* M only case: we are master */
if (ntohl(dd_hdr.dd_seq_num) != nbr->dd_seq_num) {
log_warnx("recv_db_description: "
- "neighbor ID %s: "
+ "neighbor ID %s (%s): "
"invalid seq num, mine %x his %x",
- inet_ntoa(nbr->id), nbr->dd_seq_num,
- ntohl(dd_hdr.dd_seq_num));
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr->dd_seq_num, ntohl(dd_hdr.dd_seq_num));
return;
}
nbr->dd_seq_num++;
}
} else {
/* ignore packet */
- log_debug("recv_db_description: neighbor ID %s: "
+ log_debug("recv_db_description: neighbor ID %s (%s): "
"packet ignored in state %s (bad flags)",
- inet_ntoa(nbr->id), nbr_state_name(nbr->state));
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr_state_name(nbr->state));
}
break;
case NBR_STA_XCHNG:
case NBR_STA_FULL:
if (dd_hdr.bits & OSPF_DBD_I ||
!(dd_hdr.bits & OSPF_DBD_MS) == !nbr->dd_master) {
- log_warnx("recv_db_description: neighbor ID %s: "
- "seq num mismatch, bad flags", inet_ntoa(nbr->id));
+ log_warnx("recv_db_description: neighbor ID %s (%s): "
+ "seq num mismatch, bad flags", inet_ntoa(nbr->id),
+ nbr->iface->name);
nbr_fsm(nbr, NBR_EVT_SEQ_NUM_MIS);
return;
}
if (nbr->last_rx_options != dd_hdr.opts) {
- log_warnx("recv_db_description: neighbor ID %s: "
+ log_warnx("recv_db_description: neighbor ID %s (%s): "
"seq num mismatch, bad options",
- inet_ntoa(nbr->id));
+ inet_ntoa(nbr->id), nbr->iface->name);
nbr_fsm(nbr, NBR_EVT_SEQ_NUM_MIS);
return;
}
}
if (nbr->state != NBR_STA_XCHNG) {
- log_warnx("recv_db_description: neighbor ID %s: "
+ log_warnx("recv_db_description: neighbor ID %s (%s): "
"invalid seq num, mine %x his %x",
- inet_ntoa(nbr->id), nbr->dd_seq_num,
- ntohl(dd_hdr.dd_seq_num));
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr->dd_seq_num, ntohl(dd_hdr.dd_seq_num));
nbr_fsm(nbr, NBR_EVT_SEQ_NUM_MIS);
return;
}
/* master */
if (ntohl(dd_hdr.dd_seq_num) != nbr->dd_seq_num) {
log_warnx("recv_db_description: "
- "neighbor ID %s: "
+ "neighbor ID %s (%s): "
"invalid seq num, mine %x his %x, master",
- inet_ntoa(nbr->id), nbr->dd_seq_num,
- ntohl(dd_hdr.dd_seq_num));
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr->dd_seq_num, ntohl(dd_hdr.dd_seq_num));
nbr_fsm(nbr, NBR_EVT_SEQ_NUM_MIS);
return;
}
/* slave */
if (ntohl(dd_hdr.dd_seq_num) != nbr->dd_seq_num + 1) {
log_warnx("recv_db_description: "
- "neighbor ID %s: "
+ "neighbor ID %s (%s): "
"invalid seq num, mine %x his %x, slave",
- inet_ntoa(nbr->id), nbr->dd_seq_num,
- ntohl(dd_hdr.dd_seq_num));
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr->dd_seq_num, ntohl(dd_hdr.dd_seq_num));
nbr_fsm(nbr, NBR_EVT_SEQ_NUM_MIS);
return;
}
send_db_description(nbr);
break;
default:
- log_debug("db_tx_timer: neighbor ID %s: unknown neighbor state",
- inet_ntoa(nbr->id));
+ log_debug("db_tx_timer: neighbor ID %s (%s): "
+ "unknown neighbor state",
+ inet_ntoa(nbr->id), nbr->iface->name);
break;
}
-/* $OpenBSD: kroute.c,v 1.65 2020/09/10 05:18:16 jmatthew Exp $ */
+/* $OpenBSD: kroute.c,v 1.66 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
/*
* We don't have an interface address in that network,
* so we install a cloning route. The kernel will then
- * do neigbor discovery.
+ * do neighbor discovery.
*/
bzero(&ifp, sizeof(ifp));
ifp.addr.sdl_len = sizeof(struct sockaddr_dl);
-/* $OpenBSD: lsack.c,v 1.8 2019/12/28 09:25:24 denis Exp $ */
+/* $OpenBSD: lsack.c,v 1.9 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2004, 2005, 2007 Esben Norby <norby@openbsd.org>
case NBR_STA_XSTRT:
case NBR_STA_SNAP:
log_debug("recv_ls_ack: packet ignored in state %s, "
- "neighbor ID %s", nbr_state_name(nbr->state),
- inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", nbr_state_name(nbr->state),
+ inet_ntoa(nbr->id), nbr->iface->name);
break;
case NBR_STA_XCHNG:
case NBR_STA_LOAD:
}
if (len > 0) {
log_warnx("recv_ls_ack: bad packet size, "
- "neighbor ID %s", inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return;
}
break;
{
/* invalid age */
if ((ntohs(lsa_hdr->age) < 1) || (ntohs(lsa_hdr->age) > MAX_AGE)) {
- log_debug("lsa_hdr_check: invalid age, neighbor ID %s",
- inet_ntoa(nbr->id));
+ log_debug("lsa_hdr_check: invalid age, neighbor ID %s (%s)",
+ inet_ntoa(nbr->id), nbr->iface->name);
return (0);
}
case LSA_TYPE_EXTERNAL:
break;
default:
- log_debug("lsa_hdr_check: invalid LSA type %d, neighbor ID %s",
- lsa_hdr->type, inet_ntoa(nbr->id));
+ log_debug("lsa_hdr_check: invalid LSA type %d, "
+ "neighbor ID %s (%s)",
+ lsa_hdr->type, inet_ntoa(nbr->id), nbr->iface->name);
return (0);
}
/* invalid sequence number */
if (ntohl(lsa_hdr->seq_num) == RESV_SEQ_NUM) {
- log_debug("ls_hdr_check: invalid seq num, neighbor ID %s",
- inet_ntoa(nbr->id));
+ log_debug("ls_hdr_check: invalid seq num, "
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return (0);
}
-/* $OpenBSD: lsreq.c,v 1.12 2021/01/19 09:53:11 claudio Exp $ */
+/* $OpenBSD: lsreq.c,v 1.13 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2004, 2005, 2007 Esben Norby <norby@openbsd.org>
case NBR_STA_XSTRT:
case NBR_STA_SNAP:
log_debug("recv_ls_req: packet ignored in state %s, "
- "neighbor ID %s", nbr_state_name(nbr->state),
- inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", nbr_state_name(nbr->state),
+ inet_ntoa(nbr->id), nbr->iface->name);
break;
case NBR_STA_XCHNG:
case NBR_STA_LOAD:
return;
default:
log_debug("ls_req_tx_timer: unknown neighbor state, "
- "neighbor ID %s", inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
break;
}
-/* $OpenBSD: lsupdate.c,v 1.20 2021/01/19 09:53:11 claudio Exp $ */
+/* $OpenBSD: lsupdate.c,v 1.21 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
u_int32_t nlsa;
if (len < sizeof(nlsa)) {
- log_warnx("recv_ls_update: bad packet size, neighbor ID %s",
- inet_ntoa(nbr->id));
+ log_warnx("recv_ls_update: bad packet size, "
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return;
}
memcpy(&nlsa, buf, sizeof(nlsa));
case NBR_STA_XSTRT:
case NBR_STA_SNAP:
log_debug("recv_ls_update: packet ignored in state %s, "
- "neighbor ID %s", nbr_state_name(nbr->state),
- inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", nbr_state_name(nbr->state),
+ inet_ntoa(nbr->id), nbr->iface->name);
break;
case NBR_STA_XCHNG:
case NBR_STA_LOAD:
for (; nlsa > 0 && len > 0; nlsa--) {
if (len < sizeof(lsa)) {
log_warnx("recv_ls_update: bad packet size, "
- "neighbor ID %s", inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return;
}
memcpy(&lsa, buf, sizeof(lsa));
if (len < ntohs(lsa.len)) {
log_warnx("recv_ls_update: bad packet size, "
- "neighbor ID %s", inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return;
}
ospfe_imsg_compose_rde(IMSG_LS_UPD, nbr->peerid, 0,
}
if (nlsa > 0 || len > 0) {
log_warnx("recv_ls_update: bad packet size, "
- "neighbor ID %s", inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return;
}
break;
if (nlsa == 0) {
/* something bad happened retry later */
log_warnx("ls_retrans_timer: sending LS update "
- "to neighbor ID %s failed",
- inet_ntoa(nbr->id));
+ "to neighbor ID %s (%s) failed",
+ inet_ntoa(nbr->id), nbr->iface->name);
log_debug("ls_retrans_timer: type: %04x len: %u",
ntohs(le->le_ref->hdr.type),
le->le_ref->len);
-/* $OpenBSD: neighbor.c,v 1.17 2020/06/22 18:18:20 denis Exp $ */
+/* $OpenBSD: neighbor.c,v 1.18 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
if (nbr_fsm_tbl[i].state == -1) {
/* event outside of the defined fsm, ignore it. */
- log_warnx("nbr_fsm: neighbor ID %s, "
+ log_warnx("nbr_fsm: neighbor ID %s (%s), "
"event %s not expected in state %s",
- inet_ntoa(nbr->id), nbr_event_names[event],
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr_event_names[event],
nbr_state_name(old_state));
return (0);
}
}
if (ret) {
- log_warnx("nbr_fsm: error changing state for neighbor ID %s, "
- "event %s, state %s", inet_ntoa(nbr->id),
+ log_warnx("nbr_fsm: error changing state for neighbor "
+ "ID %s (%s), event %s, state %s",
+ inet_ntoa(nbr->id), nbr->iface->name,
nbr_event_names[event], nbr_state_name(old_state));
return (-1);
}
if_fsm(nbr->iface, IF_EVT_NBR_CHNG);
log_debug("nbr_fsm: event %s resulted in action %s and "
- "changing state for neighbor ID %s from %s to %s",
+ "changing state for neighbor ID %s (%s) from %s to %s",
nbr_event_names[event],
nbr_action_names[nbr_fsm_tbl[i].action],
- inet_ntoa(nbr->id), nbr_state_name(old_state),
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr_state_name(old_state),
nbr_state_name(nbr->state));
if (nbr->iface->type == IF_TYPE_VIRTUALLINK) {
return;
if (nbr->state & NBR_STA_ACTIVE && nbr->state != NBR_STA_FULL) {
- log_warnx("nbr_adj_timer: failed to form adjacency with %s",
- inet_ntoa(nbr->id));
+ log_warnx("nbr_adj_timer: failed to form adjacency with "
+ "neighbor ID %s on interface %s",
+ inet_ntoa(nbr->id), nbr->iface->name);
nbr_fsm(nbr, NBR_EVT_ADJTMOUT);
}
}
/* we need to wait for the old snapshot to finish */
if (nbr->dd_snapshot) {
log_debug("nbr_act_snapshot: giving up, old snapshot running "
- "for neigbor ID %s", inet_ntoa(nbr->id));
+ "for neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return (nbr_act_restart_dd(nbr));
}
ospfe_imsg_compose_rde(IMSG_DB_SNAPSHOT, nbr->peerid, 0, NULL, 0);
tv.tv_sec = DEFAULT_NBR_TMOUT;
if (evtimer_add(&nbr->inactivity_timer, &tv)) {
- log_warnx("nbr_act_delete: error scheduling neighbor ID %s "
- "for removal", inet_ntoa(nbr->id));
+ log_warnx("nbr_act_delete: error scheduling "
+ "neighbor ID %s (%s) for removal",
+ inet_ntoa(nbr->id), nbr->iface->name);
}
return (nbr_act_clear_lists(nbr));
int
nbr_act_hello_check(struct nbr *nbr)
{
- log_debug("nbr_act_hello_check: neighbor ID %s", inet_ntoa(nbr->id));
+ log_debug("nbr_act_hello_check: neighbor ID %s (%s)",
+ inet_ntoa(nbr->id), nbr->iface->name);
return (-1);
}
-/* $OpenBSD: database.c,v 1.34 2019/07/15 18:26:39 remi Exp $ */
+/* $OpenBSD: database.c,v 1.35 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
case NBR_STA_INIT:
case NBR_STA_2_WAY:
case NBR_STA_SNAP:
- log_debug("send_db_description: neighbor ID %s: "
+ log_debug("send_db_description: neighbor ID %s (%s): "
"cannot send packet in state %s", inet_ntoa(nbr->id),
- nbr_state_name(nbr->state));
+ nbr->iface->name, nbr_state_name(nbr->state));
goto fail;
case NBR_STA_XSTRT:
bits |= OSPF_DBD_MS | OSPF_DBD_M | OSPF_DBD_I;
int dupe = 0;
if (len < sizeof(dd_hdr)) {
- log_warnx("recv_db_description: neighbor ID %s: "
- "bad packet size", inet_ntoa(nbr->id));
+ log_warnx("recv_db_description: neighbor ID %s (%s): "
+ "bad packet size", inet_ntoa(nbr->id), nbr->iface->name);
return;
}
memcpy(&dd_hdr, buf, sizeof(dd_hdr));
/* db description packet sanity checks */
if (ntohs(dd_hdr.iface_mtu) > nbr->iface->mtu) {
- log_warnx("recv_db_description: neighbor ID %s: "
+ log_warnx("recv_db_description: neighbor ID %s (%s): "
"invalid MTU %d expected %d", inet_ntoa(nbr->id),
- ntohs(dd_hdr.iface_mtu), nbr->iface->mtu);
+ nbr->iface->name, ntohs(dd_hdr.iface_mtu),
+ nbr->iface->mtu);
return;
}
nbr->last_rx_bits == dd_hdr.bits &&
ntohl(dd_hdr.dd_seq_num) == nbr->dd_seq_num - nbr->dd_master ?
1 : 0) {
- log_debug("recv_db_description: dupe from neighbor ID %s",
- inet_ntoa(nbr->id));
+ log_debug("recv_db_description: dupe from "
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
dupe = 1;
}
case NBR_STA_ATTEMPT:
case NBR_STA_2_WAY:
case NBR_STA_SNAP:
- log_debug("recv_db_description: neighbor ID %s: "
+ log_debug("recv_db_description: neighbor ID %s (%s): "
"packet ignored in state %s", inet_ntoa(nbr->id),
- nbr_state_name(nbr->state));
+ nbr->iface->name, nbr_state_name(nbr->state));
return;
case NBR_STA_INIT:
/* evaluate dr and bdr after issuing a 2-Way event */
return;
nbr->capa_options = dd_hdr.opts;
if ((nbr->capa_options & nbr->options) != nbr->options) {
- log_warnx("recv_db_description: neighbor ID %s "
+ log_warnx("recv_db_description: neighbor ID %s (%s) "
"sent inconsistent options %x vs. %x",
- inet_ntoa(nbr->id), nbr->capa_options,
- nbr->options);
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr->capa_options, nbr->options);
}
/*
* check bits: either I,M,MS or only M
/* M only case: we are master */
if (ntohl(dd_hdr.dd_seq_num) != nbr->dd_seq_num) {
log_warnx("recv_db_description: "
- "neighbor ID %s: "
+ "neighbor ID %s (%s): "
"invalid seq num, mine %x his %x",
- inet_ntoa(nbr->id), nbr->dd_seq_num,
- ntohl(dd_hdr.dd_seq_num));
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr->dd_seq_num, ntohl(dd_hdr.dd_seq_num));
return;
}
nbr->dd_seq_num++;
}
} else {
/* ignore packet */
- log_debug("recv_db_description: neighbor ID %s: "
+ log_debug("recv_db_description: neighbor ID %s (%s): "
"packet ignored in state %s (bad flags)",
- inet_ntoa(nbr->id), nbr_state_name(nbr->state));
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr_state_name(nbr->state));
}
break;
case NBR_STA_XCHNG:
case NBR_STA_FULL:
if (dd_hdr.bits & OSPF_DBD_I ||
!(dd_hdr.bits & OSPF_DBD_MS) == !nbr->dd_master) {
- log_warnx("recv_db_description: neighbor ID %s: "
- "seq num mismatch, bad flags", inet_ntoa(nbr->id));
+ log_warnx("recv_db_description: neighbor ID %s (%s): "
+ "seq num mismatch, bad flags", inet_ntoa(nbr->id),
+ nbr->iface->name);
nbr_fsm(nbr, NBR_EVT_SEQ_NUM_MIS);
return;
}
if (nbr->last_rx_options != dd_hdr.opts) {
- log_warnx("recv_db_description: neighbor ID %s: "
+ log_warnx("recv_db_description: neighbor ID %s (%s): "
"seq num mismatch, bad options",
- inet_ntoa(nbr->id));
+ inet_ntoa(nbr->id), nbr->iface->name);
nbr_fsm(nbr, NBR_EVT_SEQ_NUM_MIS);
return;
}
}
if (nbr->state != NBR_STA_XCHNG) {
- log_warnx("recv_db_description: neighbor ID %s: "
+ log_warnx("recv_db_description: neighbor ID %s (%s): "
"invalid seq num, mine %x his %x",
- inet_ntoa(nbr->id), nbr->dd_seq_num,
- ntohl(dd_hdr.dd_seq_num));
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr->dd_seq_num, ntohl(dd_hdr.dd_seq_num));
nbr_fsm(nbr, NBR_EVT_SEQ_NUM_MIS);
return;
}
/* master */
if (ntohl(dd_hdr.dd_seq_num) != nbr->dd_seq_num) {
log_warnx("recv_db_description: "
- "neighbor ID %s: "
+ "neighbor ID %s (%s): "
"invalid seq num, mine %x his %x, master",
- inet_ntoa(nbr->id), nbr->dd_seq_num,
- ntohl(dd_hdr.dd_seq_num));
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr->dd_seq_num, ntohl(dd_hdr.dd_seq_num));
nbr_fsm(nbr, NBR_EVT_SEQ_NUM_MIS);
return;
}
/* slave */
if (ntohl(dd_hdr.dd_seq_num) != nbr->dd_seq_num + 1) {
log_warnx("recv_db_description: "
- "neighbor ID %s: "
+ "neighbor ID %s (%s): "
"invalid seq num, mine %x his %x, slave",
- inet_ntoa(nbr->id), nbr->dd_seq_num,
- ntohl(dd_hdr.dd_seq_num));
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr->dd_seq_num, ntohl(dd_hdr.dd_seq_num));
nbr_fsm(nbr, NBR_EVT_SEQ_NUM_MIS);
return;
}
send_db_description(nbr);
break;
default:
- log_debug("db_tx_timer: neighbor ID %s: unknown neighbor state",
- inet_ntoa(nbr->id));
+ log_debug("db_tx_timer: neighbor ID %s (%s): "
+ "unknown neighbor state",
+ inet_ntoa(nbr->id), nbr->iface->name);
break;
}
-/* $OpenBSD: lsack.c,v 1.22 2019/07/15 18:26:39 remi Exp $ */
+/* $OpenBSD: lsack.c,v 1.23 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
case NBR_STA_XSTRT:
case NBR_STA_SNAP:
log_debug("recv_ls_ack: packet ignored in state %s, "
- "neighbor ID %s", nbr_state_name(nbr->state),
- inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", nbr_state_name(nbr->state),
+ inet_ntoa(nbr->id), nbr->iface->name);
break;
case NBR_STA_XCHNG:
case NBR_STA_LOAD:
}
if (len > 0) {
log_warnx("recv_ls_ack: bad packet size, "
- "neighbor ID %s", inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return;
}
break;
{
/* invalid age */
if ((ntohs(lsa_hdr->age) < 1) || (ntohs(lsa_hdr->age) > MAX_AGE)) {
- log_debug("lsa_hdr_check: invalid age, neighbor ID %s",
- inet_ntoa(nbr->id));
+ log_debug("lsa_hdr_check: invalid age, neighbor ID %s (%s)",
+ inet_ntoa(nbr->id), nbr->iface->name);
return (0);
}
case LSA_TYPE_EXTERNAL:
break;
default:
- log_debug("lsa_hdr_check: invalid LSA type %d, neighbor ID %s",
- lsa_hdr->type, inet_ntoa(nbr->id));
+ log_debug("lsa_hdr_check: invalid LSA type %d, "
+ "neighbor ID %s (%s)",
+ lsa_hdr->type, inet_ntoa(nbr->id), nbr->iface->name);
return (0);
}
/* invalid sequence number */
if (ntohl(lsa_hdr->seq_num) == RESV_SEQ_NUM) {
- log_debug("ls_hdr_check: invalid seq num, neighbor ID %s",
- inet_ntoa(nbr->id));
+ log_debug("ls_hdr_check: invalid seq num, "
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return (0);
}
-/* $OpenBSD: lsreq.c,v 1.22 2021/01/19 09:25:53 claudio Exp $ */
+/* $OpenBSD: lsreq.c,v 1.23 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
case NBR_STA_XSTRT:
case NBR_STA_SNAP:
log_debug("recv_ls_req: packet ignored in state %s, "
- "neighbor ID %s", nbr_state_name(nbr->state),
- inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", nbr_state_name(nbr->state),
+ inet_ntoa(nbr->id), nbr->iface->name);
break;
case NBR_STA_XCHNG:
case NBR_STA_LOAD:
return;
default:
log_debug("ls_req_tx_timer: unknown neighbor state, "
- "neighbor ID %s", inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
break;
}
-/* $OpenBSD: lsupdate.c,v 1.49 2021/01/19 09:25:53 claudio Exp $ */
+/* $OpenBSD: lsupdate.c,v 1.50 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
u_int32_t nlsa;
if (len < sizeof(nlsa)) {
- log_warnx("recv_ls_update: bad packet size, neighbor ID %s",
- inet_ntoa(nbr->id));
+ log_warnx("recv_ls_update: bad packet size, "
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return;
}
memcpy(&nlsa, buf, sizeof(nlsa));
case NBR_STA_XSTRT:
case NBR_STA_SNAP:
log_debug("recv_ls_update: packet ignored in state %s, "
- "neighbor ID %s", nbr_state_name(nbr->state),
- inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", nbr_state_name(nbr->state),
+ inet_ntoa(nbr->id), nbr->iface->name);
break;
case NBR_STA_XCHNG:
case NBR_STA_LOAD:
for (; nlsa > 0 && len > 0; nlsa--) {
if (len < sizeof(lsa)) {
log_warnx("recv_ls_update: bad packet size, "
- "neighbor ID %s", inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return;
}
memcpy(&lsa, buf, sizeof(lsa));
if (len < ntohs(lsa.len)) {
log_warnx("recv_ls_update: bad packet size, "
- "neighbor ID %s", inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return;
}
ospfe_imsg_compose_rde(IMSG_LS_UPD, nbr->peerid, 0,
}
if (nlsa > 0 || len > 0) {
log_warnx("recv_ls_update: bad packet size, "
- "neighbor ID %s", inet_ntoa(nbr->id));
+ "neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return;
}
break;
if (nlsa == 0) {
/* something bad happened retry later */
log_warnx("ls_retrans_timer: sending LS update "
- "to neighbor ID %s failed",
- inet_ntoa(nbr->id));
+ "to neighbor ID %s (%s) failed",
+ inet_ntoa(nbr->id), nbr->iface->name);
TAILQ_REMOVE(&nbr->ls_retrans_list, le, entry);
nbr->ls_ret_cnt--;
le->le_when = nbr->iface->rxmt_interval;
-/* $OpenBSD: neighbor.c,v 1.49 2019/11/19 09:55:55 remi Exp $ */
+/* $OpenBSD: neighbor.c,v 1.50 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
if (nbr_fsm_tbl[i].state == -1) {
/* event outside of the defined fsm, ignore it. */
- log_warnx("nbr_fsm: neighbor ID %s, "
+ log_warnx("nbr_fsm: neighbor ID %s (%s), "
"event %s not expected in state %s",
- inet_ntoa(nbr->id), nbr_event_names[event],
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr_event_names[event],
nbr_state_name(old_state));
return (0);
}
}
if (ret) {
- log_warnx("nbr_fsm: error changing state for neighbor ID %s, "
- "event %s, state %s", inet_ntoa(nbr->id),
+ log_warnx("nbr_fsm: error changing state for neighbor "
+ "ID %s (%s), event %s, state %s",
+ inet_ntoa(nbr->id), nbr->iface->name,
nbr_event_names[event], nbr_state_name(old_state));
return (-1);
}
if_fsm(nbr->iface, IF_EVT_NBR_CHNG);
log_debug("nbr_fsm: event %s resulted in action %s and "
- "changing state for neighbor ID %s from %s to %s",
+ "changing state for neighbor ID %s (%s) from %s to %s",
nbr_event_names[event],
nbr_action_names[nbr_fsm_tbl[i].action],
- inet_ntoa(nbr->id), nbr_state_name(old_state),
+ inet_ntoa(nbr->id), nbr->iface->name,
+ nbr_state_name(old_state),
nbr_state_name(nbr->state));
if (nbr->iface->type == IF_TYPE_VIRTUALLINK) {
/* we need to wait for the old snapshot to finish */
if (nbr->dd_snapshot) {
log_debug("nbr_act_snapshot: giving up, old snapshot running "
- "for neigbor ID %s", inet_ntoa(nbr->id));
+ "for neighbor ID %s (%s)", inet_ntoa(nbr->id),
+ nbr->iface->name);
return (nbr_act_restart_dd(nbr));
}
ospfe_imsg_compose_rde(IMSG_NEIGHBOR_CAPA, nbr->peerid, 0,
tv.tv_sec = DEFAULT_NBR_TMOUT;
if (evtimer_add(&nbr->inactivity_timer, &tv)) {
- log_warnx("nbr_act_delete: error scheduling neighbor ID %s "
- "for removal", inet_ntoa(nbr->id));
+ log_warnx("nbr_act_delete: error scheduling "
+ "neighbor ID %s (%s) for removal",
+ inet_ntoa(nbr->id), nbr->iface->name);
}
return (nbr_act_clear_lists(nbr));
int
nbr_act_hello_check(struct nbr *nbr)
{
- log_debug("nbr_act_hello_check: neighbor ID %s", inet_ntoa(nbr->id));
+ log_debug("nbr_act_hello_check: neighbor ID %s (%s)",
+ inet_ntoa(nbr->id), nbr->iface->name);
return (-1);
}
-/* $OpenBSD: packet.c,v 1.35 2021/01/19 16:01:39 claudio Exp $ */
+/* $OpenBSD: packet.c,v 1.36 2021/11/03 21:40:03 sthen Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
}
if (auth_validate(buf, len, iface, nbr)) {
- log_warnx("recv_packet: authentication error, "
- "interface %s", iface->name);
+ if (nbr == NULL)
+ log_warnx("recv_packet: authentication error, "
+ "interface %s", iface->name);
+ else
+ log_warnx("recv_packet: authentication error, "
+ "neighbor ID %s interface %s",
+ inet_ntoa(nbr->id), iface->name);
return;
}