*: style for flog_warn conversions

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2018-08-24 16:26:43 +00:00
parent 9df414feeb
commit ade6974def
21 changed files with 237 additions and 193 deletions

View File

@ -38,7 +38,7 @@
#include "bgpd/bgp_errors.h" #include "bgpd/bgp_errors.h"
/* Attr. Flags and Attr. Type Code. */ /* Attr. Flags and Attr. Type Code. */
#define AS_HEADER_SIZE 2 #define AS_HEADER_SIZE 2
/* Now FOUR octets are used for AS value. */ /* Now FOUR octets are used for AS value. */
#define AS_VALUE_SIZE sizeof (as_t) #define AS_VALUE_SIZE sizeof (as_t)
@ -1639,8 +1639,9 @@ struct aspath *aspath_reconcile_as4(struct aspath *aspath,
if (hops < 0) { if (hops < 0) {
if (BGP_DEBUG(as4, AS4)) if (BGP_DEBUG(as4, AS4))
flog_warn(BGP_WARN_ASPATH_FEWER_HOPS, flog_warn(
"[AS4] Fewer hops in AS_PATH than NEW_AS_PATH"); BGP_WARN_ASPATH_FEWER_HOPS,
"[AS4] Fewer hops in AS_PATH than NEW_AS_PATH");
/* Something's gone wrong. The RFC says we should now ignore /* Something's gone wrong. The RFC says we should now ignore
* AS4_PATH, * AS4_PATH,
* which is daft behaviour - it contains vital loop-detection * which is daft behaviour - it contains vital loop-detection

View File

@ -1760,9 +1760,10 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
{ {
uint8_t val; uint8_t val;
if ((val = stream_getc(s))) if ((val = stream_getc(s)))
flog_warn(BGP_WARN_DEFUNCT_SNPA_LEN, flog_warn(
"%s sent non-zero value, %u, for defunct SNPA-length field", BGP_WARN_DEFUNCT_SNPA_LEN,
peer->host, val); "%s sent non-zero value, %u, for defunct SNPA-length field",
peer->host, val);
} }
/* must have nrli_len, what is left of the attribute */ /* must have nrli_len, what is left of the attribute */
@ -2378,11 +2379,12 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
/* Check remaining length check.*/ /* Check remaining length check.*/
if (endp - BGP_INPUT_PNT(peer) < BGP_ATTR_MIN_LEN) { if (endp - BGP_INPUT_PNT(peer) < BGP_ATTR_MIN_LEN) {
/* XXX warning: long int format, int arg (arg 5) */ /* XXX warning: long int format, int arg (arg 5) */
flog_warn(BGP_WARN_ATTRIBUTE_TOO_SMALL, flog_warn(
"%s: error BGP attribute length %lu is smaller than min len", BGP_WARN_ATTRIBUTE_TOO_SMALL,
peer->host, "%s: error BGP attribute length %lu is smaller than min len",
(unsigned long)(endp peer->host,
- stream_pnt(BGP_INPUT(peer)))); (unsigned long)(endp
- stream_pnt(BGP_INPUT(peer))));
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_ATTR_LENG_ERR); BGP_NOTIFY_UPDATE_ATTR_LENG_ERR);
@ -2400,11 +2402,12 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
/* Check whether Extended-Length applies and is in bounds */ /* Check whether Extended-Length applies and is in bounds */
if (CHECK_FLAG(flag, BGP_ATTR_FLAG_EXTLEN) if (CHECK_FLAG(flag, BGP_ATTR_FLAG_EXTLEN)
&& ((endp - startp) < (BGP_ATTR_MIN_LEN + 1))) { && ((endp - startp) < (BGP_ATTR_MIN_LEN + 1))) {
flog_warn(BGP_WARN_EXT_ATTRIBUTE_TOO_SMALL, flog_warn(
"%s: Extended length set, but just %lu bytes of attr header", BGP_WARN_EXT_ATTRIBUTE_TOO_SMALL,
peer->host, "%s: Extended length set, but just %lu bytes of attr header",
(unsigned long)(endp peer->host,
- stream_pnt(BGP_INPUT(peer)))); (unsigned long)(endp
- stream_pnt(BGP_INPUT(peer))));
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_ATTR_LENG_ERR); BGP_NOTIFY_UPDATE_ATTR_LENG_ERR);
@ -2422,9 +2425,10 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
List. */ List. */
if (CHECK_BITMAP(seen, type)) { if (CHECK_BITMAP(seen, type)) {
flog_warn(BGP_WARN_ATTRIBUTE_REPEATED, flog_warn(
"%s: error BGP attribute type %d appears twice in a message", BGP_WARN_ATTRIBUTE_REPEATED,
peer->host, type); "%s: error BGP attribute type %d appears twice in a message",
peer->host, type);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_MAL_ATTR); BGP_NOTIFY_UPDATE_MAL_ATTR);
@ -2440,10 +2444,11 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
attr_endp = BGP_INPUT_PNT(peer) + length; attr_endp = BGP_INPUT_PNT(peer) + length;
if (attr_endp > endp) { if (attr_endp > endp) {
flog_warn(BGP_WARN_ATTRIBUTE_TOO_LARGE, flog_warn(
"%s: BGP type %d length %d is too large, attribute total length is %d. attr_endp is %p. endp is %p", BGP_WARN_ATTRIBUTE_TOO_LARGE,
peer->host, type, length, size, attr_endp, "%s: BGP type %d length %d is too large, attribute total length is %d. attr_endp is %p. endp is %p",
endp); peer->host, type, length, size, attr_endp,
endp);
/* /*
* RFC 4271 6.3 * RFC 4271 6.3
* If any recognized attribute has an Attribute * If any recognized attribute has an Attribute
@ -2607,7 +2612,8 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
} }
if (ret == BGP_ATTR_PARSE_WITHDRAW) { if (ret == BGP_ATTR_PARSE_WITHDRAW) {
flog_warn(BGP_WARN_ATTRIBUTE_PARSE_WITHDRAW, flog_warn(
BGP_WARN_ATTRIBUTE_PARSE_WITHDRAW,
"%s: Attribute %s, parse error - treating as withdrawal", "%s: Attribute %s, parse error - treating as withdrawal",
peer->host, lookup_msg(attr_str, type, NULL)); peer->host, lookup_msg(attr_str, type, NULL));
if (as4_path) if (as4_path)

View File

@ -3683,10 +3683,11 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
if (attr && if (attr &&
(attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL))) { (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL))) {
if (attr->pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL) { if (attr->pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL) {
flog_warn(BGP_WARN_EVPN_PMSI_PRESENT, flog_warn(
"%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d", BGP_WARN_EVPN_PMSI_PRESENT,
peer->bgp->vrf_id, peer->host, "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d",
attr->pmsi_tnl_type); peer->bgp->vrf_id, peer->host,
attr->pmsi_tnl_type);
} }
} }
@ -5401,9 +5402,10 @@ int bgp_evpn_local_vni_del(struct bgp *bgp, vni_t vni)
vpn = bgp_evpn_lookup_vni(bgp, vni); vpn = bgp_evpn_lookup_vni(bgp, vni);
if (!vpn) { if (!vpn) {
if (bgp_debug_zebra(NULL)) if (bgp_debug_zebra(NULL))
flog_warn(BGP_WARN_EVPN_VPN_VNI, flog_warn(
"%u: VNI hash entry for VNI %u not found at DEL", BGP_WARN_EVPN_VPN_VNI,
bgp->vrf_id, vni); "%u: VNI hash entry for VNI %u not found at DEL",
bgp->vrf_id, vni);
return 0; return 0;
} }

View File

@ -1457,9 +1457,10 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
/* Attribute total length check. */ /* Attribute total length check. */
if (stream_pnt(s) + 2 > end) { if (stream_pnt(s) + 2 > end) {
flog_warn(BGP_WARN_UPDATE_PACKET_SHORT, flog_warn(
"%s [Error] Packet Error (update packet is short for attribute length)", BGP_WARN_UPDATE_PACKET_SHORT,
peer->host); "%s [Error] Packet Error (update packet is short for attribute length)",
peer->host);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_MAL_ATTR); BGP_NOTIFY_UPDATE_MAL_ATTR);
return BGP_Stop; return BGP_Stop;
@ -1470,9 +1471,10 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
/* Attribute length check. */ /* Attribute length check. */
if (stream_pnt(s) + attribute_len > end) { if (stream_pnt(s) + attribute_len > end) {
flog_warn(BGP_WARN_UPDATE_PACKET_LONG, flog_warn(
"%s [Error] Packet Error (update packet attribute length overflow %d)", BGP_WARN_UPDATE_PACKET_LONG,
peer->host, attribute_len); "%s [Error] Packet Error (update packet attribute length overflow %d)",
peer->host, attribute_len);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_MAL_ATTR); BGP_NOTIFY_UPDATE_MAL_ATTR);
return BGP_Stop; return BGP_Stop;
@ -2102,9 +2104,10 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
return BGP_Stop; return BGP_Stop;
} }
} else { } else {
flog_warn(BGP_WARN_UNRECOGNIZED_CAPABILITY, flog_warn(
"%s unrecognized capability code: %d - ignored", BGP_WARN_UNRECOGNIZED_CAPABILITY,
peer->host, hdr->code); "%s unrecognized capability code: %d - ignored",
peer->host, hdr->code);
} }
} }

