diff options
| -rw-r--r-- | bgpd/bgp_ecommunity.c | 19 | ||||
| -rw-r--r-- | bgpd/bgp_flowspec_vty.c | 5 | ||||
| -rw-r--r-- | bgpd/bgp_zebra.c | 2 | ||||
| -rw-r--r-- | isisd/isis_nb_config.c | 6 | ||||
| -rw-r--r-- | lib/northbound.c | 6 | ||||
| -rw-r--r-- | pimd/pim_igmp.c | 10 | ||||
| -rw-r--r-- | zebra/kernel_netlink.c | 3 |
7 files changed, 27 insertions, 24 deletions
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index 79fb7e55e9..3a0400a4b3 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -265,7 +265,8 @@ struct ecommunity *ecommunity_dup(struct ecommunity *ecom) if (new->size) { new->val = XMALLOC(MTYPE_ECOMMUNITY_VAL, ecom->size * ecom->unit_size); - memcpy(new->val, ecom->val, ecom->size * ecom->unit_size); + memcpy(new->val, ecom->val, + (size_t)ecom->size * (size_t)ecom->unit_size); } else new->val = NULL; return new; @@ -285,18 +286,16 @@ struct ecommunity *ecommunity_merge(struct ecommunity *ecom1, struct ecommunity *ecom2) { if (ecom1->val) - ecom1->val = - XREALLOC(MTYPE_ECOMMUNITY_VAL, ecom1->val, - (ecom1->size + ecom2->size) * - ecom1->unit_size); + ecom1->val = XREALLOC(MTYPE_ECOMMUNITY_VAL, ecom1->val, + (size_t)(ecom1->size + ecom2->size) + * (size_t)ecom1->unit_size); else - ecom1->val = - XMALLOC(MTYPE_ECOMMUNITY_VAL, - (ecom1->size + ecom2->size) * - ecom1->unit_size); + ecom1->val = XMALLOC(MTYPE_ECOMMUNITY_VAL, + (size_t)(ecom1->size + ecom2->size) + * (size_t)ecom1->unit_size); memcpy(ecom1->val + (ecom1->size * ecom1->unit_size), ecom2->val, - ecom2->size * ecom1->unit_size); + (size_t)ecom2->size * (size_t)ecom1->unit_size); ecom1->size += ecom2->size; return ecom1; diff --git a/bgpd/bgp_flowspec_vty.c b/bgpd/bgp_flowspec_vty.c index 798bce8219..3b7fb649a9 100644 --- a/bgpd/bgp_flowspec_vty.c +++ b/bgpd/bgp_flowspec_vty.c @@ -268,12 +268,7 @@ void route_vty_out_flowspec(struct vty *vty, const struct prefix *p, json_object *json_ecom_path = NULL; json_object *json_time_path = NULL; char timebuf[BGP_UPTIME_LEN]; - struct bgp_dest *dest = NULL; - if (path) - dest = path->net; - if (dest) - bgp_dest_get_bgp_table_info(dest); if (p == NULL || p->family != AF_FLOWSPEC) return; if (json_paths) { diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 11e872f6b4..b203238520 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -2367,7 +2367,7 @@ static void bgp_encode_pbr_rule_action(struct stream *s, struct prefix pfx; uint8_t fam = AF_INET; - if (pbra && pbra->nh.type == NEXTHOP_TYPE_IPV6) + if (pbra->nh.type == NEXTHOP_TYPE_IPV6) fam = AF_INET6; stream_putl(s, 0); /* seqno unused */ if (pbr) diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index 0988fe8578..6edbc2956a 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -80,14 +80,18 @@ int isis_instance_create(struct nb_cb_create_args *args) int isis_instance_destroy(struct nb_cb_destroy_args *args) { struct isis_area *area; + vrf_id_t vrf_id; if (args->event != NB_EV_APPLY) return NB_OK; area = nb_running_unset_entry(args->dnode); + + vrf_id = area->isis->vrf_id; + isis_area_destroy(area); /* remove ldp-sync config */ - if (area->isis->vrf_id == VRF_DEFAULT) + if (vrf_id == VRF_DEFAULT) isis_ldp_sync_gbl_exit(true); return NB_OK; diff --git a/lib/northbound.c b/lib/northbound.c index 99c6ab57ec..5816c162d8 100644 --- a/lib/northbound.c +++ b/lib/northbound.c @@ -122,9 +122,9 @@ static int nb_node_new_cb(const struct lys_node *snode, void *arg) if (CHECK_FLAG(snode->nodetype, LYS_CONTAINER | LYS_LIST)) { bool config_only = true; - yang_snodes_iterate_subtree(snode, NULL, - nb_node_check_config_only, 0, - &config_only); + (void)yang_snodes_iterate_subtree(snode, NULL, + nb_node_check_config_only, 0, + &config_only); if (config_only) SET_FLAG(nb_node->flags, F_NB_NODE_CONFIG_ONLY); } diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c index 20f339d43f..04ece6dbb0 100644 --- a/pimd/pim_igmp.c +++ b/pimd/pim_igmp.c @@ -138,7 +138,7 @@ struct igmp_sock *pim_igmp_sock_lookup_ifaddr(struct list *igmp_sock_list, if (ifaddr.s_addr == igmp->ifaddr.s_addr) return igmp; - return 0; + return NULL; } struct igmp_sock *igmp_sock_lookup_by_fd(struct list *igmp_sock_list, int fd) @@ -150,7 +150,7 @@ struct igmp_sock *igmp_sock_lookup_by_fd(struct list *igmp_sock_list, int fd) if (fd == igmp->fd) return igmp; - return 0; + return NULL; } static int pim_igmp_other_querier_expire(struct thread *t) @@ -1004,7 +1004,7 @@ struct igmp_sock *pim_igmp_sock_add(struct list *igmp_sock_list, if (fd < 0) { zlog_warn("Could not open IGMP socket for %s on %s", inet_ntoa(ifaddr), ifp->name); - return 0; + return NULL; } sin.sin_family = AF_INET; @@ -1013,7 +1013,9 @@ struct igmp_sock *pim_igmp_sock_add(struct list *igmp_sock_list, if (bind(fd, (struct sockaddr *) &sin, sizeof(sin)) != 0) { zlog_warn("Could not bind IGMP socket for %s on %s", inet_ntoa(ifaddr), ifp->name); - return 0; + close(fd); + + return NULL; } igmp = igmp_sock_new(fd, ifaddr, ifp, mtrace_only); diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index ad0d4bf56b..c53d28a18c 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -1462,6 +1462,9 @@ void kernel_init(struct zebra_ns *zns) one = 1; ret = setsockopt(zns->netlink_dplane.sock, SOL_NETLINK, NETLINK_CAP_ACK, &one, sizeof(one)); + if (ret < 0) + zlog_notice( + "Registration for reduced ACK packet size failed, probably running an early kernel"); #endif /* Register kernel socket. */ |
