mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 00:18:53 +00:00
commit
69796ce6f6
@ -627,14 +627,12 @@ void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */
|
||||
&static_attr); /* hashed refcounted everything */
|
||||
bgp_attr_flush(&static_attr); /* free locally-allocated parts */
|
||||
|
||||
if (debug) {
|
||||
const char *s = "";
|
||||
if (debug && new_attr->ecommunity) {
|
||||
char *s = ecommunity_ecom2str(new_attr->ecommunity,
|
||||
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
|
||||
|
||||
if (new_attr->ecommunity) {
|
||||
s = ecommunity_ecom2str(new_attr->ecommunity,
|
||||
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
|
||||
}
|
||||
zlog_debug("%s: new_attr->ecommunity{%s}", __func__, s);
|
||||
XFREE(MTYPE_ECOMMUNITY_STR, s);
|
||||
}
|
||||
|
||||
/* Now new_attr is an allocated interned attr */
|
||||
|
@ -256,9 +256,11 @@ static int mtrace_un_forward_packet(struct pim_instance *pim, struct ip *ip_hdr,
|
||||
pim_socket_ip_hdr(fd);
|
||||
|
||||
if (interface == NULL) {
|
||||
memset(&nexthop, 0, sizeof(nexthop));
|
||||
ret = pim_nexthop_lookup(pim, &nexthop, ip_hdr->ip_dst, 0);
|
||||
|
||||
if (ret != 0) {
|
||||
close(fd);
|
||||
if (PIM_DEBUG_MTRACE)
|
||||
zlog_warn(
|
||||
"Dropping mtrace packet, "
|
||||
@ -434,6 +436,7 @@ static int mtrace_send_response(struct pim_instance *pim,
|
||||
if (PIM_DEBUG_MTRACE)
|
||||
zlog_debug("mtrace response to RP");
|
||||
} else {
|
||||
memset(&nexthop, 0, sizeof(nexthop));
|
||||
/* TODO: should use unicast rib lookup */
|
||||
ret = pim_nexthop_lookup(pim, &nexthop, mtracep->rsp_addr, 1);
|
||||
|
||||
@ -613,6 +616,7 @@ int igmp_mtrace_recv_qry_req(struct igmp_sock *igmp, struct ip *ip_hdr,
|
||||
|
||||
nh_addr.s_addr = 0;
|
||||
|
||||
memset(&nexthop, 0, sizeof(nexthop));
|
||||
ret = pim_nexthop_lookup(pim, &nexthop, mtracep->src_addr, 1);
|
||||
|
||||
if (ret == 0) {
|
||||
|
@ -172,6 +172,7 @@ ns_id_t zebra_ns_id_get(const char *netnspath)
|
||||
if (sock < 0) {
|
||||
zlog_err("netlink( %u) socket() error: %s", sock,
|
||||
safe_strerror(errno));
|
||||
close(fd);
|
||||
return NS_UNKNOWN;
|
||||
}
|
||||
memset(&snl, 0, sizeof(snl));
|
||||
|
@ -222,11 +222,15 @@ int zsend_interface_link_params(struct zserv *client, struct interface *ifp)
|
||||
struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ);
|
||||
|
||||
/* Check this client need interface information. */
|
||||
if (!client->ifinfo)
|
||||
if (!client->ifinfo) {
|
||||
stream_free(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!ifp->link_params)
|
||||
if (!ifp->link_params) {
|
||||
stream_free(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
zclient_create_header(s, ZEBRA_INTERFACE_LINK_PARAMS, ifp->vrf_id);
|
||||
|
||||
@ -234,8 +238,10 @@ int zsend_interface_link_params(struct zserv *client, struct interface *ifp)
|
||||
stream_putl(s, ifp->ifindex);
|
||||
|
||||
/* Then TE Link Parameters */
|
||||
if (zebra_interface_link_params_write(s, ifp) == 0)
|
||||
if (zebra_interface_link_params_write(s, ifp) == 0) {
|
||||
stream_free(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Write packet size. */
|
||||
stream_putw_at(s, 0, stream_get_endp(s));
|
||||
@ -595,8 +601,10 @@ int zsend_redistribute_route(int cmd, struct zserv *client, struct prefix *p,
|
||||
struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ);
|
||||
|
||||
/* Encode route and send. */
|
||||
if (zapi_route_encode(cmd, s, &api) < 0)
|
||||
if (zapi_route_encode(cmd, s, &api) < 0) {
|
||||
stream_free(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (IS_ZEBRA_DEBUG_SEND) {
|
||||
char buf_prefix[PREFIX_STRLEN];
|
||||
@ -2614,7 +2622,7 @@ static inline void zserv_handle_commands(struct zserv *client,
|
||||
struct stream *msg,
|
||||
struct zebra_vrf *zvrf)
|
||||
{
|
||||
if (hdr->command > sizeof(zserv_handlers)
|
||||
if (hdr->command > array_size(zserv_handlers)
|
||||
|| zserv_handlers[hdr->command] == NULL)
|
||||
zlog_info("Zebra received unknown command %d", hdr->command);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user