View File

@ -427,9 +427,10 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
break; break;
default: default:
/* TODO: handle IPv6 nexthops */ /* TODO: handle IPv6 nexthops */
flog_warn(BGP_WARN_INVALID_NEXTHOP_LENGTH, flog_warn(
"%s: %s: invalid MP nexthop length (AFI IP): %u", BGP_WARN_INVALID_NEXTHOP_LENGTH,
__func__, peer->host, nhlen); "%s: %s: invalid MP nexthop length (AFI IP): %u",
__func__, peer->host, nhlen);
stream_free(s); stream_free(s);
return NULL; return NULL;
} }
@ -532,9 +533,10 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
break; break;
default: default:
/* TODO: handle IPv4 nexthops */ /* TODO: handle IPv4 nexthops */
flog_warn(BGP_WARN_INVALID_NEXTHOP_LENGTH, flog_warn(
"%s: %s: invalid MP nexthop length (AFI IP6): %u", BGP_WARN_INVALID_NEXTHOP_LENGTH,
__func__, peer->host, nhlen); "%s: %s: invalid MP nexthop length (AFI IP6): %u",
__func__, peer->host, nhlen);
stream_free(s); stream_free(s);
return NULL; return NULL;
} }

View File

@ -158,8 +158,8 @@ static int agentx_log_callback(int major, int minor, void *serverarg,
"snmp[err]: %s", msg ? msg : slm->msg); "snmp[err]: %s", msg ? msg : slm->msg);
break; break;
case LOG_WARNING: case LOG_WARNING:
flog_warn(LIB_WARN_SNMP, flog_warn(LIB_WARN_SNMP, "snmp[warning]: %s",
"snmp[warning]: %s", msg ? msg : slm->msg); msg ? msg : slm->msg);
break; break;
case LOG_NOTICE: case LOG_NOTICE:
zlog_notice("snmp[notice]: %s", msg ? msg : slm->msg); zlog_notice("snmp[notice]: %s", msg ? msg : slm->msg);

View File

