]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_io.c
Merge pull request #3717 from qlyoung/fix-systemd-deps-6.0.3
[mirror_frr.git] / bgpd / bgp_io.c
index 69c92e829c59ce6174a792ee08df89470cd6e6b6..311f98001d2242384453a3aab76831d525e5e0d5 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "bgpd/bgp_io.h"
 #include "bgpd/bgp_debug.h"    // for bgp_debug_neighbor_events, bgp_type_str
+#include "bgpd/bgp_errors.h"   // for expanded error reference information
 #include "bgpd/bgp_fsm.h"      // for BGP_EVENT_ADD, bgp_event
 #include "bgpd/bgp_packet.h"   // for bgp_notify_send_with_data, bgp_notify...
 #include "bgpd/bgpd.h"         // for peer, BGP_MARKER_SIZE, bgp_master, bm
@@ -174,7 +175,6 @@ static int bgp_process_reads(struct thread *thread)
        bool more = true;               // whether we got more data
        bool fatal = false;             // whether fatal error occurred
        bool added_pkt = false;         // whether we pushed onto ->ibuf
-       bool header_valid = true;       // whether header is valid
        /* clang-format on */
 
        peer = THREAD_ARG(thread);
@@ -214,10 +214,8 @@ static int bgp_process_reads(struct thread *thread)
                if (ringbuf_remain(ibw) < BGP_HEADER_SIZE)
                        break;
 
-               /* validate header */
-               header_valid = validate_header(peer);
-
-               if (!header_valid) {
+               /* check that header is valid */
+               if (!validate_header(peer)) {
                        fatal = true;
                        break;
                }
@@ -404,8 +402,9 @@ static uint16_t bgp_read(struct peer *peer)
                SET_FLAG(status, BGP_IO_TRANS_ERR);
                /* Fatal error; tear down session */
        } else if (nbytes < 0) {
-               zlog_err("%s [Error] bgp_read_packet error: %s", peer->host,
-                        safe_strerror(errno));
+               flog_err(BGP_ERR_UPDATE_RCV,
+                         "%s [Error] bgp_read_packet error: %s", peer->host,
+                         safe_strerror(errno));
 
                if (peer->status == Established) {
                        if (CHECK_FLAG(peer->sflags, PEER_STATUS_NSF_MODE)) {