-/* $OpenBSD: hello.c,v 1.53 2016/07/01 23:14:31 renato Exp $ */
+/* $OpenBSD: hello.c,v 1.54 2016/07/01 23:18:24 renato Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
switch (af) {
case AF_INET:
if (!(leconf->ipv4.flags & F_LDPD_AF_NO_GTSM))
- flags |= GTSM_HELLO;
+ flags |= F_HELLO_GTSM;
dst.v4 = global.mcast_addr_v4;
break;
case AF_INET6:
case HELLO_TARGETED:
af = tnbr->af;
holdtime = tnbr->hello_holdtime;
- flags = TARGETED_HELLO;
+ flags = F_HELLO_TARGETED;
if ((tnbr->flags & F_TNBR_CONFIGURED) || tnbr->pw_count)
- flags |= REQUEST_TARG_HELLO;
+ flags |= F_HELLO_REQ_TARG;
fd = (ldp_af_global_get(&global, af))->ldp_edisc_socket;
/* unicast destination address */
__func__, inet_ntoa(lsr_id), holdtime);
return;
}
- if (multicast && (flags & TARGETED_HELLO)) {
+ if (multicast && (flags & F_HELLO_TARGETED)) {
log_debug("%s: lsr-id %s: multicast targeted hello", __func__,
inet_ntoa(lsr_id));
return;
}
- if (!multicast && !((flags & TARGETED_HELLO))) {
+ if (!multicast && !((flags & F_HELLO_TARGETED))) {
log_debug("%s: lsr-id %s: unicast link hello", __func__,
inet_ntoa(lsr_id));
return;
* (i.e., MUST discard the targeted Hello if it failed the
* check)".
*/
- if (flags & TARGETED_HELLO) {
+ if (flags & F_HELLO_TARGETED) {
log_debug("%s: lsr-id %s: invalid targeted hello "
"transport address %s", __func__, inet_ntoa(lsr_id),
log_addr(af, &trans_addr));
}
memset(&source, 0, sizeof(source));
- if (flags & TARGETED_HELLO) {
+ if (flags & F_HELLO_TARGETED) {
/*
* RFC 7552 - Section 5.2:
* "The link-local IPv6 addresses MUST NOT be used as the
/* remove the dynamic tnbr if the 'R' bit was cleared */
if (tnbr && (tnbr->flags & F_TNBR_DYNAMIC) &&
- !((flags & REQUEST_TARG_HELLO))) {
+ !((flags & F_HELLO_REQ_TARG))) {
tnbr->flags &= ~F_TNBR_DYNAMIC;
tnbr = tnbr_check(tnbr);
}
if (!tnbr) {
- if (!((flags & REQUEST_TARG_HELLO) &&
+ if (!((flags & F_HELLO_REQ_TARG) &&
((ldp_af_conf_get(leconf, af))->flags &
F_LDPD_AF_THELLO_ACCEPT)))
return;
/* dynamic LDPv4 GTSM negotiation as per RFC 6720 */
if (nbr) {
- if (flags & GTSM_HELLO)
+ if (flags & F_HELLO_GTSM)
nbr->flags |= F_NBR_GTSM_NEGOTIATED;
else
nbr->flags &= ~F_NBR_GTSM_NEGOTIATED;
-/* $OpenBSD: ldp.h,v 1.30 2016/07/01 23:14:31 renato Exp $ */
+/* $OpenBSD: ldp.h,v 1.31 2016/07/01 23:18:24 renato Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
uint16_t flags;
};
-#define TARGETED_HELLO 0x8000
-#define REQUEST_TARG_HELLO 0x4000
-#define GTSM_HELLO 0x2000
+#define F_HELLO_TARGETED 0x8000
+#define F_HELLO_REQ_TARG 0x4000
+#define F_HELLO_GTSM 0x2000
struct hello_prms_opt4_tlv {
uint16_t type;