]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Convert zlog_warn to flog_warn for bgp_packet.c
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 15 Aug 2018 00:49:14 +0000 (20:49 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 6 Sep 2018 20:50:58 +0000 (20:50 +0000)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_errors.c
bgpd/bgp_errors.h
bgpd/bgp_packet.c

index 51048b2af962e8226a5dbdbf349ef6ac99a95311..bf77f748e1c70249f54b0e67b9a81ca5478a80b6 100644 (file)
@@ -97,6 +97,24 @@ static struct log_ref ferr_bgp_warn[] = {
                .description = "BGP has found that the attempted write of MRT data to a dump file has failed",
                .suggestion = "Ensure BGP has permissions to write the specified file",
        },
+       {
+               .code = BGP_WARN_UPDATE_PACKET_SHORT,
+               .title = "BGP Update Packet is to Small",
+               .description = "The update packet received from a peer is to small",
+               .suggestion = "Determine the source of the update packet and examine that peer for what has gone wrong",
+       },
+       {
+               .code = BGP_WARN_UPDATE_PACKET_LONG,
+               .title = "BGP Update Packet is to large",
+               .description = "The update packet received from a peer is to large",
+               .suggestion = "Determine the source of the update packet and examine that peer for what has gone wrong",
+       },
+       {
+               .code = BGP_WARN_UNRECOGNIZED_CAPABILITY,
+               .title = "Unknown BGP Capability Received",
+               .description = "The negotiation of capabilities has received a capability that we do not know what to do with",
+               .suggestion = "Determine the source of the capability and remove the capability from what is sent",
+       },
        {
                .code = END_FERR,
        }
@@ -382,4 +400,5 @@ void bgp_error_init(void)
 {
        log_ref_add(ferr_bgp_warn);
        log_ref_add(ferr_bgp_err);
+       log_ref_add(ferr_bgp_warn);
 }
index 34d1f67f6cbe76947fa3b30344f6fe86444328eb..c02b9bb0ae3e8a74a96be126fbcdd2d37c6a3882 100644 (file)
@@ -84,6 +84,9 @@ enum bgp_log_refs {
        BGP_WARN_ATTRIBUTE_FETCH_ERROR,
        BGP_WARN_ATTRIBUTES_MISMATCH,
        BGP_WARN_DUMP,
+       BGP_WARN_UPDATE_PACKET_SHORT,
+       BGP_WARN_UPDATE_PACKET_LONG,
+       BGP_WARN_UNRECOGNIZED_CAPABILITY,
 };
 
 extern void bgp_error_init(void);
index bb474b9e20918365101f15d0f8f0979757c2a18b..c04116e9eeccfab01c9d968735058db74fb9e6a1 100644 (file)
@@ -1457,10 +1457,9 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
 
        /* Attribute total length check. */
        if (stream_pnt(s) + 2 > end) {
-               zlog_warn(
-                       "%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;
@@ -1471,10 +1470,9 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
 
        /* Attribute length check. */
        if (stream_pnt(s) + attribute_len > end) {
-               zlog_warn(
-                       "%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;
@@ -2104,9 +2102,9 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
                                        return BGP_Stop;
                        }
                } else {
-                       zlog_warn(
-                               "%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);
                }
        }