]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Remove impossible invalid state
authorDonald Sharp <sharpd@nvidia.com>
Tue, 15 Feb 2022 20:54:53 +0000 (15:54 -0500)
committermergify-bot <noreply@mergify.com>
Thu, 17 Feb 2022 16:08:53 +0000 (16:08 +0000)
confederations are checking to see that the bgp pointer
is non-null.  But it's impossible to have a null pointer
in the cli and in all paths we have already deref'ed the bgp
pointer.  Let's remove that error code as that it is impossible
to happen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 8b4a0b6631c9484a8925a7279b7a111c3e340de1)

bgpd/bgpd.c
bgpd/bgpd.h

index e6d4000ad8f632683bb26dd81918a4308a047928..6abd6ef8c49e46331fd5e5cd1ae5f1d2e97b66cd 100644 (file)
@@ -651,9 +651,6 @@ int bgp_confederation_peers_add(struct bgp *bgp, as_t as)
        struct peer *peer;
        struct listnode *node, *nnode;
 
-       if (!bgp)
-               return BGP_ERR_INVALID_BGP;
-
        if (bgp->as == as)
                return BGP_ERR_INVALID_AS;
 
index ae6427b356641f5f8ad3fd4d3fdfb793c46833b0..d102a17dc5572164be65fb4d19002938f480cf8a 100644 (file)
@@ -1921,7 +1921,6 @@ enum bgp_clear_type {
 #define BGP_ERR_INVALID_VALUE                    -1
 #define BGP_ERR_INVALID_FLAG                     -2
 #define BGP_ERR_INVALID_AS                       -3
-#define BGP_ERR_INVALID_BGP                      -4
 #define BGP_ERR_PEER_GROUP_MEMBER                -5
 #define BGP_ERR_PEER_GROUP_NO_REMOTE_AS          -7
 #define BGP_ERR_PEER_GROUP_CANT_CHANGE           -8