diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-08-24 18:26:43 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-09-06 22:56:41 +0200 |
commit | ade6974defaa83456b36804a9132d5cad65dc27a (patch) | |
tree | 888d34549383e8f8262081798dcad4f1892eb6d1 /bgpd | |
parent | zebra: flog_warn conversion (diff) | |
download | frr-ade6974defaa83456b36804a9132d5cad65dc27a.tar.xz frr-ade6974defaa83456b36804a9132d5cad65dc27a.zip |
*: style for flog_warn conversions
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_aspath.c | 7 | ||||
-rw-r--r-- | bgpd/bgp_attr.c | 48 | ||||
-rw-r--r-- | bgpd/bgp_evpn.c | 16 | ||||
-rw-r--r-- | bgpd/bgp_packet.c | 21 | ||||
-rw-r--r-- | bgpd/bgp_updgrp_packet.c | 14 |
5 files changed, 60 insertions, 46 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index 55e5b03b1..b156cda86 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -38,7 +38,7 @@ #include "bgpd/bgp_errors.h" /* Attr. Flags and Attr. Type Code. */ -#define AS_HEADER_SIZE 2 +#define AS_HEADER_SIZE 2 /* Now FOUR octets are used for AS value. */ #define AS_VALUE_SIZE sizeof (as_t) @@ -1639,8 +1639,9 @@ struct aspath *aspath_reconcile_as4(struct aspath *aspath, if (hops < 0) { if (BGP_DEBUG(as4, AS4)) - flog_warn(BGP_WARN_ASPATH_FEWER_HOPS, - "[AS4] Fewer hops in AS_PATH than NEW_AS_PATH"); + flog_warn( + 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 * AS4_PATH, * which is daft behaviour - it contains vital loop-detection diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index a993cc71c..062a8a9b4 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -1760,9 +1760,10 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args, { uint8_t val; if ((val = stream_getc(s))) - flog_warn(BGP_WARN_DEFUNCT_SNPA_LEN, - "%s sent non-zero value, %u, for defunct SNPA-length field", - peer->host, val); + flog_warn( + BGP_WARN_DEFUNCT_SNPA_LEN, + "%s sent non-zero value, %u, for defunct SNPA-length field", + peer->host, val); } /* 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.*/ if (endp - BGP_INPUT_PNT(peer) < BGP_ATTR_MIN_LEN) { /* XXX warning: long int format, int arg (arg 5) */ - flog_warn(BGP_WARN_ATTRIBUTE_TOO_SMALL, - "%s: error BGP attribute length %lu is smaller than min len", - peer->host, - (unsigned long)(endp - - stream_pnt(BGP_INPUT(peer)))); + flog_warn( + BGP_WARN_ATTRIBUTE_TOO_SMALL, + "%s: error BGP attribute length %lu is smaller than min len", + peer->host, + (unsigned long)(endp + - stream_pnt(BGP_INPUT(peer)))); bgp_notify_send(peer, BGP_NOTIFY_UPDATE_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 */ if (CHECK_FLAG(flag, BGP_ATTR_FLAG_EXTLEN) && ((endp - startp) < (BGP_ATTR_MIN_LEN + 1))) { - flog_warn(BGP_WARN_EXT_ATTRIBUTE_TOO_SMALL, - "%s: Extended length set, but just %lu bytes of attr header", - peer->host, - (unsigned long)(endp - - stream_pnt(BGP_INPUT(peer)))); + flog_warn( + BGP_WARN_EXT_ATTRIBUTE_TOO_SMALL, + "%s: Extended length set, but just %lu bytes of attr header", + peer->host, + (unsigned long)(endp + - stream_pnt(BGP_INPUT(peer)))); bgp_notify_send(peer, BGP_NOTIFY_UPDATE_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. */ if (CHECK_BITMAP(seen, type)) { - flog_warn(BGP_WARN_ATTRIBUTE_REPEATED, - "%s: error BGP attribute type %d appears twice in a message", - peer->host, type); + flog_warn( + BGP_WARN_ATTRIBUTE_REPEATED, + "%s: error BGP attribute type %d appears twice in a message", + peer->host, type); bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, 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; if (attr_endp > endp) { - 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", - peer->host, type, length, size, attr_endp, - endp); + 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", + peer->host, type, length, size, attr_endp, + endp); /* * RFC 4271 6.3 * 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) { - flog_warn(BGP_WARN_ATTRIBUTE_PARSE_WITHDRAW, + flog_warn( + BGP_WARN_ATTRIBUTE_PARSE_WITHDRAW, "%s: Attribute %s, parse error - treating as withdrawal", peer->host, lookup_msg(attr_str, type, NULL)); if (as4_path) diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 713179ab9..3bd566e07 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -3683,10 +3683,11 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi, if (attr && (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL))) { if (attr->pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL) { - flog_warn(BGP_WARN_EVPN_PMSI_PRESENT, - "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d", - peer->bgp->vrf_id, peer->host, - attr->pmsi_tnl_type); + flog_warn( + BGP_WARN_EVPN_PMSI_PRESENT, + "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d", + 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); if (!vpn) { if (bgp_debug_zebra(NULL)) - flog_warn(BGP_WARN_EVPN_VPN_VNI, - "%u: VNI hash entry for VNI %u not found at DEL", - bgp->vrf_id, vni); + flog_warn( + BGP_WARN_EVPN_VPN_VNI, + "%u: VNI hash entry for VNI %u not found at DEL", + bgp->vrf_id, vni); return 0; } diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index c04116e9e..d8bab6041 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -1457,9 +1457,10 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size) /* Attribute total length check. */ if (stream_pnt(s) + 2 > end) { - flog_warn(BGP_WARN_UPDATE_PACKET_SHORT, - "%s [Error] Packet Error (update packet is short for attribute length)", - peer->host); + flog_warn( + BGP_WARN_UPDATE_PACKET_SHORT, + "%s [Error] Packet Error (update packet is short for attribute length)", + peer->host); bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, BGP_NOTIFY_UPDATE_MAL_ATTR); return BGP_Stop; @@ -1470,9 +1471,10 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size) /* Attribute length check. */ if (stream_pnt(s) + attribute_len > end) { - flog_warn(BGP_WARN_UPDATE_PACKET_LONG, - "%s [Error] Packet Error (update packet attribute length overflow %d)", - peer->host, attribute_len); + flog_warn( + BGP_WARN_UPDATE_PACKET_LONG, + "%s [Error] Packet Error (update packet attribute length overflow %d)", + peer->host, attribute_len); bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, BGP_NOTIFY_UPDATE_MAL_ATTR); return BGP_Stop; @@ -2102,9 +2104,10 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt, return BGP_Stop; } } else { - flog_warn(BGP_WARN_UNRECOGNIZED_CAPABILITY, - "%s unrecognized capability code: %d - ignored", - peer->host, hdr->code); + flog_warn( + BGP_WARN_UNRECOGNIZED_CAPABILITY, + "%s unrecognized capability code: %d - ignored", + peer->host, hdr->code); } } diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index cba3b0703..f3047369b 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -427,9 +427,10 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt, break; default: /* TODO: handle IPv6 nexthops */ - flog_warn(BGP_WARN_INVALID_NEXTHOP_LENGTH, - "%s: %s: invalid MP nexthop length (AFI IP): %u", - __func__, peer->host, nhlen); + flog_warn( + BGP_WARN_INVALID_NEXTHOP_LENGTH, + "%s: %s: invalid MP nexthop length (AFI IP): %u", + __func__, peer->host, nhlen); stream_free(s); return NULL; } @@ -532,9 +533,10 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt, break; default: /* TODO: handle IPv4 nexthops */ - flog_warn(BGP_WARN_INVALID_NEXTHOP_LENGTH, - "%s: %s: invalid MP nexthop length (AFI IP6): %u", - __func__, peer->host, nhlen); + flog_warn( + BGP_WARN_INVALID_NEXTHOP_LENGTH, + "%s: %s: invalid MP nexthop length (AFI IP6): %u", + __func__, peer->host, nhlen); stream_free(s); return NULL; } |