]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #2643 from qlyoung/doc-workflow-reviews
authorRenato Westphal <renato@openbsd.org>
Tue, 10 Jul 2018 13:47:43 +0000 (10:47 -0300)
committerGitHub <noreply@github.com>
Tue, 10 Jul 2018 13:47:43 +0000 (10:47 -0300)
doc: add dev docs on code review practices

37 files changed:
bgpd/IMPLEMENTATION.txt
bgpd/bgp_clist.c
bgpd/bgp_ecommunity.c
bgpd/bgp_evpn.c
bgpd/bgp_flowspec.c
bgpd/bgp_lcommunity.c
bgpd/bgp_nexthop.c
bgpd/bgp_open.h
bgpd/bgp_pbr.c
bgpd/bgp_pbr.h
bgpd/bgp_route.c
bgpd/bgp_rpki.c
bgpd/bgp_vnc_types.h
bgpd/bgp_vty.c
bgpd/bgp_zebra.c
bgpd/bgpd.c
bgpd/bgpd.h
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi_rib.c
bgpd/rfapi/vnc_export_bgp.c
bgpd/rfapi/vnc_import_bgp.c
pimd/pim_br.c
pimd/pim_iface.c
pimd/pim_ifchannel.c
pimd/pim_igmp.c
pimd/pim_igmpv3.c
pimd/pim_instance.c
pimd/pim_jp_agg.c
pimd/pim_msdp.c
pimd/pim_neighbor.c
pimd/pim_nht.c
pimd/pim_oil.c
pimd/pim_rp.c
pimd/pim_ssmpingd.c
pimd/pim_static.c
pimd/pim_tlv.c
pimd/pim_upstream.c

index fff360ab96934d23b927c0f8b7cbf9529edd8fb0..0f063596867158c2efe5f609be6adf5633271806 100644 (file)
@@ -131,7 +131,6 @@ bgpd.h
   struct peer_group
   struct bgp_notify: (in-core representation of wire format?)
   struct bgp_nexthop: (v4 and v6 addresses, *ifp)
-  struct bgp_rd: router distinguisher: 8 octects
   struct bgp_filter: distribute, prefix, aslist, route_maps
   struct peer: neighbor structure (very rich/complex)
   struct bgp_nlri: reference to wire format