@ -378,9 +378,8 @@ buffer_status_t buffer_flush_window(struct buffer *b, int fd, int width,
} }
#else /* IOV_MAX */ #else /* IOV_MAX */
if ((nbytes = writev(fd, iov, iov_index)) < 0) if ((nbytes = writev(fd, iov, iov_index)) < 0)
flog_err(LIB_ERR_SOCKET, flog_err(LIB_ERR_SOCKET, "%s: writev to fd %d failed: %s",
"%s: writev to fd %d failed: %s", __func__, fd, __func__, fd, safe_strerror(errno));
safe_strerror(errno));
#endif /* IOV_MAX */ #endif /* IOV_MAX */
/* Free printed buffer data. */ /* Free printed buffer data. */
@ -440,9 +439,8 @@ in one shot. */
if (ERRNO_IO_RETRY(errno)) if (ERRNO_IO_RETRY(errno))
/* Calling code should try again later. */ /* Calling code should try again later. */
return BUFFER_PENDING; return BUFFER_PENDING;
flog_err(LIB_ERR_SOCKET, flog_err(LIB_ERR_SOCKET, "%s: write error on fd %d: %s",
"%s: write error on fd %d: %s", __func__, fd, __func__, fd, safe_strerror(errno));
safe_strerror(errno));
return BUFFER_ERROR; return BUFFER_ERROR;
} }
@ -496,9 +494,8 @@ buffer_status_t buffer_write(struct buffer *b, int fd, const void *p,
if (ERRNO_IO_RETRY(errno)) if (ERRNO_IO_RETRY(errno))
nbytes = 0; nbytes = 0;
else { else {
flog_err(LIB_ERR_SOCKET, flog_err(LIB_ERR_SOCKET, "%s: write error on fd %d: %s",
"%s: write error on fd %d: %s", __func__, fd, __func__, fd, safe_strerror(errno));
safe_strerror(errno));
return BUFFER_ERROR; return BUFFER_ERROR;
} }
} }

View File

@ -933,8 +933,9 @@ static int vty_prefix_list_install(struct vty *vty, afi_t afi, const char *name,
vty_out(vty, vty_out(vty,
"%% Prefix-list %s prefix changed from %s to %s to match length\n", "%% Prefix-list %s prefix changed from %s to %s to match length\n",
name, buf, buf_tmp); name, buf, buf_tmp);
zlog_info("Prefix-list %s prefix changed from %s to %s to match length", zlog_info(
name, buf, buf_tmp); "Prefix-list %s prefix changed from %s to %s to match length",
name, buf, buf_tmp);
p = p_tmp; p = p_tmp;
} }

View File

@ -140,8 +140,7 @@ int sockunion_socket(const union sockunion *su)
sock = socket(su->sa.sa_family, SOCK_STREAM, 0); sock = socket(su->sa.sa_family, SOCK_STREAM, 0);
if (sock < 0) { if (sock < 0) {
char buf[SU_ADDRSTRLEN]; char buf[SU_ADDRSTRLEN];
flog_err(LIB_ERR_SOCKET, flog_err(LIB_ERR_SOCKET, "Can't make socket for %s : %s",
"Can't make socket for %s : %s",
sockunion_log(su, buf, SU_ADDRSTRLEN), sockunion_log(su, buf, SU_ADDRSTRLEN),
safe_strerror(errno)); safe_strerror(errno));
return -1; return -1;
@ -275,8 +274,7 @@ int sockunion_bind(int sock, union sockunion *su, unsigned short port,
ret = bind(sock, (struct sockaddr *)su, size); ret = bind(sock, (struct sockaddr *)su, size);
if (ret < 0) { if (ret < 0) {
char buf[SU_ADDRSTRLEN]; char buf[SU_ADDRSTRLEN];
flog_err(LIB_ERR_SOCKET, flog_err(LIB_ERR_SOCKET, "can't bind socket for %s : %s",
"can't bind socket for %s : %s",
sockunion_log(su, buf, SU_ADDRSTRLEN), sockunion_log(su, buf, SU_ADDRSTRLEN),
safe_strerror(errno)); safe_strerror(errno));
} }
@ -332,7 +330,7 @@ int sockopt_ttl(int family, int sock, int ttl)
if (ret < 0) { if (ret < 0) {
flog_err(LIB_ERR_SOCKET, flog_err(LIB_ERR_SOCKET,
"can't set sockopt IP_TTL %d to socket %d", "can't set sockopt IP_TTL %d to socket %d",
ttl, sock); ttl, sock);
return -1; return -1;
} }
return 0; return 0;
@ -342,9 +340,10 @@ int sockopt_ttl(int family, int sock, int ttl)
ret = setsockopt(sock, IPPROTO_IPV6, IPV6_UNICAST_HOPS, ret = setsockopt(sock, IPPROTO_IPV6, IPV6_UNICAST_HOPS,
(void *)&ttl, sizeof(int)); (void *)&ttl, sizeof(int));
if (ret < 0) { if (ret < 0) {
flog_err(LIB_ERR_SOCKET, flog_err(
"can't set sockopt IPV6_UNICAST_HOPS %d to socket %d", LIB_ERR_SOCKET,
ttl, sock); "can't set sockopt IPV6_UNICAST_HOPS %d to socket %d",
ttl, sock);
return -1; return -1;
} }
return 0; return 0;
@ -389,9 +388,10 @@ int sockopt_minttl(int family, int sock, int minttl)
int ret = setsockopt(sock, IPPROTO_IP, IP_MINTTL, &minttl, int ret = setsockopt(sock, IPPROTO_IP, IP_MINTTL, &minttl,
sizeof(minttl)); sizeof(minttl));
if (ret < 0) if (ret < 0)
flog_err(LIB_ERR_SOCKET, flog_err(
"can't set sockopt IP_MINTTL to %d on socket %d: %s", LIB_ERR_SOCKET,
minttl, sock, safe_strerror(errno)); "can't set sockopt IP_MINTTL to %d on socket %d: %s",
minttl, sock, safe_strerror(errno));
return ret; return ret;
} }
#endif /* IP_MINTTL */ #endif /* IP_MINTTL */
@ -400,9 +400,10 @@ int sockopt_minttl(int family, int sock, int minttl)
int ret = setsockopt(sock, IPPROTO_IPV6, IPV6_MINHOPCOUNT, int ret = setsockopt(sock, IPPROTO_IPV6, IPV6_MINHOPCOUNT,
&minttl, sizeof(minttl)); &minttl, sizeof(minttl));
if (ret < 0) if (ret < 0)
flog_err(LIB_ERR_SOCKET, flog_err(
"can't set sockopt IPV6_MINHOPCOUNT to %d on socket %d: %s", LIB_ERR_SOCKET,
minttl, sock, safe_strerror(errno)); "can't set sockopt IPV6_MINHOPCOUNT to %d on socket %d: %s",
minttl, sock, safe_strerror(errno));
return ret; return ret;
} }
#endif #endif

