*: 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

@ -1639,7 +1639,8 @@ 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(
BGP_WARN_ASPATH_FEWER_HOPS,
"[AS4] Fewer hops in AS_PATH than NEW_AS_PATH"); "[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,

View File

@ -1760,7 +1760,8 @@ 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(
BGP_WARN_DEFUNCT_SNPA_LEN,
"%s sent non-zero value, %u, for defunct SNPA-length field", "%s sent non-zero value, %u, for defunct SNPA-length field",
peer->host, val); peer->host, val);
} }
@ -2378,7 +2379,8 @@ 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(
BGP_WARN_ATTRIBUTE_TOO_SMALL,
"%s: error BGP attribute length %lu is smaller than min len", "%s: error BGP attribute length %lu is smaller than min len",
peer->host, peer->host,
(unsigned long)(endp (unsigned long)(endp
@ -2400,7 +2402,8 @@ 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(
BGP_WARN_EXT_ATTRIBUTE_TOO_SMALL,
"%s: Extended length set, but just %lu bytes of attr header", "%s: Extended length set, but just %lu bytes of attr header",
peer->host, peer->host,
(unsigned long)(endp (unsigned long)(endp
@ -2422,7 +2425,8 @@ 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(
BGP_WARN_ATTRIBUTE_REPEATED,
"%s: error BGP attribute type %d appears twice in a message", "%s: error BGP attribute type %d appears twice in a message",
peer->host, type); peer->host, type);
@ -2440,7 +2444,8 @@ 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(
BGP_WARN_ATTRIBUTE_TOO_LARGE,
"%s: BGP type %d length %d is too large, attribute total length is %d. attr_endp is %p. endp is %p", "%s: BGP type %d length %d is too large, attribute total length is %d. attr_endp is %p. endp is %p",
peer->host, type, length, size, attr_endp, peer->host, type, length, size, attr_endp,
endp); endp);
@ -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,7 +3683,8 @@ 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(
BGP_WARN_EVPN_PMSI_PRESENT,
"%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d", "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d",
peer->bgp->vrf_id, peer->host, peer->bgp->vrf_id, peer->host,
attr->pmsi_tnl_type); attr->pmsi_tnl_type);
@ -5401,7 +5402,8 @@ 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(
BGP_WARN_EVPN_VPN_VNI,
"%u: VNI hash entry for VNI %u not found at DEL", "%u: VNI hash entry for VNI %u not found at DEL",
bgp->vrf_id, vni); bgp->vrf_id, vni);
return 0; return 0;

View File

@ -1457,7 +1457,8 @@ 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(
BGP_WARN_UPDATE_PACKET_SHORT,
"%s [Error] Packet Error (update packet is short for attribute length)", "%s [Error] Packet Error (update packet is short for attribute length)",
peer->host); peer->host);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
@ -1470,7 +1471,8 @@ 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(
BGP_WARN_UPDATE_PACKET_LONG,
"%s [Error] Packet Error (update packet attribute length overflow %d)", "%s [Error] Packet Error (update packet attribute length overflow %d)",
peer->host, attribute_len); peer->host, attribute_len);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
@ -2102,7 +2104,8 @@ 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(
BGP_WARN_UNRECOGNIZED_CAPABILITY,
"%s unrecognized capability code: %d - ignored", "%s unrecognized capability code: %d - ignored",
peer->host, hdr->code); peer->host, hdr->code);
} }

View File

