]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Convert bgp_network.c to use flog_warn
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 16 Aug 2018 00:30:41 +0000 (20:30 -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_network.c

index bf77f748e1c70249f54b0e67b9a81ca5478a80b6..b9f814af2a9490df1c3efa6396559d2559eb2506 100644 (file)
@@ -115,6 +115,18 @@ static struct log_ref ferr_bgp_warn[] = {
                .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 = BGP_WARN_NO_TCP_MD5,
+               .title = "Unable to set TCP MD5 option on socket",
+               .description = "BGP attempted to setup TCP MD5 configuration on the socket as per configuration but was unable to",
+               .suggestion = "Please collect log files and open Issue",
+       },
+       {
+               .code = BGP_WARN_NO_SOCKOPT_MARK,
+               .title = "Unable to set socket MARK option",
+               .description = "BGP attempted to set the SO_MARK option for a socket and was unable to do so",
+               .suggestion = "Please collect log files and open Issue",
+       },
        {
                .code = END_FERR,
        }
index c02b9bb0ae3e8a74a96be126fbcdd2d37c6a3882..c47a600082e95cc3cdb1b16ff1356f8a122b94f0 100644 (file)
@@ -87,6 +87,8 @@ enum bgp_log_refs {
        BGP_WARN_UPDATE_PACKET_SHORT,
        BGP_WARN_UPDATE_PACKET_LONG,
        BGP_WARN_UNRECOGNIZED_CAPABILITY,
+       BGP_WARN_NO_TCP_MD5,
+       BGP_WARN_NO_SOCKOPT_MARK,
 };
 
 extern void bgp_error_init(void);
index 22d5d35c822160389a59636dbeb1be4f373cf56f..96d2e2f2ab7641bd26d002089267aeabacb2d044 100644 (file)
@@ -84,7 +84,8 @@ static int bgp_md5_set_socket(int socket, union sockunion *su,
 #endif /* HAVE_TCP_MD5SIG */
 
        if (ret < 0)
-               zlog_warn("can't set TCP_MD5SIG option on socket %d: %s",
+               flog_warn(BGP_WARN_NO_TCP_MD5,
+                         "can't set TCP_MD5SIG option on socket %d: %s",
                          socket, safe_strerror(en));
 
        return ret;
@@ -561,7 +562,8 @@ int bgp_connect(struct peer *peer)
        sockopt_reuseaddr(peer->fd);
        sockopt_reuseport(peer->fd);
        if (sockopt_mark_default(peer->fd, DATAPLANE_MARK, &bgpd_privs) < 0)
-               zlog_warn("Unable to set mark on FD for peer %s, err=%s",
+               flog_warn(BGP_WARN_NO_SOCKOPT_MARK,
+                         "Unable to set mark on FD for peer %s, err=%s",
                          peer->host, safe_strerror(errno));
 
 #ifdef IPTOS_PREC_INTERNETCONTROL