summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldpd/labelmapping.c
diff options
context:
space:
mode:
authorrenato <renato@openbsd.org>2017-03-03 23:44:35 +0000
committerrenato <renato@openbsd.org>2017-03-03 23:44:35 +0000
commit0101edf8fbb30ed8f51ae3e0dff849621ef2ac7e (patch)
treee94c2bcf33473bd0d7357be5f2720d48368b4b55 /usr.sbin/ldpd/labelmapping.c
parentMinor tweaks. (diff)
downloadwireguard-openbsd-0101edf8fbb30ed8f51ae3e0dff849621ef2ac7e.tar.xz
wireguard-openbsd-0101edf8fbb30ed8f51ae3e0dff849621ef2ac7e.zip
Kill send_notification_nbr().
Be more clever and trigger the PDU SENT event inside send_notification() when tcp->nbr is set. This way we can eliminate send_notification_nbr() and always use send_notification() instead.
Diffstat (limited to 'usr.sbin/ldpd/labelmapping.c')
-rw-r--r--usr.sbin/ldpd/labelmapping.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c
index 9917d9ea28f..61a6a8ae75f 100644
--- a/usr.sbin/ldpd/labelmapping.c
+++ b/usr.sbin/ldpd/labelmapping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: labelmapping.c,v 1.62 2017/03/03 23:41:27 renato Exp $ */
+/* $OpenBSD: labelmapping.c,v 1.63 2017/03/03 23:44:35 renato Exp $ */
/*
* Copyright (c) 2014, 2015 Renato Westphal <renato@openbsd.org>
@@ -166,7 +166,7 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type)
memcpy(&ft, buf, sizeof(ft));
if (ntohs(ft.type) != TLV_TYPE_FEC) {
- send_notification_nbr(nbr, S_MISS_MSG, msg.id, msg.type);
+ send_notification(nbr->tcp, S_MISS_MSG, msg.id, msg.type);
return (-1);
}
feclen = ntohs(ft.length);
@@ -190,7 +190,7 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type)
!(map.flags & F_MAP_PW_ID) &&
type != MSG_TYPE_LABELWITHDRAW &&
type != MSG_TYPE_LABELRELEASE) {
- send_notification_nbr(nbr, S_MISS_MSG, msg.id,
+ send_notification(nbr->tcp, S_MISS_MSG, msg.id,
msg.type);
return (-1);
}
@@ -344,7 +344,7 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type)
break;
default:
if (!(ntohs(tlv.type) & UNKNOWN_FLAG))
- send_notification_nbr(nbr, S_UNKNOWN_TLV,
+ send_notification(nbr->tcp, S_UNKNOWN_TLV,
msg.id, msg.type);
/* ignore unknown tlv */
break;
@@ -465,7 +465,7 @@ tlv_decode_label(struct nbr *nbr, struct ldp_msg *msg, char *buf,
memcpy(&lt, buf, sizeof(lt));
if (!(ntohs(lt.type) & TLV_TYPE_GENERICLABEL)) {
- send_notification_nbr(nbr, S_MISS_MSG, msg->id, msg->type);
+ send_notification(nbr->tcp, S_MISS_MSG, msg->id, msg->type);
return (-1);
}
@@ -645,7 +645,7 @@ tlv_decode_fec_elm(struct nbr *nbr, struct ldp_msg *msg, char *buf,
map->fec.prefix.af = AF_INET6;
break;
default:
- send_notification_nbr(nbr, S_UNSUP_ADDR, msg->id,
+ send_notification(nbr->tcp, S_UNSUP_ADDR, msg->id,
msg->type);
return (-1);
}
@@ -756,7 +756,7 @@ tlv_decode_fec_elm(struct nbr *nbr, struct ldp_msg *msg, char *buf,
return (off);
default:
- send_notification_nbr(nbr, S_UNKNOWN_FEC, msg->id, msg->type);
+ send_notification(nbr->tcp, S_UNKNOWN_FEC, msg->id, msg->type);
break;
}