@ -427,7 +427,8 @@ 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(
BGP_WARN_INVALID_NEXTHOP_LENGTH,
"%s: %s: invalid MP nexthop length (AFI IP): %u", "%s: %s: invalid MP nexthop length (AFI IP): %u",
__func__, peer->host, nhlen); __func__, peer->host, nhlen);
stream_free(s); stream_free(s);
@ -532,7 +533,8 @@ 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(
BGP_WARN_INVALID_NEXTHOP_LENGTH,
"%s: %s: invalid MP nexthop length (AFI IP6): %u", "%s: %s: invalid MP nexthop length (AFI IP6): %u",
__func__, peer->host, nhlen); __func__, peer->host, nhlen);
stream_free(s); stream_free(s);

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,7 +933,8 @@ 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(
"Prefix-list %s prefix changed from %s to %s to match length",
name, buf, buf_tmp); 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));
} }
@ -342,7 +340,8 @@ 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(
LIB_ERR_SOCKET,
"can't set sockopt IPV6_UNICAST_HOPS %d to socket %d", "can't set sockopt IPV6_UNICAST_HOPS %d to socket %d",
ttl, sock); ttl, sock);
return -1; return -1;
@ -389,7 +388,8 @@ 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(
LIB_ERR_SOCKET,
"can't set sockopt IP_MINTTL to %d on socket %d: %s", "can't set sockopt IP_MINTTL to %d on socket %d: %s",
minttl, sock, safe_strerror(errno)); minttl, sock, safe_strerror(errno));
return ret; return ret;
@ -400,7 +400,8 @@ 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(
LIB_ERR_SOCKET,
"can't set sockopt IPV6_MINHOPCOUNT to %d on socket %d: %s", "can't set sockopt IPV6_MINHOPCOUNT to %d on socket %d: %s",
minttl, sock, safe_strerror(errno)); minttl, sock, safe_strerror(errno));
return ret; return ret;

View File

@ -249,7 +249,8 @@ 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(
LIB_ERR_ZAPI_SOCKET,
"%s: buffer_flush_available failed on zclient fd %d, closing", "%s: buffer_flush_available failed on zclient fd %d, closing",
__func__, zclient->sock); __func__, zclient->sock);
return zclient_failed(zclient); return zclient_failed(zclient);
@ -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,7 +773,8 @@ 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(
LIB_ERR_ZAPI_ENCODE,
"%s: prefix %s: can't encode %u nexthops (maximum is %u)", "%s: prefix %s: can't encode %u nexthops (maximum is %u)",
__func__, buf, api->nexthop_num, MULTIPATH_NUM); __func__, buf, api->nexthop_num, MULTIPATH_NUM);
return -1; return -1;
@ -884,7 +885,8 @@ 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(
LIB_ERR_ZAPI_ENCODE,
"%s: V4 prefixlen is %d which should not be more than 32", "%s: V4 prefixlen is %d which should not be more than 32",
__PRETTY_FUNCTION__, api->prefix.prefixlen); __PRETTY_FUNCTION__, api->prefix.prefixlen);
return -1; return -1;
@ -892,7 +894,8 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
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(
LIB_ERR_ZAPI_ENCODE,
"%s: v6 prefixlen is %d which should not be more than 128", "%s: v6 prefixlen is %d which should not be more than 128",
__PRETTY_FUNCTION__, api->prefix.prefixlen); __PRETTY_FUNCTION__, api->prefix.prefixlen);
return -1; return -1;
@ -910,7 +913,8 @@ 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(
LIB_ERR_ZAPI_ENCODE,
"%s: SRC Prefix prefixlen received: %d is too large", "%s: SRC Prefix prefixlen received: %d is too large",
__PRETTY_FUNCTION__, api->src_prefix.prefixlen); __PRETTY_FUNCTION__, api->src_prefix.prefixlen);
return -1; return -1;
@ -920,7 +924,8 @@ 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(
LIB_ERR_ZAPI_ENCODE,
"%s: SRC prefix specified in some manner that makes no sense", "%s: SRC prefix specified in some manner that makes no sense",
__PRETTY_FUNCTION__); __PRETTY_FUNCTION__);
return -1; return -1;
@ -972,7 +977,8 @@ 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(
LIB_ERR_ZAPI_ENCODE,
"%s: invalid number of MPLS labels (%u)", "%s: invalid number of MPLS labels (%u)",
__func__, api_nh->label_num); __func__, api_nh->label_num);
return -1; return -1;
@ -1666,7 +1672,8 @@ 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(
LIB_ERR_ZAPI_ENCODE,
"warning: interface %s address %s with peer flag set, but no peer address!", "warning: interface %s address %s with peer flag set, but no peer address!",
ifp->name, ifp->name,
prefix2str(ifc->address, buf, prefix2str(ifc->address, buf,
@ -2407,7 +2414,8 @@ 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(
LIB_ERR_ZAPI_ENCODE,
"%s: message size %u exceeds buffer size %lu, expanding...", "%s: message size %u exceeds buffer size %lu, expanding...",
__func__, length, __func__, length,
(unsigned long)STREAM_SIZE(zclient->ibuf)); (unsigned long)STREAM_SIZE(zclient->ibuf));

View File

@ -153,7 +153,8 @@ 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_WARN_OPAQUE_REGISTRATION,
"ospf_apiserver_init: Failed to register opaque type [0/0]"); "ospf_apiserver_init: Failed to register opaque type [0/0]");
} }