index 0ffbe174ed9d609579c4201684cc55cf53ada050..b2f34dd968b8851bfda67cc986fdcd4076732085 100644 (file)
@@ -274,8 +274,7 @@ static void community_list_entry_add(struct community_list *list,
 
 /* Delete community-list entry from the list.  */
 static void community_list_entry_delete(struct community_list *list,
-                                       struct community_entry *entry,
-                                       int style)
+                                       struct community_entry *entry)
 {
        if (entry->next)
                entry->next->prev = entry->prev;
@@ -882,7 +881,7 @@ int community_list_unset(struct community_list_handler *ch, const char *name,
        if (!entry)
                return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
 
-       community_list_entry_delete(list, entry, style);
+       community_list_entry_delete(list, entry);
        route_map_notify_dependencies(name, RMAP_EVENT_CLIST_DELETED);
 
        return 0;
@@ -1040,7 +1039,7 @@ int lcommunity_list_unset(struct community_list_handler *ch, const char *name,
        if (!entry)
                return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
 
-       community_list_entry_delete(list, entry, style);
+       community_list_entry_delete(list, entry);
 
        return 0;
 }
@@ -1057,8 +1056,6 @@ int extcommunity_list_set(struct community_list_handler *ch, const char *name,
        if (str == NULL)
                return COMMUNITY_LIST_ERR_MALFORMED_VAL;
 
-       entry = NULL;
-
        /* Get community list. */
        list = community_list_get(ch, name, EXTCOMMUNITY_LIST_MASTER);
 
@@ -1149,7 +1146,7 @@ int extcommunity_list_unset(struct community_list_handler *ch, const char *name,
        if (!entry)
                return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
 
-       community_list_entry_delete(list, entry, style);
+       community_list_entry_delete(list, entry);
        route_map_notify_dependencies(name, RMAP_EVENT_ECLIST_DELETED);
 
        return 0;
index 8c5356c99804040af5bf71cd83fd65a73e512c76..2c372124d2935b51f2bdd5e926f278eec4ab51c0 100644 (file)
@@ -65,7 +65,6 @@ void ecommunity_free(struct ecommunity **ecom)
        if ((*ecom)->str)
                XFREE(MTYPE_ECOMMUNITY_STR, (*ecom)->str);
        XFREE(MTYPE_ECOMMUNITY, *ecom);
-       ecom = NULL;
 }
 
 static void ecommunity_hash_free(struct ecommunity *ecom)
index e2cf094cc15cf7d3351a0b594a90eea5ab987c81..a026df59a06f717fb0cf05e630c1439d491f62e8 100644 (file)
@@ -4639,7 +4639,6 @@ int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
        int addpath_encoded;
        int psize = 0;
        uint8_t rtype;
-       uint8_t rlen;
        struct prefix p;
 
        /* Start processing the NLRI - there may be multiple in the MP_REACH */
@@ -4673,7 +4672,7 @@ int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
                        return -1;
 
                rtype = *pnt++;
-               psize = rlen = *pnt++;
+               psize = *pnt++;
 
                /* When packet overflow occur return immediately. */
                if (pnt + psize > lim)
index 9b998d4497f9031c81362ff3acdb98ffab103bf6..2d336fa6d8ceb0d9f16f3ce34c330270c2d56d38 100644 (file)
@@ -91,7 +91,6 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
        afi_t afi;
        safi_t safi;
        int psize = 0;
-       uint8_t rlen;
        struct prefix p;
        int ret;
        void *temp;
@@ -121,7 +120,7 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
                if (pnt + 1 > lim)
                        return -1;
 
-               psize = rlen = *pnt++;
+               psize = *pnt++;
 
                /* When packet overflow occur return immediately. */
                if (pnt + psize > lim) {
index 33f4d139b8271027baecad6b7355a119f578024b..3e160bc56ed95b55d65dbe113400c810dcc04c61 100644 (file)
@@ -50,7 +50,6 @@ void lcommunity_free(struct lcommunity **lcom)
        if ((*lcom)->str)
                XFREE(MTYPE_LCOMMUNITY_STR, (*lcom)->str);
        XFREE(MTYPE_LCOMMUNITY, *lcom);
-       lcom = NULL;
 }
 
 static void lcommunity_hash_free(struct lcommunity *lcom)
index 32011d210ba29f02e3806e7ec9ddd3c5e3da7f9a..76bfa73feeb143f559e25f4eac79aff61c3be40a 100644 (file)
@@ -447,8 +447,6 @@ int bgp_subgrp_multiaccess_check_v4(struct in_addr nexthop,
        p.family = AF_INET;
        p.prefixlen = IPV4_MAX_BITLEN;
 
-       rn2 = NULL;
-
        bgp = SUBGRP_INST(subgrp);
        rn1 = bgp_node_match(bgp->connected_table[AFI_IP], &np);
        if (!rn1)
index c92fd9b0a72737953fd0ba10d8162dc5a7ee2aa6..42ebe97f2e64b780954f8ce86f9e4bc43035f596 100644 (file)
@@ -34,21 +34,12 @@ struct capability_mp_data {
        uint8_t safi; /* iana_safi_t */
 };
 
-struct capability_as4 {
-       uint32_t as4;
-};
-
 struct graceful_restart_af {
        afi_t afi;
        safi_t safi;
        uint8_t flag;
 };
 
-struct capability_gr {
-       uint16_t restart_flag_time;
-       struct graceful_restart_af gr[];
-};
-
 /* Capability Code */
 #define CAPABILITY_CODE_MP              1 /* Multiprotocol Extensions */
 #define CAPABILITY_CODE_REFRESH         2 /* Route Refresh Capability */
index 45ec21631c0f2fcb6113ed1f273b52b4d4b614ef..b5ddfd4b2112a9eadc9da3937e8f6271469bcd9d 100644 (file)
@@ -348,7 +348,7 @@ static bool bgp_pbr_extract_enumerate(struct bgp_pbr_match_val list[],
                                      void *valmask, uint8_t type_entry)
 {
        bool ret;
-       uint8_t unary_operator_val = unary_operator;
+       uint8_t unary_operator_val;
        bool double_check = false;
 
        if ((unary_operator & OPERATOR_UNARY_OR) &&
index 307a34e34f4c02749f49604601b0cc90b9151532..e853784afda6974a27601af4da266318f60c4df2 100644 (file)
@@ -57,17 +57,13 @@ struct bgp_pbr_match_val {
        uint16_t value;
        uint8_t compare_operator;
        uint8_t unary_operator;
-} bgp_pbr_value_t;
+};
 
 #define FRAGMENT_DONT  1
 #define FRAGMENT_IS    2
 #define FRAGMENT_FIRST 4
 #define FRAGMENT_LAST  8
 
-struct bgp_pbr_fragment_val {
-       uint8_t bitmask;
-};
-
 struct bgp_pbr_entry_action {
        /* used to store enum bgp_pbr_action_enum enumerate */
        uint8_t action;
index 5f3a9ab673c6c75cd6f4cbce643eef48afdd3213..795bd15613a0c41376c2b291f5903d33f2948331 100644 (file)
@@ -2673,14 +2673,12 @@ static void bgp_rib_withdraw(struct bgp_node *rn, struct bgp_info *ri,
                             struct peer *peer, afi_t afi, safi_t safi,
                             struct prefix_rd *prd)
 {
-       int status = BGP_DAMP_NONE;
-
        /* apply dampening, if result is suppressed, we'll be retaining
         * the bgp_info in the RIB for historical reference.
         */
        if (CHECK_FLAG(peer->bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)
            && peer->sort == BGP_PEER_EBGP)
-               if ((status = bgp_damp_withdraw(ri, rn, afi, safi, 0))
+               if ((bgp_damp_withdraw(ri, rn, afi, safi, 0))
                    == BGP_DAMP_SUPPRESSED) {
                        bgp_aggregate_decrement(peer->bgp, &rn->p, ri, afi,
                                                safi);
index db182eef986846070693526a3009364dcc75fc6a..317d451b6ddf0544d66eca141f45e6454da37914 100644 (file)
@@ -864,7 +864,7 @@ DEFPY (rpki_cache,
        "Preference of the cache server\n"
        "Preference value\n")
 {
-       int return_value = SUCCESS;
+       int return_value;
 
        // use ssh connection
        if (ssh_uname) {
@@ -873,6 +873,7 @@ DEFPY (rpki_cache,
                        add_ssh_cache(cache, sshport, ssh_uname, ssh_privkey,
                                      ssh_pubkey, server_pubkey, preference);
 #else
+               return_value = SUCCESS;
                vty_out(vty,
                        "ssh sockets are not supported. "
                        "Please recompile rtrlib and frr with ssh support. "
index 70f5646e9473ffe0eade5763bbd91f18223459e0..f4202ff75e9f1728c69a6f354031d8e182d50128 100644 (file)
@@ -25,16 +25,5 @@ typedef enum {
        BGP_VNC_SUBTLV_TYPE_RFPOPTION = 2, /* deprecated */
 } bgp_vnc_subtlv_types;
 
-/*
- * VNC Attribute subtlvs
- */
-struct bgp_vnc_subtlv_lifetime {
-       uint32_t lifetime;
-};
-
-struct bgp_vnc_subtlv_unaddr {
-       struct prefix un_address; /* IPv4 or IPv6; pfx length ignored */
-};
-
 #endif /* ENABLE_BGP_VNC */
 #endif /* _QUAGGA_BGP_VNC_TYPES_H */
index 86f3f97c4934f7eb04197e50eea2c9d6baa2c5a8..641628d4b73ed3a24e9f2de9a3a4726b625dd0ea 100644 (file)
@@ -3372,8 +3372,6 @@ DEFUN (neighbor_set_peer_group,
        struct peer *peer;
        struct peer_group *group;
 
-       peer = NULL;
-
        ret = str2sockunion(argv[idx_peer]->arg, &su);
        if (ret < 0) {
                peer = peer_lookup_by_conf_if(bgp, argv[idx_peer]->arg);
index df3f9ddd6fd51c2b207b2b177ea79e01a9406406..714f6791c14c2bed7ee435395817b42ef73900d5 100644 (file)
@@ -1190,7 +1190,7 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
        mpls_label_t label;
        int nh_othervrf = 0;
        char buf_prefix[PREFIX_STRLEN]; /* filled in if we are debugging */
-       bool is_evpn = false;
+       bool is_evpn;
        int nh_updated;
 
        /* Don't try to install if we're not connected to Zebra or Zebra doesn't
index ed4879146eae5d92cf27d6f7014ea492878c895c..e5b269eb70c27e1f5968aaff4b88df558f8b0129 100644 (file)
@@ -888,129 +888,6 @@ static bool peergroup_filter_check(struct peer *peer, afi_t afi, safi_t safi,
        }
 }
 
-/* Reset all address family specific configuration.  */
-static void peer_af_flag_reset(struct peer *peer, afi_t afi, safi_t safi)
-{
-       int i;
-       struct bgp_filter *filter;
-       char orf_name[BUFSIZ];
-
-       filter = &peer->filter[afi][safi];
-
-       /* Clear neighbor filter and route-map */
-       for (i = FILTER_IN; i < FILTER_MAX; i++) {
-               if (filter->dlist[i].name) {
-                       XFREE(MTYPE_BGP_FILTER_NAME, filter->dlist[i].name);
-                       filter->dlist[i].name = NULL;
-               }
-               if (filter->plist[i].name) {
-                       XFREE(MTYPE_BGP_FILTER_NAME, filter->plist[i].name);
-                       filter->plist[i].name = NULL;
-               }
-               if (filter->aslist[i].name) {
-                       XFREE(MTYPE_BGP_FILTER_NAME, filter->aslist[i].name);
-                       filter->aslist[i].name = NULL;
-               }
-       }
-       for (i = RMAP_IN; i < RMAP_MAX; i++) {
-               if (filter->map[i].name) {
-                       XFREE(MTYPE_BGP_FILTER_NAME, filter->map[i].name);
-                       filter->map[i].name = NULL;
-               }
-       }
-
-       /* Clear unsuppress map.  */
-       if (filter->usmap.name)
-               XFREE(MTYPE_BGP_FILTER_NAME, filter->usmap.name);
-       filter->usmap.name = NULL;
-       filter->usmap.map = NULL;
-
-       /* Clear neighbor's all address family flags.  */
-       peer->af_flags[afi][safi] = 0;
-
-       /* Clear neighbor's all address family sflags. */
-       peer->af_sflags[afi][safi] = 0;
-
-       /* Clear neighbor's all address family capabilities. */
-       peer->af_cap[afi][safi] = 0;
-
-       /* Clear ORF info */
-       peer->orf_plist[afi][safi] = NULL;
-       sprintf(orf_name, "%s.%d.%d", peer->host, afi, safi);
-       prefix_bgp_orf_remove_all(afi, orf_name);
-
-       /* Set default neighbor send-community.  */
-       if (!bgp_option_check(BGP_OPT_CONFIG_CISCO)) {
-               SET_FLAG(peer->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY);
-               SET_FLAG(peer->af_flags[afi][safi],
-                        PEER_FLAG_SEND_EXT_COMMUNITY);
-               SET_FLAG(peer->af_flags[afi][safi],
-                        PEER_FLAG_SEND_LARGE_COMMUNITY);
-
-               SET_FLAG(peer->af_flags_invert[afi][safi],
-                        PEER_FLAG_SEND_COMMUNITY);
-               SET_FLAG(peer->af_flags_invert[afi][safi],
-                        PEER_FLAG_SEND_EXT_COMMUNITY);
-               SET_FLAG(peer->af_flags_invert[afi][safi],
-                        PEER_FLAG_SEND_LARGE_COMMUNITY);
-       }
-
-       /* Clear neighbor default_originate_rmap */
-       if (peer->default_rmap[afi][safi].name)
-               XFREE(MTYPE_ROUTE_MAP_NAME, peer->default_rmap[afi][safi].name);
-       peer->default_rmap[afi][safi].name = NULL;
-       peer->default_rmap[afi][safi].map = NULL;
-
-       /* Clear neighbor maximum-prefix */
-       peer->pmax[afi][safi] = 0;
-       peer->pmax_threshold[afi][safi] = MAXIMUM_PREFIX_THRESHOLD_DEFAULT;
-}
-
-/* peer global config reset */
-static void peer_global_config_reset(struct peer *peer)
-{
-       int saved_flags = 0;
-
-       peer->change_local_as = 0;
-       peer->ttl = (peer_sort(peer) == BGP_PEER_IBGP ? MAXTTL : 1);
-       if (peer->update_source) {
-               sockunion_free(peer->update_source);
-               peer->update_source = NULL;
-       }
-       if (peer->update_if) {
-               XFREE(MTYPE_PEER_UPDATE_SOURCE, peer->update_if);
-               peer->update_if = NULL;
-       }
-
-       if (peer_sort(peer) == BGP_PEER_IBGP)
-               peer->v_routeadv = BGP_DEFAULT_IBGP_ROUTEADV;
-       else
-               peer->v_routeadv = BGP_DEFAULT_EBGP_ROUTEADV;
-
-       /* These are per-peer specific flags and so we must preserve them */
-       saved_flags |= CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY);
-       saved_flags |= CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN);
-       peer->flags = 0;
-       SET_FLAG(peer->flags, saved_flags);
-
-       peer->holdtime = 0;
-       peer->keepalive = 0;
-       peer->connect = 0;
-       peer->v_connect = BGP_DEFAULT_CONNECT_RETRY;
-
-       /* Reset some other configs back to defaults. */
-       peer->v_start = BGP_INIT_START_TIMER;
-       peer->password = NULL;
-       peer->local_id = peer->bgp->router_id;
-       peer->v_holdtime = peer->bgp->default_holdtime;
-       peer->v_keepalive = peer->bgp->default_keepalive;
-
-       bfd_info_free(&(peer->bfd_info));
-
-       /* Set back the CONFIG_NODE flag. */
-       SET_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE);
-}
-
 /* Check peer's AS number and determines if this peer is IBGP or EBGP */
 static inline bgp_peer_sort_t peer_calc_sort(struct peer *peer)
 {
@@ -2821,61 +2698,6 @@ int peer_group_bind(struct bgp *bgp, union sockunion *su, struct peer *peer,
        return 0;
 }
 
-int peer_group_unbind(struct bgp *bgp, struct peer *peer,
-                     struct peer_group *group)
-{
-       struct peer *other;
-       afi_t afi;
-       safi_t safi;
-
-       if (group != peer->group)
-               return BGP_ERR_PEER_GROUP_MISMATCH;
-
-       FOREACH_AFI_SAFI (afi, safi) {
-               if (peer->afc[afi][safi]) {
-                       peer->afc[afi][safi] = 0;
-                       peer_af_flag_reset(peer, afi, safi);
-
-                       if (peer_af_delete(peer, afi, safi) != 0) {
-                               zlog_err(
-                                       "couldn't delete af structure for peer %s",
-                                       peer->host);
-                       }
-               }
-       }
-
-       assert(listnode_lookup(group->peer, peer));
-       peer_unlock(peer); /* peer group list reference */
-       listnode_delete(group->peer, peer);
-       peer->group = NULL;
-       other = peer->doppelganger;
-
-       if (group->conf->as) {
-               peer_delete(peer);
-               if (other && other->status != Deleted) {
-                       if (other->group) {
-                               peer_unlock(other);
-                               listnode_delete(group->peer, other);
-                       }
-                       other->group = NULL;
-                       peer_delete(other);
-               }
-               return 0;
-       }
-
-       bgp_bfd_deregister_peer(peer);
-       peer_global_config_reset(peer);
-
-       if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status)) {
-               peer->last_reset = PEER_DOWN_RMAP_UNBIND;
-               bgp_notify_send(peer, BGP_NOTIFY_CEASE,
-                               BGP_NOTIFY_CEASE_CONFIG_CHANGE);
-       } else
-               bgp_session_reset(peer);
-
-       return 0;
-}
-
 static int bgp_startup_timer_expire(struct thread *thread)
 {
        struct bgp *bgp;
@@ -3825,9 +3647,6 @@ struct peer_flag_action {
 
        /* Action when the flag is changed.  */
        enum peer_change_type type;
-
-       /* Peer down cause */
-       uint8_t peer_down;
 };
 
 static const struct peer_flag_action peer_flag_action_list[] = {
@@ -7920,8 +7739,6 @@ static void bgp_if_finish(struct bgp *bgp)
        }
 }
 
-extern void bgp_snmp_init(void);
-
 static void bgp_viewvrf_autocomplete(vector comps, struct cmd_token *token)
 {
        struct vrf *vrf = NULL;
index 1fbc0a0db9fe0e8c04ad5b5dac5e0a09c7decc3f..06eb86da95559f7c679b930405aef52d1a8b3106 100644 (file)
@@ -590,13 +590,7 @@ struct bgp_nexthop {
 
 #define BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE 1
 
-/* BGP router distinguisher value.  */
-#define BGP_RD_SIZE                8
-
-struct bgp_rd {
-       uint8_t val[BGP_RD_SIZE];
-};
-
+/* Route map direction */
 #define RMAP_IN  0
 #define RMAP_OUT 1
 #define RMAP_MAX 2
@@ -1590,7 +1584,6 @@ extern int peer_afc_set(struct peer *, afi_t, safi_t, int);
 
 extern int peer_group_bind(struct bgp *, union sockunion *, struct peer *,
                           struct peer_group *, as_t *);
-extern int peer_group_unbind(struct bgp *, struct peer *, struct peer_group *);
 
 extern int peer_flag_set(struct peer *, uint32_t);
 extern int peer_flag_unset(struct peer *, uint32_t);
index 04531433ac2bc86732613e837c4d4d0490ed7c5f..a1f1169a7abf751924d06703fde838a4b95ef94f 100644 (file)
@@ -3197,8 +3197,8 @@ DEFUN (debug_rfapi_register_vn_un_l2o,
        memset(optary, 0, sizeof(optary));
        optary[opt_next].v.l2addr.logical_net_id =
                strtoul(argv[14]->arg, NULL, 10);
-       if ((rc = rfapiStr2EthAddr(argv[12]->arg,
-                                  &optary[opt_next].v.l2addr.macaddr))) {
+       if (rfapiStr2EthAddr(argv[12]->arg,
+                            &optary[opt_next].v.l2addr.macaddr)) {
                vty_out(vty, "Bad mac address \"%s\"\n", argv[12]->arg);
                return CMD_WARNING_CONFIG_FAILED;
        }
index c71f59563fa830d8a1911921f18d9784f60b57e5..60534fece0b9d43e843092f27ea3030df74ed173 100644 (file)
@@ -2099,7 +2099,6 @@ rfapiRibPreload(struct bgp *bgp, struct rfapi_descriptor *rfd,
                        nhp->vn_options = NULL;
 
                        XFREE(MTYPE_RFAPI_NEXTHOP, nhp);
-                       nhp = NULL;
                }
        }
 
index ae31c3fe9e6b7b47455cf6c82c1b758f99262862..d4dd34d1dd89dfb5dc98b11c023ff9273b346517 100644 (file)
@@ -402,7 +402,6 @@ void vnc_direct_bgp_del_route_ce(struct bgp *bgp, struct route_node *rn,
 
 static void vnc_direct_bgp_vpn_enable_ce(struct bgp *bgp, afi_t afi)
 {
-       struct rfapi_cfg *hc;
        struct route_node *rn;
        struct bgp_info *ri;
 
@@ -411,7 +410,7 @@ static void vnc_direct_bgp_vpn_enable_ce(struct bgp *bgp, afi_t afi)
        if (!bgp)
                return;
 
-       if (!(hc = bgp->rfapi_cfg))
+       if (!(bgp->rfapi_cfg))
                return;
 
        if (!VNC_EXPORT_BGP_CE_ENABLED(bgp->rfapi_cfg)) {
index 7182e952b5f49df78af3387fc4133f851d04af93..156572b57fefaf10b6c40797d5dbeeeac3c87659 100644 (file)
@@ -557,7 +557,6 @@ static void vnc_import_bgp_add_route_mode_resolve_nve(
        struct bgp_info *info)                  /* unicast info */
 {
        afi_t afi = family2afi(prefix->family);
-       struct rfapi_cfg *hc = NULL;
 
        struct prefix pfx_unicast_nexthop = {0}; /* happy valgrind */
 
@@ -607,7 +606,7 @@ static void vnc_import_bgp_add_route_mode_resolve_nve(
                return;
        }
 
-       if (!(hc = bgp->rfapi_cfg)) {
+       if (!(bgp->rfapi_cfg)) {
                vnc_zlog_debug_verbose("%s: bgp->rfapi_cfg is NULL, skipping",
                                       __func__);
                return;
@@ -698,7 +697,7 @@ static void vnc_import_bgp_add_route_mode_plain(struct bgp *bgp,
        struct peer *peer = info->peer;
        struct attr *attr = info->attr;
        struct attr hattr;
-       struct rfapi_cfg *hc = NULL;
+       struct rfapi_cfg *hc = bgp->rfapi_cfg;
        struct attr *iattr = NULL;
 
        struct rfapi_ip_addr vnaddr;
@@ -723,7 +722,7 @@ static void vnc_import_bgp_add_route_mode_plain(struct bgp *bgp,
                return;
        }
 
-       if (!(hc = bgp->rfapi_cfg)) {
+       if (!hc) {
                vnc_zlog_debug_verbose("%s: bgp->rfapi_cfg is NULL, skipping",
                                       __func__);
                return;
@@ -886,7 +885,6 @@ vnc_import_bgp_add_route_mode_nvegroup(struct bgp *bgp, struct prefix *prefix,
        struct peer *peer = info->peer;
        struct attr *attr = info->attr;
        struct attr hattr;
-       struct rfapi_cfg *hc = NULL;
        struct attr *iattr = NULL;
 
        struct rfapi_ip_addr vnaddr;
@@ -911,7 +909,7 @@ vnc_import_bgp_add_route_mode_nvegroup(struct bgp *bgp, struct prefix *prefix,
                return;
        }
 
-       if (!(hc = bgp->rfapi_cfg)) {
+       if (!(bgp->rfapi_cfg)) {
                vnc_zlog_debug_verbose("%s: bgp->rfapi_cfg is NULL, skipping",
                                       __func__);
                return;
index f297b0591db7fb3230ef8da086238b07c30e5591..6184ea12c416706a7b6339d8e21c0212ba525a10 100644 (file)
@@ -64,10 +64,6 @@ void pim_br_set_pmbr(struct prefix_sg *sg, struct in_addr br)
 
        if (!pim_br) {
                pim_br = XCALLOC(MTYPE_PIM_BR, sizeof(*pim_br));
-               if (!pim_br) {
-                       zlog_err("PIM XCALLOC(%zu) failure", sizeof(*pim_br));
-                       return;
-               }
 
                pim_br->sg = *sg;
 
@@ -100,9 +96,4 @@ void pim_br_clear_pmbr(struct prefix_sg *sg)
 void pim_br_init(void)
 {
        pim_br_list = list_new();
-       if (!pim_br_list) {
-               zlog_err("%s: Failure to create pim_br_list",
-                        __PRETTY_FUNCTION__);
-               return;
-       }
 }
index 5c4d99ad4d0099e032d4eeb1f2556a0849dbcdcd..e075ff5ac29cbf1abf5d3296da624fb8f003eea6 100644 (file)
@@ -75,36 +75,6 @@ void pim_if_terminate(struct pim_instance *pim)
        return;
 }
 
-static void *if_list_clean(struct pim_interface *pim_ifp)
-{
-       struct pim_ifchannel *ch;
-
-       if (pim_ifp->igmp_join_list)
-               list_delete_and_null(&pim_ifp->igmp_join_list);
-
-       if (pim_ifp->igmp_socket_list)
-               list_delete_and_null(&pim_ifp->igmp_socket_list);
-
-       if (pim_ifp->pim_neighbor_list)
-               list_delete_and_null(&pim_ifp->pim_neighbor_list);
-
-       if (pim_ifp->upstream_switch_list)
-               list_delete_and_null(&pim_ifp->upstream_switch_list);
-
-       if (pim_ifp->sec_addr_list)
-               list_delete_and_null(&pim_ifp->sec_addr_list);
-
-       while (!RB_EMPTY(pim_ifchannel_rb, &pim_ifp->ifchannel_rb)) {
-               ch = RB_ROOT(pim_ifchannel_rb, &pim_ifp->ifchannel_rb);
-
-               pim_ifchannel_delete(ch);
-       }
-
-       XFREE(MTYPE_PIM_INTERFACE, pim_ifp);
-
-       return 0;
-}
-
 static void pim_sec_addr_free(struct pim_secondary_addr *sec_addr)
 {
        XFREE(MTYPE_PIM_SEC_ADDR, sec_addr);
@@ -145,10 +115,6 @@ struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim)
        zassert(!ifp->info);
 
        pim_ifp = XCALLOC(MTYPE_PIM_INTERFACE, sizeof(*pim_ifp));
-       if (!pim_ifp) {
-               zlog_err("PIM XCALLOC(%zu) failure", sizeof(*pim_ifp));
-               return 0;
-       }
 
        pim_ifp->options = 0;
        pim_ifp->pim = pim_get_pim_instance(ifp->vrf_id);
@@ -186,38 +152,18 @@ struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim)
 
        /* list of struct igmp_sock */
        pim_ifp->igmp_socket_list = list_new();
-       if (!pim_ifp->igmp_socket_list) {
-               zlog_err("%s: failure: igmp_socket_list=list_new()",
-                        __PRETTY_FUNCTION__);
-               return if_list_clean(pim_ifp);
-       }
        pim_ifp->igmp_socket_list->del = (void (*)(void *))igmp_sock_free;
 
        /* list of struct pim_neighbor */
        pim_ifp->pim_neighbor_list = list_new();
-       if (!pim_ifp->pim_neighbor_list) {
-               zlog_err("%s: failure: pim_neighbor_list=list_new()",
-                        __PRETTY_FUNCTION__);
-               return if_list_clean(pim_ifp);
-       }
        pim_ifp->pim_neighbor_list->del = (void (*)(void *))pim_neighbor_free;
 
        pim_ifp->upstream_switch_list = list_new();
-       if (!pim_ifp->upstream_switch_list) {
-               zlog_err("%s: failure: upstream_switch_list=list_new()",
-                        __PRETTY_FUNCTION__);
-               return if_list_clean(pim_ifp);
-       }
        pim_ifp->upstream_switch_list->del =
                (void (*)(void *))pim_jp_agg_group_list_free;
        pim_ifp->upstream_switch_list->cmp = pim_jp_agg_group_list_cmp;
 
        pim_ifp->sec_addr_list = list_new();
-       if (!pim_ifp->sec_addr_list) {
-               zlog_err("%s: failure: secondary addresslist",
-                        __PRETTY_FUNCTION__);
-               return if_list_clean(pim_ifp);
-       }
        pim_ifp->sec_addr_list->del = (void (*)(void *))pim_sec_addr_free;
        pim_ifp->sec_addr_list->cmp =
                (int (*)(void *, void *))pim_sec_addr_comp;
@@ -404,8 +350,6 @@ static int pim_sec_addr_add(struct pim_interface *pim_ifp, struct prefix *addr)
        }
 
        sec_addr = XCALLOC(MTYPE_PIM_SEC_ADDR, sizeof(*sec_addr));
-       if (!sec_addr)
-               return changed;
 
        changed = 1;
        sec_addr->addr = *addr;
@@ -1286,20 +1230,6 @@ static struct igmp_join *igmp_join_new(struct interface *ifp,
        }
 
        ij = XCALLOC(MTYPE_PIM_IGMP_JOIN, sizeof(*ij));
-       if (!ij) {
-               char group_str[INET_ADDRSTRLEN];
-               char source_str[INET_ADDRSTRLEN];
-               pim_inet4_dump("<grp?>", group_addr, group_str,
-                              sizeof(group_str));
-               pim_inet4_dump("<src?>", source_addr, source_str,
-                              sizeof(source_str));
-               zlog_err(
-                       "%s: XCALLOC(%zu) failure for IGMP group %s source %s on interface %s",
-                       __PRETTY_FUNCTION__, sizeof(*ij), group_str, source_str,
-                       ifp->name);
-               close(join_fd);
-               return 0;
-       }
 
        ij->sock_fd = join_fd;
        ij->group_addr = group_addr;
@@ -1325,9 +1255,6 @@ ferr_r pim_if_igmp_join_add(struct interface *ifp, struct in_addr group_addr,
 
        if (!pim_ifp->igmp_join_list) {
                pim_ifp->igmp_join_list = list_new();
-               if (!pim_ifp->igmp_join_list) {
-                       return ferr_cfg_invalid("Insufficient memory");
-               }
                pim_ifp->igmp_join_list->del = (void (*)(void *))igmp_join_free;
        }
 
index 5e6b0f10cf5e47a048bbca58aca0c09cabe47820..e82a7589b719a72447cbf1fcff1fbfffbf2cdbd2 100644 (file)
@@ -520,12 +520,6 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp,
        pim_ifp = ifp->info;
 
        ch = XCALLOC(MTYPE_PIM_IFCHANNEL, sizeof(*ch));
-       if (!ch) {
-               zlog_warn(
-                       "%s: pim_ifchannel_new() failure for (S,G)=%s on interface %s",
-                       __PRETTY_FUNCTION__, pim_str_sg_dump(sg), ifp->name);
-               return NULL;
-       }
 
        ch->flags = 0;
        if ((source_flags & PIM_ENCODE_RPT_BIT)
index c980f5fcbaa718187ca1682201b8b4314423c9ba..42bdd80ce226614b4653865dc377c7efbcf3a4a9 100644 (file)
@@ -860,18 +860,8 @@ static struct igmp_sock *igmp_sock_new(int fd, struct in_addr ifaddr,
        }
 
        igmp = XCALLOC(MTYPE_PIM_IGMP_SOCKET, sizeof(*igmp));
-       if (!igmp) {
-               zlog_warn("%s %s: XCALLOC() failure", __FILE__,
-                         __PRETTY_FUNCTION__);
-               return 0;
-       }
 
        igmp->igmp_group_list = list_new();
-       if (!igmp->igmp_group_list) {
-               zlog_err("%s %s: failure: igmp_group_list = list_new()",
-                        __FILE__, __PRETTY_FUNCTION__);
-               return 0;
-       }
        igmp->igmp_group_list->del = (void (*)(void *))igmp_group_free;
 
        snprintf(hash_name, 64, "IGMP %s hash", ifp->name);
@@ -1130,19 +1120,8 @@ struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp,
        */
 
        group = XCALLOC(MTYPE_PIM_IGMP_GROUP, sizeof(*group));
-       if (!group) {
-               zlog_warn("%s %s: XCALLOC() failure", __FILE__,
-                         __PRETTY_FUNCTION__);
-               return NULL; /* error, not found, could not create */
-       }
 
        group->group_source_list = list_new();
-       if (!group->group_source_list) {
-               zlog_warn("%s %s: list_new() failure", __FILE__,
-                         __PRETTY_FUNCTION__);
-               XFREE(MTYPE_PIM_IGMP_GROUP, group); /* discard group */
-               return NULL; /* error, not found, could not initialize */
-       }
        group->group_source_list->del = (void (*)(void *))igmp_source_free;
 
        group->t_group_timer = NULL;
index 5ccad39b3356e32cbc60841881139f933702a9d0..b32d71cc0d216ec6ad56cd03c46e5514b08ac8c7 100644 (file)
@@ -457,11 +457,6 @@ struct igmp_source *source_new(struct igmp_group *group,
        }
 
        src = XCALLOC(MTYPE_PIM_IGMP_GROUP_SOURCE, sizeof(*src));
-       if (!src) {
-               zlog_warn("%s %s: XCALLOC() failure", __FILE__,
-                         __PRETTY_FUNCTION__);
-               return 0; /* error, not found, could not create */
-       }
 
        src->t_source_timer = NULL;
        src->source_group = group; /* back pointer */
index cb70ee79046f888aaf41d468e414bcf53d02546a..5121dc94ca278c6dd885ca2a9f9c60ad40e11df7 100644 (file)
@@ -69,8 +69,6 @@ static struct pim_instance *pim_instance_init(struct vrf *vrf)
        char hash_name[64];
 
        pim = XCALLOC(MTYPE_PIM_PIM_INSTANCE, sizeof(struct pim_instance));
-       if (!pim)
-               return NULL;
 
        pim_if_init(pim);
 
@@ -102,12 +100,6 @@ static struct pim_instance *pim_instance_init(struct vrf *vrf)
        }
 
        pim->static_routes = list_new();
-       if (!pim->static_routes) {
-               zlog_err("%s %s: failure: static_routes=list_new()", __FILE__,
-                        __PRETTY_FUNCTION__);
-               pim_instance_terminate(pim);
-               return NULL;
-       }
        pim->static_routes->del = (void (*)(void *))pim_static_route_free;
 
        pim->send_v6_secondary = 1;
index e87dfbca95b89b1e9aac68ce1668b0636ea858ff..c5f5b9c5e0960d846d2fcef0552d89c0dff34c9b 100644 (file)
@@ -329,7 +329,6 @@ void pim_jp_agg_single_upstream_send(struct pim_rpf *rpf,
 
        if (first) {
                groups = list_new();
-
                jag.sources = list_new();
 
                listnode_add(groups, &jag);
index e798d70a51122c9fb5f954349fe6359302c4461f..951e743494a8f290ea6b806b4252e15a4c04dc1e 100644 (file)
@@ -240,11 +240,6 @@ static struct pim_msdp_sa *pim_msdp_sa_new(struct pim_instance *pim,
        struct pim_msdp_sa *sa;
 
        sa = XCALLOC(MTYPE_PIM_MSDP_SA, sizeof(*sa));
-       if (!sa) {
-               zlog_err("%s: PIM XCALLOC(%zu) failure", __PRETTY_FUNCTION__,
-                        sizeof(*sa));
-               return NULL;
-       }
 
        sa->pim = pim;
        sa->sg = *sg;
@@ -1069,11 +1064,6 @@ static enum pim_msdp_err pim_msdp_peer_new(struct pim_instance *pim,
        pim_msdp_enable(pim);
 
        mp = XCALLOC(MTYPE_PIM_MSDP_PEER, sizeof(*mp));
-       if (!mp) {
-               zlog_err("%s: PIM XCALLOC(%zu) failure", __PRETTY_FUNCTION__,
-                        sizeof(*mp));
-               return PIM_MSDP_ERR_OOM;
-       }
 
        mp->pim = pim;
        mp->peer = peer_addr;
@@ -1277,11 +1267,6 @@ static struct pim_msdp_mg *pim_msdp_mg_new(const char *mesh_group_name)
        struct pim_msdp_mg *mg;
 
        mg = XCALLOC(MTYPE_PIM_MSDP_MG, sizeof(*mg));
-       if (!mg) {
-               zlog_err("%s: PIM XCALLOC(%zu) failure", __PRETTY_FUNCTION__,
-                        sizeof(*mg));
-               return NULL;
-       }
 
        mg->mesh_group_name = XSTRDUP(MTYPE_PIM_MSDP_MG_NAME, mesh_group_name);
        mg->mbr_list = list_new();
@@ -1395,13 +1380,6 @@ enum pim_msdp_err pim_msdp_mg_mbr_add(struct pim_instance *pim,
        }
 
        mbr = XCALLOC(MTYPE_PIM_MSDP_MG_MBR, sizeof(*mbr));
-       if (!mbr) {
-               zlog_err("%s: PIM XCALLOC(%zu) failure", __PRETTY_FUNCTION__,
-                        sizeof(*mbr));
-               /* if there are no references to the mg free it */
-               pim_msdp_mg_free(pim, mg);
-               return PIM_MSDP_ERR_OOM;
-       }
        mbr->mbr_ip = mbr_ip;
        listnode_add_sort(mg->mbr_list, mbr);
 
index 20a942b4fdfd9d571f274d2a016812120be4f288..2730f5e7aa36c86095966703b54ac346f0a558b4 100644 (file)
@@ -305,11 +305,6 @@ pim_neighbor_new(struct interface *ifp, struct in_addr source_addr,
        zassert(pim_ifp);
 
        neigh = XCALLOC(MTYPE_PIM_NEIGHBOR, sizeof(*neigh));
-       if (!neigh) {
-               zlog_err("%s: PIM XCALLOC(%zu) failure", __PRETTY_FUNCTION__,
-                        sizeof(*neigh));
-               return 0;
-       }
 
        neigh->creation = pim_time_monotonic_sec();
        neigh->source_addr = source_addr;
index fa6486a83e76312b406e2f9626809d85aa4044b8..ac49373da07a07fccc7c1508ebcc7b91c4983b7a 100644 (file)
@@ -92,10 +92,6 @@ static struct pim_nexthop_cache *pim_nexthop_cache_add(struct pim_instance *pim,
 
        pnc = XCALLOC(MTYPE_PIM_NEXTHOP_CACHE,
                      sizeof(struct pim_nexthop_cache));
-       if (!pnc) {
-               zlog_err("%s: NHT PIM XCALLOC failure ", __PRETTY_FUNCTION__);
-               return NULL;
-       }
        pnc->rpf.rpf_addr.family = rpf_addr->rpf_addr.family;
        pnc->rpf.rpf_addr.prefixlen = rpf_addr->rpf_addr.prefixlen;
        pnc->rpf.rpf_addr.u.prefix4.s_addr =
@@ -140,14 +136,6 @@ int pim_find_or_track_nexthop(struct pim_instance *pim, struct prefix *addr,
        pnc = pim_nexthop_cache_find(pim, &rpf);
        if (!pnc) {
                pnc = pim_nexthop_cache_add(pim, &rpf);
-               if (!pnc) {
-                       char rpf_str[PREFIX_STRLEN];
-                       pim_addr_dump("<nht-pnc?>", addr, rpf_str,
-                                     sizeof(rpf_str));
-                       zlog_warn("%s: pnc node allocation failed. addr %s ",
-                                 __PRETTY_FUNCTION__, rpf_str);
-                       return 0;
-               }
                pim_sendmsg_zebra_rnh(pim, zclient, pnc,
                                      ZEBRA_NEXTHOP_REGISTER);
                if (PIM_DEBUG_PIM_NHT) {
@@ -168,7 +156,7 @@ int pim_find_or_track_nexthop(struct pim_instance *pim, struct prefix *addr,
        if (up != NULL)
                hash_get(pnc->upstream_hash, up, hash_alloc_intern);
 
-       if (pnc && CHECK_FLAG(pnc->flags, PIM_NEXTHOP_VALID)) {
+       if (CHECK_FLAG(pnc->flags, PIM_NEXTHOP_VALID)) {
                memcpy(out_pnc, pnc, sizeof(struct pim_nexthop_cache));
                return 1;
        }
index d49484f869f91fdb8c325e9017d431a9a0ea32e4..f0f336fb7308ccbfb02330fa8f31235d313b93ef 100644 (file)
@@ -107,11 +107,6 @@ void pim_oil_init(struct pim_instance *pim)
                                                 pim_oil_equal, hash_name);
 
        pim->channel_oil_list = list_new();
-       if (!pim->channel_oil_list) {
-               zlog_err("%s %s: failure: channel_oil_list=list_new()",
-                        __FILE__, __PRETTY_FUNCTION__);
-               return;
-       }
        pim->channel_oil_list->del = (void (*)(void *))pim_channel_oil_free;
        pim->channel_oil_list->cmp =
                (int (*)(void *, void *))pim_channel_oil_compare;
@@ -182,10 +177,6 @@ struct channel_oil *pim_channel_oil_add(struct pim_instance *pim,
        }
 
        c_oil = XCALLOC(MTYPE_PIM_CHANNEL_OIL, sizeof(*c_oil));
-       if (!c_oil) {
-               zlog_err("PIM XCALLOC(%zu) failure", sizeof(*c_oil));
-               return NULL;
-       }
 
        c_oil->oil.mfcc_mcastgrp = sg->grp;
        c_oil->oil.mfcc_origin = sg->src;
index a8cf58cd363df3242b1f6c76940d651027b973bb..7e053d2aa01c36c8293951dbe99900a59bd2c049 100644 (file)
@@ -115,13 +115,6 @@ void pim_rp_init(struct pim_instance *pim)
 
        rp_info = XCALLOC(MTYPE_PIM_RP, sizeof(*rp_info));
 
-       if (!rp_info) {
-               zlog_err("Unable to alloc rp_info");
-               route_table_finish(pim->rp_table);
-               list_delete_and_null(&pim->rp_list);
-               return;
-       }
-
        if (!str2prefix("224.0.0.0/4", &rp_info->group)) {
                zlog_err("Unable to convert 224.0.0.0/4 to prefix");
                list_delete_and_null(&pim->rp_list);
@@ -365,8 +358,6 @@ int pim_rp_new(struct pim_instance *pim, const char *rp,
        struct route_node *rn;
 
        rp_info = XCALLOC(MTYPE_PIM_RP, sizeof(*rp_info));
-       if (!rp_info)
-               return PIM_MALLOC_FAIL;
 
        if (group_range == NULL)
                result = str2prefix("224.0.0.0/4", &rp_info->group);
@@ -534,12 +525,6 @@ int pim_rp_new(struct pim_instance *pim, const char *rp,
 
        listnode_add_sort(pim->rp_list, rp_info);
        rn = route_node_get(pim->rp_table, &rp_info->group);
-       if (!rn) {
-               char buf[PREFIX_STRLEN];
-               zlog_err("Failure to get route node for pim->rp_table: %s",
-                        prefix2str(&rp_info->group, buf, sizeof(buf)));
-               return PIM_MALLOC_FAIL;
-       }
        rn->info = rp_info;
 
        if (PIM_DEBUG_TRACE) {
index 8e7da0f121e86c60bf3ac4c221776795854fec9c..bdf303d5c565faadb816725cde2ac08d30a6f776 100644 (file)
@@ -348,12 +348,6 @@ static struct ssmpingd_sock *ssmpingd_new(struct pim_instance *pim,
 
        if (!pim->ssmpingd_list) {
                pim->ssmpingd_list = list_new();
-               if (!pim->ssmpingd_list) {
-                       zlog_err(
-                               "%s %s: failure: qpim_ssmpingd_list=list_new()",
-                               __FILE__, __PRETTY_FUNCTION__);
-                       return 0;
-               }
                pim->ssmpingd_list->del = (void (*)(void *))ssmpingd_free;
        }
 
@@ -369,15 +363,6 @@ static struct ssmpingd_sock *ssmpingd_new(struct pim_instance *pim,
        }
 
        ss = XCALLOC(MTYPE_PIM_SSMPINGD, sizeof(*ss));
-       if (!ss) {
-               char source_str[INET_ADDRSTRLEN];
-               pim_inet4_dump("<src?>", source_addr, source_str,
-                              sizeof(source_str));
-               zlog_err("%s: XCALLOC(%zu) failure for ssmpingd source %s",
-                        __PRETTY_FUNCTION__, sizeof(*ss), source_str);
-               close(sock_fd);
-               return 0;
-       }
 
        ss->pim = pim;
        ss->sock_fd = sock_fd;
index 3d44a01c78803d09161a8ac7f029f2dc2008dc98..9569b7dcac2fa86cfb91e2a329c3cdc202fda3f0 100644 (file)
@@ -39,14 +39,7 @@ void pim_static_route_free(struct static_route *s_route)
 
 static struct static_route *static_route_alloc()
 {
-       struct static_route *s_route;
-
-       s_route = XCALLOC(MTYPE_PIM_STATIC_ROUTE, sizeof(*s_route));
-       if (!s_route) {
-               zlog_err("PIM XCALLOC(%zu) failure", sizeof(*s_route));
-               return 0;
-       }
-       return s_route;
+       return XCALLOC(MTYPE_PIM_STATIC_ROUTE, sizeof(struct static_route));
 }
 
 static struct static_route *static_route_new(unsigned int iif, unsigned int oif,
@@ -55,9 +48,6 @@ static struct static_route *static_route_new(unsigned int iif, unsigned int oif,
 {
        struct static_route *s_route;
        s_route = static_route_alloc();
-       if (!s_route) {
-               return 0;
-       }
 
        s_route->group = group;
        s_route->source = source;
index eddec3c29e81acb16a6144d07ae6cf6122fec5e6..80bda336dfefeba9adefb0538713bb26a17f558e 100644 (file)
@@ -757,12 +757,6 @@ int pim_tlv_parse_addr_list(const char *ifname, struct in_addr src_addr,
                 */
                if (!*hello_option_addr_list) {
                        *hello_option_addr_list = list_new();
-                       if (!*hello_option_addr_list) {
-                               zlog_err(
-                                       "%s %s: failure: hello_option_addr_list=list_new()",
-                                       __FILE__, __PRETTY_FUNCTION__);
-                               return -2;
-                       }
                        (*hello_option_addr_list)->del =
                                (void (*)(void *))prefix_free;
                }
index 9329d72ce05536b16f04956efc80efe79aa0299b..e3488b6a66d7423b527e358fa1e48cc4689583cb 100644 (file)
@@ -603,11 +603,6 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
        struct pim_upstream *up;
 
        up = XCALLOC(MTYPE_PIM_UPSTREAM, sizeof(*up));
-       if (!up) {
-               zlog_err("%s: PIM XCALLOC(%zu) failure", __PRETTY_FUNCTION__,
-                        sizeof(*up));
-               return NULL;
-       }
 
        up->sg = *sg;
        pim_str_sg_set(sg, up->sg_str);