View File

@ -667,8 +667,8 @@ int vrf_netns_handler_create(struct vty *vty, struct vrf *vrf, char *pathname,
vrf->vrf_id, ns->name); vrf->vrf_id, ns->name);
else else
zlog_info( zlog_info(
"VRF %u already configured with NETNS %s", "VRF %u already configured with NETNS %s",
vrf->vrf_id, ns->name); vrf->vrf_id, ns->name);
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;
} }
} }

View File

@ -249,9 +249,10 @@ static int zclient_flush_data(struct thread *thread)
return -1; return -1;
switch (buffer_flush_available(zclient->wb, zclient->sock)) { switch (buffer_flush_available(zclient->wb, zclient->sock)) {
case BUFFER_ERROR: case BUFFER_ERROR:
flog_err(LIB_ERR_ZAPI_SOCKET, flog_err(
"%s: buffer_flush_available failed on zclient fd %d, closing", LIB_ERR_ZAPI_SOCKET,
__func__, zclient->sock); "%s: buffer_flush_available failed on zclient fd %d, closing",
__func__, zclient->sock);
return zclient_failed(zclient); return zclient_failed(zclient);
break; break;
case BUFFER_PENDING: case BUFFER_PENDING:
@ -576,9 +577,8 @@ int zclient_start(struct zclient *zclient)
} }
if (set_nonblocking(zclient->sock) < 0) if (set_nonblocking(zclient->sock) < 0)
flog_err(LIB_ERR_ZAPI_SOCKET, flog_err(LIB_ERR_ZAPI_SOCKET, "%s: set_nonblocking(%d) failed",
"%s: set_nonblocking(%d) failed", __func__, __func__, zclient->sock);
zclient->sock);
/* Clear fail count. */ /* Clear fail count. */
zclient->fail = 0; zclient->fail = 0;
@ -773,9 +773,10 @@ int zapi_route_encode(uint8_t cmd, struct stream *s, struct zapi_route *api)
char buf[PREFIX2STR_BUFFER]; char buf[PREFIX2STR_BUFFER];
prefix2str(&api->prefix, buf, sizeof(buf)); prefix2str(&api->prefix, buf, sizeof(buf));
flog_err(LIB_ERR_ZAPI_ENCODE, flog_err(
"%s: prefix %s: can't encode %u nexthops (maximum is %u)", LIB_ERR_ZAPI_ENCODE,
__func__, buf, api->nexthop_num, MULTIPATH_NUM); "%s: prefix %s: can't encode %u nexthops (maximum is %u)",
__func__, buf, api->nexthop_num, MULTIPATH_NUM);
return -1; return -1;
} }
@ -884,17 +885,19 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
switch (api->prefix.family) { switch (api->prefix.family) {
case AF_INET: case AF_INET:
if (api->prefix.prefixlen > IPV4_MAX_PREFIXLEN) { if (api->prefix.prefixlen > IPV4_MAX_PREFIXLEN) {
flog_err(LIB_ERR_ZAPI_ENCODE, flog_err(
"%s: V4 prefixlen is %d which should not be more than 32", LIB_ERR_ZAPI_ENCODE,
__PRETTY_FUNCTION__, api->prefix.prefixlen); "%s: V4 prefixlen is %d which should not be more than 32",
__PRETTY_FUNCTION__, api->prefix.prefixlen);
return -1; return -1;
} }
break; break;
case AF_INET6: case AF_INET6:
if (api->prefix.prefixlen > IPV6_MAX_PREFIXLEN) { if (api->prefix.prefixlen > IPV6_MAX_PREFIXLEN) {
flog_err(LIB_ERR_ZAPI_ENCODE, flog_err(
"%s: v6 prefixlen is %d which should not be more than 128", LIB_ERR_ZAPI_ENCODE,
__PRETTY_FUNCTION__, api->prefix.prefixlen); "%s: v6 prefixlen is %d which should not be more than 128",
__PRETTY_FUNCTION__, api->prefix.prefixlen);
return -1; return -1;
} }
break; break;
@ -910,9 +913,10 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
api->src_prefix.family = AF_INET6; api->src_prefix.family = AF_INET6;
STREAM_GETC(s, api->src_prefix.prefixlen); STREAM_GETC(s, api->src_prefix.prefixlen);
if (api->src_prefix.prefixlen > IPV6_MAX_PREFIXLEN) { if (api->src_prefix.prefixlen > IPV6_MAX_PREFIXLEN) {
flog_err(LIB_ERR_ZAPI_ENCODE, flog_err(
"%s: SRC Prefix prefixlen received: %d is too large", LIB_ERR_ZAPI_ENCODE,
__PRETTY_FUNCTION__, api->src_prefix.prefixlen); "%s: SRC Prefix prefixlen received: %d is too large",
__PRETTY_FUNCTION__, api->src_prefix.prefixlen);
return -1; return -1;
} }
STREAM_GET(&api->src_prefix.prefix, s, STREAM_GET(&api->src_prefix.prefix, s,
@ -920,9 +924,10 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
if (api->prefix.family != AF_INET6 if (api->prefix.family != AF_INET6
|| api->src_prefix.prefixlen == 0) { || api->src_prefix.prefixlen == 0) {
flog_err(LIB_ERR_ZAPI_ENCODE, flog_err(
"%s: SRC prefix specified in some manner that makes no sense", LIB_ERR_ZAPI_ENCODE,
__PRETTY_FUNCTION__); "%s: SRC prefix specified in some manner that makes no sense",
__PRETTY_FUNCTION__);
return -1; return -1;
} }
} }
@ -972,9 +977,10 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
STREAM_GETC(s, api_nh->label_num); STREAM_GETC(s, api_nh->label_num);
if (api_nh->label_num > MPLS_MAX_LABELS) { if (api_nh->label_num > MPLS_MAX_LABELS) {
flog_err(LIB_ERR_ZAPI_ENCODE, flog_err(
"%s: invalid number of MPLS labels (%u)", LIB_ERR_ZAPI_ENCODE,
__func__, api_nh->label_num); "%s: invalid number of MPLS labels (%u)",
__func__, api_nh->label_num);
return -1; return -1;
} }
@ -1666,11 +1672,12 @@ struct connected *zebra_interface_address_read(int type, struct stream *s,
/* carp interfaces on OpenBSD with 0.0.0.0/0 as /* carp interfaces on OpenBSD with 0.0.0.0/0 as
* "peer" */ * "peer" */
char buf[PREFIX_STRLEN]; char buf[PREFIX_STRLEN];
flog_err(LIB_ERR_ZAPI_ENCODE, flog_err(
"warning: interface %s address %s with peer flag set, but no peer address!", LIB_ERR_ZAPI_ENCODE,
ifp->name, "warning: interface %s address %s with peer flag set, but no peer address!",
prefix2str(ifc->address, buf, ifp->name,
sizeof buf)); prefix2str(ifc->address, buf,
sizeof buf));
UNSET_FLAG(ifc->flags, ZEBRA_IFA_PEER); UNSET_FLAG(ifc->flags, ZEBRA_IFA_PEER);
} }
} }
@ -1723,8 +1730,8 @@ zebra_interface_nbr_address_read(int type, struct stream *s, vrf_id_t vrf_id)
flog_err(LIB_ERR_ZAPI_ENCODE, flog_err(LIB_ERR_ZAPI_ENCODE,
"INTERFACE_NBR_%s: Cannot find IF %u in VRF %d", "INTERFACE_NBR_%s: Cannot find IF %u in VRF %d",
(type == ZEBRA_INTERFACE_NBR_ADDRESS_ADD) ? "ADD" (type == ZEBRA_INTERFACE_NBR_ADDRESS_ADD) ? "ADD"
: "DELETE", : "DELETE",
ifindex, vrf_id); ifindex, vrf_id);
return NULL; return NULL;
} }
@ -2407,10 +2414,11 @@ static int zclient_read(struct thread *thread)
/* Length check. */ /* Length check. */
if (length > STREAM_SIZE(zclient->ibuf)) { if (length > STREAM_SIZE(zclient->ibuf)) {
struct stream *ns; struct stream *ns;
flog_err(LIB_ERR_ZAPI_ENCODE, flog_err(
"%s: message size %u exceeds buffer size %lu, expanding...", LIB_ERR_ZAPI_ENCODE,
__func__, length, "%s: message size %u exceeds buffer size %lu, expanding...",
(unsigned long)STREAM_SIZE(zclient->ibuf)); __func__, length,
(unsigned long)STREAM_SIZE(zclient->ibuf));
ns = stream_new(length); ns = stream_new(length);
stream_copy(ns, zclient->ibuf); stream_copy(ns, zclient->ibuf);
stream_free(zclient->ibuf); stream_free(zclient->ibuf);

View File

@ -153,8 +153,9 @@ int ospf_apiserver_init(void)
NULL, /* ospf_apiserver_lsa_refresher */ NULL, /* ospf_apiserver_lsa_refresher */
ospf_apiserver_lsa_update, ospf_apiserver_lsa_delete); ospf_apiserver_lsa_update, ospf_apiserver_lsa_delete);
if (rc != 0) { if (rc != 0) {
flog_warn(OSPF_WARN_OPAQUE_REGISTRATION, flog_warn(
"ospf_apiserver_init: Failed to register opaque type [0/0]"); OSPF_WARN_OPAQUE_REGISTRATION,
"ospf_apiserver_init: Failed to register opaque type [0/0]");
} }
rc = 0; rc = 0;