View File

@ -139,8 +139,8 @@ ospf_external_info_add(struct ospf *ospf, uint8_t type, unsigned short instance,
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,7 +1190,8 @@ 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(
OSPF_WARN_EXT_LSA_UNEXPECTED,
"EXT (%s): Refresh instead of Originate", "EXT (%s): Refresh instead of Originate",
__func__); __func__);
UNSET_FLAG(exti->flags, UNSET_FLAG(exti->flags,
@ -1247,7 +1248,8 @@ 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(
OSPF_WARN_EXT_LSA_UNEXPECTED,
"EXT (%s): Refresh instead of Originate", "EXT (%s): Refresh instead of Originate",
__func__); __func__);
UNSET_FLAG(exti->flags, UNSET_FLAG(exti->flags,
@ -1467,7 +1469,8 @@ 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(
OSPF_WARN_EXT_LSA_UNEXPECTED,
"EXT (%s): Flooding is Area scope but area is not yet set", "EXT (%s): Flooding is Area scope but area is not yet set",
__func__); __func__);
if (OspfEXT.area == NULL) { if (OspfEXT.area == NULL) {
@ -1527,7 +1530,8 @@ 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(
OSPF_WARN_EXT_LSA_UNEXPECTED,
"EXT (%s): Flooding is Area scope but area is not yet set", "EXT (%s): Flooding is Area scope but area is not yet set",
__func__); __func__);
if (OspfEXT.area == NULL) { if (OspfEXT.area == NULL) {

View File

@ -51,7 +51,8 @@ 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(
LIB_ERR_SOCKET,
"can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, " "can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
"ifindex %u, AllSPFRouters): %s; perhaps a kernel limit " "ifindex %u, AllSPFRouters): %s; perhaps a kernel limit "
"on # of multicast group memberships has been exceeded?", "on # of multicast group memberships has been exceeded?",
@ -101,7 +102,8 @@ 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(
LIB_ERR_SOCKET,
"can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, " "can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
"ifindex %u, AllDRouters): %s; perhaps a kernel limit " "ifindex %u, AllDRouters): %s; perhaps a kernel limit "
"on # of multicast group memberships has been exceeded?", "on # of multicast group memberships has been exceeded?",

View File

@ -796,7 +796,8 @@ 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(
OSPF_ERR_FSM_INVALID_STATE,
"NSM[%s:%s]: %s (%s): " "NSM[%s:%s]: %s (%s): "
"Warning: action tried to change next_state to %s", "Warning: action tried to change next_state to %s",
IF_NAME(nbr->oi), inet_ntoa(nbr->router_id), IF_NAME(nbr->oi), inet_ntoa(nbr->router_id),

View File

@ -186,7 +186,8 @@ 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_WARN_OPAQUE_REGISTRATION,
"ospf_router_info_init: Failed to register functions"); "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

@ -103,7 +103,8 @@ 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_WARN_OPAQUE_REGISTRATION,
"ospf_mpls_te_init: Failed to register Traffic Engineering functions"); "ospf_mpls_te_init: Failed to register Traffic Engineering functions");
return rc; return rc;
} }
@ -140,7 +141,8 @@ 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_WARN_OPAQUE_REGISTRATION,
"ospf_router_info_init: Failed to register Inter-AS functions"); "ospf_router_info_init: Failed to register Inter-AS functions");
return rc; return rc;
} }
@ -817,7 +819,8 @@ 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(
OSPF_WARN_TE_UNEXPECTED,
"MPLS-TE(is_mandated_params_set) Missing Router Address"); "MPLS-TE(is_mandated_params_set) Missing Router Address");
return rc; return rc;
} }
@ -921,7 +924,8 @@ 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_WARN_TE_UNEXPECTED,
"OSPF MPLS-TE Update: Did not find Link Parameters context for interface %s", "OSPF MPLS-TE Update: Did not find Link Parameters context for interface %s",
ifp->name); ifp->name);
return; return;
@ -965,14 +969,16 @@ 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_WARN_TE_UNEXPECTED,
"ospf_mpls_te_ism_change: Cannot get linkparams from OI(%s)?", "ospf_mpls_te_ism_change: Cannot get linkparams from OI(%s)?",
IF_NAME(oi)); 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_WARN_TE_UNEXPECTED,
"ospf_mpls_te_ism_change: Cannot refer to OSPF from OI(%s)?", "ospf_mpls_te_ism_change: Cannot refer to OSPF from OI(%s)?",
IF_NAME(oi)); IF_NAME(oi));
return; return;
@ -982,7 +988,8 @@ 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(
OSPF_WARN_TE_UNEXPECTED,
"MPLS-TE: Area for OI(%s) has changed to [%s], flush previous LSAs", "MPLS-TE: Area for OI(%s) has changed to [%s], flush previous LSAs",
IF_NAME(oi), IF_NAME(oi),
oi->area ? inet_ntoa(oi->area->area_id) : "N/A"); oi->area ? inet_ntoa(oi->area->area_id) : "N/A");
@ -1216,7 +1223,8 @@ 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_WARN_TE_UNEXPECTED,
"ospf_mpls_te_lsa_originate1: ospf_mpls_te_lsa_new() ?"); "ospf_mpls_te_lsa_originate1: ospf_mpls_te_lsa_new() ?");
return rc; return rc;
} }
@ -1317,7 +1325,8 @@ 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_WARN_LSA_UNEXPECTED,
"ospf_mpls_te_lsa_originate2: ospf_router_info_lsa_new() ?"); "ospf_mpls_te_lsa_originate2: ospf_router_info_lsa_new() ?");
return rc; return rc;
} }
@ -1380,7 +1389,8 @@ 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_WARN_TE_UNEXPECTED,
"ospf_mpls_te_lsa_originate_as: Link(%s) lacks some mandated MPLS-TE parameters.", "ospf_mpls_te_lsa_originate_as: Link(%s) lacks some mandated MPLS-TE parameters.",
lp->ifp ? lp->ifp->name : "?"); lp->ifp ? lp->ifp->name : "?");
continue; continue;
@ -1437,7 +1447,8 @@ 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_WARN_TE_UNEXPECTED,
"ospf_mpls_te_lsa_refresh: lp was disabled: Flush it!"); "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,7 +1533,8 @@ 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(
OSPF_WARN_TE_UNEXPECTED,
"MPLS-TE(ospf_mpls_te_lsa_schedule) Area context is null. Abort !"); "MPLS-TE(ospf_mpls_te_lsa_schedule) Area context is null. Abort !");
return; return;
} }

View File

@ -324,7 +324,8 @@ 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(
LIB_ERR_SOCKET,
"%s: ospf_sock_init is unable to open a socket", "%s: ospf_sock_init is unable to open a socket",
__func__); __func__);
return new; return new;