View File

@ -136,11 +136,11 @@ ospf_external_info_add(struct ospf *ospf, uint8_t type, unsigned short instance,
inet_ntop(AF_INET, (void *)&nexthop.s_addr, inetbuf, inet_ntop(AF_INET, (void *)&nexthop.s_addr, inetbuf,
INET6_BUFSIZ); INET6_BUFSIZ);
if (IS_DEBUG_OSPF(lsa, LSA_GENERATE)) if (IS_DEBUG_OSPF(lsa, LSA_GENERATE))
zlog_debug( zlog_debug(
"Redistribute[%s][%d][%u]: %s/%d discarding old info with NH %s.", "Redistribute[%s][%d][%u]: %s/%d discarding old info with NH %s.",
ospf_redist_string(type), instance, ospf_redist_string(type), instance,
ospf->vrf_id, inet_ntoa(p.prefix), p.prefixlen, ospf->vrf_id, inet_ntoa(p.prefix),
inetbuf); p.prefixlen, inetbuf);
XFREE(MTYPE_OSPF_EXTERNAL_INFO, rn->info); XFREE(MTYPE_OSPF_EXTERNAL_INFO, rn->info);
rn->info = NULL; rn->info = NULL;
} }

View File

@ -760,8 +760,8 @@ static int ospf_ext_link_lsa_update(struct ospf_lsa *lsa)
{ {
/* Sanity Check */ /* Sanity Check */
if (lsa == NULL) { if (lsa == NULL) {
flog_warn(OSPF_WARN_LSA_NULL, flog_warn(OSPF_WARN_LSA_NULL, "EXT (%s): Abort! LSA is NULL",
"EXT (%s): Abort! LSA is NULL", __func__); __func__);
return -1; return -1;
} }
@ -794,8 +794,8 @@ static int ospf_ext_pref_lsa_update(struct ospf_lsa *lsa)
/* Sanity Check */ /* Sanity Check */
if (lsa == NULL) { if (lsa == NULL) {
flog_warn(OSPF_WARN_LSA_NULL, flog_warn(OSPF_WARN_LSA_NULL, "EXT (%s): Abort! LSA is NULL",
"EXT (%s): Abort! LSA is NULL", __func__); __func__);
return -1; return -1;
} }
@ -1190,8 +1190,9 @@ static int ospf_ext_pref_lsa_originate(void *arg)
if (CHECK_FLAG(exti->flags, EXT_LPFLG_LSA_ENGAGED)) { if (CHECK_FLAG(exti->flags, EXT_LPFLG_LSA_ENGAGED)) {
if (CHECK_FLAG(exti->flags, if (CHECK_FLAG(exti->flags,
EXT_LPFLG_LSA_FORCED_REFRESH)) { EXT_LPFLG_LSA_FORCED_REFRESH)) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(
"EXT (%s): Refresh instead of Originate", OSPF_WARN_EXT_LSA_UNEXPECTED,
"EXT (%s): Refresh instead of Originate",
__func__); __func__);
UNSET_FLAG(exti->flags, UNSET_FLAG(exti->flags,
EXT_LPFLG_LSA_FORCED_REFRESH); EXT_LPFLG_LSA_FORCED_REFRESH);
@ -1247,9 +1248,10 @@ static int ospf_ext_link_lsa_originate(void *arg)
if (CHECK_FLAG(exti->flags, EXT_LPFLG_LSA_ENGAGED)) { if (CHECK_FLAG(exti->flags, EXT_LPFLG_LSA_ENGAGED)) {
if (CHECK_FLAG(exti->flags, if (CHECK_FLAG(exti->flags,
EXT_LPFLG_LSA_FORCED_REFRESH)) { EXT_LPFLG_LSA_FORCED_REFRESH)) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(
"EXT (%s): Refresh instead of Originate", OSPF_WARN_EXT_LSA_UNEXPECTED,
__func__); "EXT (%s): Refresh instead of Originate",
__func__);
UNSET_FLAG(exti->flags, UNSET_FLAG(exti->flags,
EXT_LPFLG_LSA_FORCED_REFRESH); EXT_LPFLG_LSA_FORCED_REFRESH);
ospf_ext_link_lsa_schedule(exti, ospf_ext_link_lsa_schedule(exti,
@ -1467,9 +1469,10 @@ static void ospf_ext_pref_lsa_schedule(struct ext_itf *exti,
/* Set LSA header information */ /* Set LSA header information */
if (exti->area == NULL) { if (exti->area == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(
"EXT (%s): Flooding is Area scope but area is not yet set", OSPF_WARN_EXT_LSA_UNEXPECTED,
__func__); "EXT (%s): Flooding is Area scope but area is not yet set",
__func__);
if (OspfEXT.area == NULL) { if (OspfEXT.area == NULL) {
top = ospf_lookup_by_vrf_id(VRF_DEFAULT); top = ospf_lookup_by_vrf_id(VRF_DEFAULT);
OspfEXT.area = ospf_area_lookup_by_area_id( OspfEXT.area = ospf_area_lookup_by_area_id(
@ -1527,9 +1530,10 @@ static void ospf_ext_link_lsa_schedule(struct ext_itf *exti,
/* Set LSA header information */ /* Set LSA header information */
if (exti->area == NULL) { if (exti->area == NULL) {
flog_warn(OSPF_WARN_EXT_LSA_UNEXPECTED, flog_warn(
"EXT (%s): Flooding is Area scope but area is not yet set", OSPF_WARN_EXT_LSA_UNEXPECTED,
__func__); "EXT (%s): Flooding is Area scope but area is not yet set",
__func__);
if (OspfEXT.area == NULL) { if (OspfEXT.area == NULL) {
top = ospf_lookup_by_vrf_id(VRF_DEFAULT); top = ospf_lookup_by_vrf_id(VRF_DEFAULT);
OspfEXT.area = ospf_area_lookup_by_area_id( OspfEXT.area = ospf_area_lookup_by_area_id(

View File

@ -271,8 +271,8 @@ void ospf_nbr_add_self(struct ospf_interface *oi, struct in_addr router_id)
/* There is already pseudo neighbor. */ /* There is already pseudo neighbor. */
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
"router_id %s already present in neighbor table. node refcount %u", "router_id %s already present in neighbor table. node refcount %u",
inet_ntoa(router_id), rn->lock); inet_ntoa(router_id), rn->lock);
route_unlock_node(rn); route_unlock_node(rn);
} else } else
rn->info = oi->nbr_self; rn->info = oi->nbr_self;

View File

@ -51,12 +51,13 @@ int ospf_if_add_allspfrouters(struct ospf *top, struct prefix *p,
p->u.prefix4, htonl(OSPF_ALLSPFROUTERS), p->u.prefix4, htonl(OSPF_ALLSPFROUTERS),
ifindex); ifindex);
if (ret < 0) if (ret < 0)
flog_err(LIB_ERR_SOCKET, flog_err(
"can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, " LIB_ERR_SOCKET,
"ifindex %u, AllSPFRouters): %s; perhaps a kernel limit " "can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
"on # of multicast group memberships has been exceeded?", "ifindex %u, AllSPFRouters): %s; perhaps a kernel limit "
top->fd, inet_ntoa(p->u.prefix4), ifindex, "on # of multicast group memberships has been exceeded?",
safe_strerror(errno)); top->fd, inet_ntoa(p->u.prefix4), ifindex,
safe_strerror(errno));
else { else {
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
@ -101,12 +102,13 @@ int ospf_if_add_alldrouters(struct ospf *top, struct prefix *p,
p->u.prefix4, htonl(OSPF_ALLDROUTERS), p->u.prefix4, htonl(OSPF_ALLDROUTERS),
ifindex); ifindex);
if (ret < 0) if (ret < 0)
flog_err(LIB_ERR_SOCKET, flog_err(
"can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, " LIB_ERR_SOCKET,
"ifindex %u, AllDRouters): %s; perhaps a kernel limit " "can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
"on # of multicast group memberships has been exceeded?", "ifindex %u, AllDRouters): %s; perhaps a kernel limit "
top->fd, inet_ntoa(p->u.prefix4), ifindex, "on # of multicast group memberships has been exceeded?",
safe_strerror(errno)); top->fd, inet_ntoa(p->u.prefix4), ifindex,
safe_strerror(errno));
else else
zlog_debug( zlog_debug(
"interface %s [%u] join AllDRouters Multicast group.", "interface %s [%u] join AllDRouters Multicast group.",

View File

@ -796,15 +796,16 @@ int ospf_nsm_event(struct thread *thread)
* not * not
* try set next_state. * try set next_state.
*/ */
flog_err(OSPF_ERR_FSM_INVALID_STATE, flog_err(
"NSM[%s:%s]: %s (%s): " OSPF_ERR_FSM_INVALID_STATE,
"Warning: action tried to change next_state to %s", "NSM[%s:%s]: %s (%s): "
IF_NAME(nbr->oi), inet_ntoa(nbr->router_id), "Warning: action tried to change next_state to %s",
lookup_msg(ospf_nsm_state_msg, nbr->state, IF_NAME(nbr->oi), inet_ntoa(nbr->router_id),
NULL), lookup_msg(ospf_nsm_state_msg, nbr->state,
ospf_nsm_event_str[event], NULL),
lookup_msg(ospf_nsm_state_msg, func_state, ospf_nsm_event_str[event],
NULL)); lookup_msg(ospf_nsm_state_msg, func_state,
NULL));
} }
} }

View File

@ -186,8 +186,9 @@ static int ospf_router_info_register(uint8_t scope)
NULL); /* del_lsa_hook */ NULL); /* del_lsa_hook */
if (rc != 0) { if (rc != 0) {
flog_warn(OSPF_WARN_OPAQUE_REGISTRATION, flog_warn(
"ospf_router_info_init: Failed to register functions"); OSPF_WARN_OPAQUE_REGISTRATION,
"ospf_router_info_init: Failed to register functions");
return rc; return rc;
} }
@ -201,7 +202,8 @@ static int ospf_router_info_unregister()
if ((OspfRI.scope != OSPF_OPAQUE_AS_LSA) if ((OspfRI.scope != OSPF_OPAQUE_AS_LSA)
&& (OspfRI.scope != OSPF_OPAQUE_AREA_LSA)) { && (OspfRI.scope != OSPF_OPAQUE_AREA_LSA)) {
assert("Unable to unregister Router Info functions: Wrong scope!" == NULL); assert("Unable to unregister Router Info functions: Wrong scope!"
== NULL);
return -1; return -1;
} }

View File

@ -818,8 +818,8 @@ static struct sr_prefix *get_ext_prefix_sid(struct tlv_header *tlvh)
psid = (struct ext_subtlv_prefix_sid *)sub_tlvh; psid = (struct ext_subtlv_prefix_sid *)sub_tlvh;
if (psid->algorithm != SR_ALGORITHM_SPF) { if (psid->algorithm != SR_ALGORITHM_SPF) {
flog_err(OSPF_ERR_INVALID_ALGORITHM, flog_err(OSPF_ERR_INVALID_ALGORITHM,
"SR (%s): Unsupported Algorithm", "SR (%s): Unsupported Algorithm",
__func__); __func__);
XFREE(MTYPE_OSPF_SR_PARAMS, srp); XFREE(MTYPE_OSPF_SR_PARAMS, srp);
return NULL; return NULL;
} }

View File

@ -103,8 +103,9 @@ int ospf_mpls_te_init(void)
ospf_mpls_te_lsa_refresh, NULL, /* ospf_mpls_te_new_lsa_hook */ ospf_mpls_te_lsa_refresh, NULL, /* ospf_mpls_te_new_lsa_hook */
NULL /* ospf_mpls_te_del_lsa_hook */); NULL /* ospf_mpls_te_del_lsa_hook */);
if (rc != 0) { if (rc != 0) {
flog_warn(OSPF_WARN_OPAQUE_REGISTRATION, flog_warn(
"ospf_mpls_te_init: Failed to register Traffic Engineering functions"); OSPF_WARN_OPAQUE_REGISTRATION,
"ospf_mpls_te_init: Failed to register Traffic Engineering functions");
return rc; return rc;
} }
@ -140,8 +141,9 @@ static int ospf_mpls_te_register(enum inter_as_mode mode)
ospf_mpls_te_lsa_refresh, NULL, NULL); ospf_mpls_te_lsa_refresh, NULL, NULL);
if (rc != 0) { if (rc != 0) {
flog_warn(OSPF_WARN_OPAQUE_REGISTRATION, flog_warn(
"ospf_router_info_init: Failed to register Inter-AS functions"); OSPF_WARN_OPAQUE_REGISTRATION,
"ospf_router_info_init: Failed to register Inter-AS functions");
return rc; return rc;
} }
@ -817,8 +819,9 @@ static int is_mandated_params_set(struct mpls_te_link *lp)
int rc = 0; int rc = 0;
if (ntohs(OspfMplsTE.router_addr.header.type) == 0) { if (ntohs(OspfMplsTE.router_addr.header.type) == 0) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(
"MPLS-TE(is_mandated_params_set) Missing Router Address"); OSPF_WARN_TE_UNEXPECTED,
"MPLS-TE(is_mandated_params_set) Missing Router Address");
return rc; return rc;
} }
@ -921,9 +924,10 @@ void ospf_mpls_te_update_if(struct interface *ifp)
/* Get Link context from interface */ /* Get Link context from interface */
if ((lp = lookup_linkparams_by_ifp(ifp)) == NULL) { if ((lp = lookup_linkparams_by_ifp(ifp)) == NULL) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(
"OSPF MPLS-TE Update: Did not find Link Parameters context for interface %s", OSPF_WARN_TE_UNEXPECTED,
ifp->name); "OSPF MPLS-TE Update: Did not find Link Parameters context for interface %s",
ifp->name);
return; return;
} }
@ -965,16 +969,18 @@ static void ospf_mpls_te_ism_change(struct ospf_interface *oi, int old_state)
struct mpls_te_link *lp; struct mpls_te_link *lp;
if ((lp = lookup_linkparams_by_ifp(oi->ifp)) == NULL) { if ((lp = lookup_linkparams_by_ifp(oi->ifp)) == NULL) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(
"ospf_mpls_te_ism_change: Cannot get linkparams from OI(%s)?", OSPF_WARN_TE_UNEXPECTED,
IF_NAME(oi)); "ospf_mpls_te_ism_change: Cannot get linkparams from OI(%s)?",
IF_NAME(oi));
return; return;
} }
if (oi->area == NULL || oi->area->ospf == NULL) { if (oi->area == NULL || oi->area->ospf == NULL) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(
"ospf_mpls_te_ism_change: Cannot refer to OSPF from OI(%s)?", OSPF_WARN_TE_UNEXPECTED,
IF_NAME(oi)); "ospf_mpls_te_ism_change: Cannot refer to OSPF from OI(%s)?",
IF_NAME(oi));
return; return;
} }
#ifdef notyet #ifdef notyet
@ -982,10 +988,11 @@ static void ospf_mpls_te_ism_change(struct ospf_interface *oi, int old_state)
&& !IPV4_ADDR_SAME(&lp->area->area_id, &oi->area->area_id)) && !IPV4_ADDR_SAME(&lp->area->area_id, &oi->area->area_id))
|| (lp->area != NULL && oi->area == NULL)) { || (lp->area != NULL && oi->area == NULL)) {
/* How should we consider this case? */ /* How should we consider this case? */
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(
"MPLS-TE: Area for OI(%s) has changed to [%s], flush previous LSAs", OSPF_WARN_TE_UNEXPECTED,
IF_NAME(oi), "MPLS-TE: Area for OI(%s) has changed to [%s], flush previous LSAs",
oi->area ? inet_ntoa(oi->area->area_id) : "N/A"); IF_NAME(oi),
oi->area ? inet_ntoa(oi->area->area_id) : "N/A");
ospf_mpls_te_lsa_schedule(lp, FLUSH_THIS_LSA); ospf_mpls_te_lsa_schedule(lp, FLUSH_THIS_LSA);
} }
#endif #endif
@ -1216,8 +1223,9 @@ static int ospf_mpls_te_lsa_originate1(struct ospf_area *area,
/* Create new Opaque-LSA/MPLS-TE instance. */ /* Create new Opaque-LSA/MPLS-TE instance. */
new = ospf_mpls_te_lsa_new(area->ospf, area, lp); new = ospf_mpls_te_lsa_new(area->ospf, area, lp);
if (new == NULL) { if (new == NULL) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(
"ospf_mpls_te_lsa_originate1: ospf_mpls_te_lsa_new() ?"); OSPF_WARN_TE_UNEXPECTED,
"ospf_mpls_te_lsa_originate1: ospf_mpls_te_lsa_new() ?");
return rc; return rc;
} }
@ -1317,8 +1325,9 @@ static int ospf_mpls_te_lsa_originate2(struct ospf *top,
/* Create new Opaque-LSA/Inter-AS instance. */ /* Create new Opaque-LSA/Inter-AS instance. */
new = ospf_mpls_te_lsa_new(top, NULL, lp); new = ospf_mpls_te_lsa_new(top, NULL, lp);
if (new == NULL) { if (new == NULL) {
flog_warn(OSPF_WARN_LSA_UNEXPECTED, flog_warn(
"ospf_mpls_te_lsa_originate2: ospf_router_info_lsa_new() ?"); OSPF_WARN_LSA_UNEXPECTED,
"ospf_mpls_te_lsa_originate2: ospf_router_info_lsa_new() ?");
return rc; return rc;
} }
new->vrf_id = top->vrf_id; new->vrf_id = top->vrf_id;
@ -1380,9 +1389,10 @@ static int ospf_mpls_te_lsa_originate_as(void *arg)
} }
if (!is_mandated_params_set(lp)) { if (!is_mandated_params_set(lp)) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(
"ospf_mpls_te_lsa_originate_as: Link(%s) lacks some mandated MPLS-TE parameters.", OSPF_WARN_TE_UNEXPECTED,
lp->ifp ? lp->ifp->name : "?"); "ospf_mpls_te_lsa_originate_as: Link(%s) lacks some mandated MPLS-TE parameters.",
lp->ifp ? lp->ifp->name : "?");
continue; continue;
} }
@ -1437,8 +1447,9 @@ static struct ospf_lsa *ospf_mpls_te_lsa_refresh(struct ospf_lsa *lsa)
/* Check if lp was not disable in the interval */ /* Check if lp was not disable in the interval */
if (!CHECK_FLAG(lp->flags, LPFLG_LSA_ACTIVE)) { if (!CHECK_FLAG(lp->flags, LPFLG_LSA_ACTIVE)) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(
"ospf_mpls_te_lsa_refresh: lp was disabled: Flush it!"); OSPF_WARN_TE_UNEXPECTED,
"ospf_mpls_te_lsa_refresh: lp was disabled: Flush it!");
lsa->data->ls_age = lsa->data->ls_age =
htons(OSPF_LSA_MAXAGE); /* Flush it anyway. */ htons(OSPF_LSA_MAXAGE); /* Flush it anyway. */
} }
@ -1522,8 +1533,9 @@ void ospf_mpls_te_lsa_schedule(struct mpls_te_link *lp, enum lsa_opcode opcode)
top, OspfMplsTE.interas_areaid); top, OspfMplsTE.interas_areaid);
/* Unable to set the area context. Abort! */ /* Unable to set the area context. Abort! */
if (lp->area == NULL) { if (lp->area == NULL) {
flog_warn(OSPF_WARN_TE_UNEXPECTED, flog_warn(
"MPLS-TE(ospf_mpls_te_lsa_schedule) Area context is null. Abort !"); OSPF_WARN_TE_UNEXPECTED,
"MPLS-TE(ospf_mpls_te_lsa_schedule) Area context is null. Abort !");
return; return;
} }
tmp = SET_OPAQUE_LSID(OPAQUE_TYPE_INTER_AS_LSA, tmp = SET_OPAQUE_LSID(OPAQUE_TYPE_INTER_AS_LSA,

View File

@ -324,9 +324,10 @@ static struct ospf *ospf_new(unsigned short instance, const char *name)
new->fd = -1; new->fd = -1;
if ((ospf_sock_init(new)) < 0) { if ((ospf_sock_init(new)) < 0) {
if (new->vrf_id != VRF_UNKNOWN) if (new->vrf_id != VRF_UNKNOWN)
flog_err(LIB_ERR_SOCKET, flog_err(
"%s: ospf_sock_init is unable to open a socket", LIB_ERR_SOCKET,
__func__); "%s: ospf_sock_init is unable to open a socket",
__func__);
return new; return new;
} }
thread_add_read(master, ospf_read, new, new->fd, &new->t_read); thread_add_read(master, ospf_read, new, new->fd, &new->t_read);