/*
* Handle message from client to delete a remote MACIP for a VNI.
*/
-int zebra_vxlan_remote_macip_del(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+void zebra_vxlan_remote_macip_del(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
vni_t vni;
}
stream_failure:
- return 0;
+ return;
}
/*
* could be just the add of a MAC address or the add of a neighbor
* (IP+MAC).
*/
-int zebra_vxlan_remote_macip_add(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+void zebra_vxlan_remote_macip_add(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
vni_t vni;
zlog_warn(
"%s: EVPN Not turned on yet we have received a remote_macip add zapi callback",
__PRETTY_FUNCTION__);
- return -1;
+ return;
}
s = client->ibuf;
prefix_mac2str(&macaddr, buf,
sizeof(buf)),
vni, inet_ntoa(vtep_ip));
- return -1;
+ return;
}
/* Is this MAC created for a MACIP? */
prefix_mac2str(&macaddr, buf,
sizeof(buf)),
vni, inet_ntoa(vtep_ip));
- return -1;
+ return;
}
} else if (memcmp(&n->emac, &macaddr, sizeof(macaddr))
}
stream_failure:
- return 0;
+ return;
}
/*
/*
* Handle message from client to delete a remote VTEP for a VNI.
*/
-int zebra_vxlan_remote_vtep_del(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+void zebra_vxlan_remote_vtep_del(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
u_short l = 0;
zlog_warn(
"%s: EVPN is not enabled yet we have received a vtep del command",
__PRETTY_FUNCTION__);
- return -1;
+ return;
}
if (zvrf_id(zvrf) != VRF_DEFAULT) {
zlog_err("Recv MACIP DEL for non-default VRF %u",
zvrf_id(zvrf));
- return -1;
+ return;
}
s = client->ibuf;
}
stream_failure:
- return 0;
+ return;
}
/*
* Handle message from client to add a remote VTEP for a VNI.
*/
-int zebra_vxlan_remote_vtep_add(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+void zebra_vxlan_remote_vtep_add(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
u_short l = 0;
zlog_warn(
"%s: EVPN not enabled yet we received a vtep_add zapi call",
__PRETTY_FUNCTION__);
- return -1;
+ return;
}
if (zvrf_id(zvrf) != VRF_DEFAULT) {
zlog_err("Recv MACIP ADD for non-default VRF %u",
zvrf_id(zvrf));
- return -1;
+ return;
}
s = client->ibuf;
}
stream_failure:
- return 0;
+ return;
}
/*
* Handle message from client to enable/disable advertisement of g/w macip
* routes
*/
-int zebra_vxlan_advertise_subnet(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+void zebra_vxlan_advertise_subnet(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
int advertise;
if (zvrf_id(zvrf) != VRF_DEFAULT) {
zlog_err("EVPN GW-MACIP Adv for non-default VRF %u",
zvrf_id(zvrf));
- return -1;
+ return;
}
s = client->ibuf;
zvni = zvni_lookup(vni);
if (!zvni)
- return 0;
+ return;
if (zvni->advertise_subnet == advertise)
- return 0;
+ return;
if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("EVPN subnet Adv %s on VNI %d , currently %s",
ifp = zvni->vxlan_if;
if (!ifp)
- return 0;
+ return;
zif = ifp->info;
/* If down or not mapped to a bridge, we're done. */
if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
- return 0;
+ return;
zl2_info = zif->l2info.vxl;
vlan_if =
zvni_map_to_svi(zl2_info.access_vlan, zif->brslave_info.br_if);
if (!vlan_if)
- return 0;
+ return;
if (zvni->advertise_subnet)
zvni_advertise_subnet(zvni, vlan_if, 1);
else
zvni_advertise_subnet(zvni, vlan_if, 0);
- return 0;
+ return;
}
/*
* Handle message from client to enable/disable advertisement of g/w macip
* routes
*/
-int zebra_vxlan_advertise_gw_macip(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+void zebra_vxlan_advertise_gw_macip(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
int advertise;
if (zvrf_id(zvrf) != VRF_DEFAULT) {
zlog_err("EVPN GW-MACIP Adv for non-default VRF %u",
zvrf_id(zvrf));
- return -1;
+ return;
}
s = client->ibuf;
: "disabled");
if (zvrf->advertise_gw_macip == advertise)
- return 0;
+ return;
zvrf->advertise_gw_macip = advertise;
zvni = zvni_lookup(vni);
if (!zvni)
- return 0;
+ return;
if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug(
: "disabled");
if (zvni->advertise_gw_macip == advertise)
- return 0;
+ return;
zvni->advertise_gw_macip = advertise;
ifp = zvni->vxlan_if;
if (!ifp)
- return 0;
+ return;
zif = ifp->info;
/* If down or not mapped to a bridge, we're done. */
if (!if_is_operative(ifp) || !zif->brslave_info.br_if)
- return 0;
+ return;
zl2_info = zif->l2info.vxl;
vlan_if = zvni_map_to_svi(zl2_info.access_vlan,
zif->brslave_info.br_if);
if (!vlan_if)
- return 0;
+ return;
if (advertise_gw_macip_enabled(zvni)) {
/* Add primary SVI MAC-IP */
}
stream_failure:
- return 0;
+ return;
}
* when disabled, the entries should be deleted and remote VTEPs and MACs
* uninstalled from the kernel.
*/
-int zebra_vxlan_advertise_all_vni(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+void zebra_vxlan_advertise_all_vni(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s = NULL;
int advertise = 0;
if (zvrf_id(zvrf) != VRF_DEFAULT) {
zlog_err("EVPN VNI Adv for non-default VRF %u", zvrf_id(zvrf));
- return -1;
+ return;
}
s = client->ibuf;
is_evpn_enabled() ? "enabled" : "disabled");
if (zvrf->advertise_all_vni == advertise)
- return 0;
+ return;
zvrf->advertise_all_vni = advertise;
if (is_evpn_enabled()) {
/* cleanup all l3vnis */
zns = zebra_ns_lookup(NS_DEFAULT);
if (!zns)
- return -1;
+ return;
hash_iterate(zns->l3vni_table, zl3vni_cleanup_all, NULL);
}
stream_failure:
- return 0;
+ return;
}
/*
}
/* Nexthop register */
-static int zserv_rnh_register(struct zserv *client, u_short length,
- rnh_type_t type, struct zebra_vrf *zvrf)
+static void zserv_rnh_register(struct zserv *client, u_short length,
+ rnh_type_t type, struct zebra_vrf *zvrf)
{
struct rnh *rnh;
struct stream *s;
zlog_warn(
"%s: Specified prefix length %d is too large for a v4 address",
__PRETTY_FUNCTION__, p.prefixlen);
- return -1;
+ return;
}
STREAM_GET(&p.u.prefix4.s_addr, s, IPV4_MAX_BYTELEN);
l += IPV4_MAX_BYTELEN;
zlog_warn(
"%s: Specified prefix length %d is to large for a v6 address",
__PRETTY_FUNCTION__, p.prefixlen);
- return -1;
+ return;
}
STREAM_GET(&p.u.prefix6, s, IPV6_MAX_BYTELEN);
l += IPV6_MAX_BYTELEN;
zlog_err(
"rnh_register: Received unknown family type %d\n",
p.family);
- return -1;
+ return;
}
rnh = zebra_add_rnh(&p, zvrf_id(zvrf), type);
if (type == RNH_NEXTHOP_TYPE) {
}
stream_failure:
- return 0;
+ return;
}
/* Nexthop register */
-static int zserv_rnh_unregister(struct zserv *client, u_short length,
- rnh_type_t type, struct zebra_vrf *zvrf)
+static void zserv_rnh_unregister(struct zserv *client, u_short length,
+ rnh_type_t type, struct zebra_vrf *zvrf)
{
struct rnh *rnh;
struct stream *s;
zlog_warn(
"%s: Specified prefix length %d is to large for a v4 address",
__PRETTY_FUNCTION__, p.prefixlen);
- return -1;
+ return;
}
STREAM_GET(&p.u.prefix4.s_addr, s, IPV4_MAX_BYTELEN);
l += IPV4_MAX_BYTELEN;
zlog_warn(
"%s: Specified prefix length %d is to large for a v6 address",
__PRETTY_FUNCTION__, p.prefixlen);
- return -1;
+ return;
}
STREAM_GET(&p.u.prefix6, s, IPV6_MAX_BYTELEN);
l += IPV6_MAX_BYTELEN;
zlog_err(
"rnh_register: Received unknown family type %d\n",
p.family);
- return -1;
+ return;
}
rnh = zebra_lookup_rnh(&p, zvrf_id(zvrf), type);
if (rnh) {
}
}
stream_failure:
- return 0;
+ return;
}
#define ZEBRA_MIN_FEC_LENGTH 5
/* FEC register */
-static int zserv_fec_register(struct zserv *client, u_short length)
+static void zserv_fec_register(struct zserv *client, u_short length)
{
struct stream *s;
struct zebra_vrf *zvrf;
s = client->ibuf;
zvrf = vrf_info_lookup(VRF_DEFAULT);
if (!zvrf)
- return 0; // unexpected
+ return;
/*
* The minimum amount of data that can be sent for one fec
zlog_err(
"fec_register: Received a fec register of length %d, it is of insufficient size to properly decode",
length);
- return -1;
+ return;
}
while (l < length) {
zlog_err(
"fec_register: Received unknown family type %d\n",
p.family);
- return -1;
+ return;
}
STREAM_GETC(s, p.prefixlen);
if ((p.family == AF_INET && p.prefixlen > IPV4_MAX_BITLEN)
zlog_warn(
"%s: Specified prefix length: %d is to long for %d",
__PRETTY_FUNCTION__, p.prefixlen, p.family);
- return -1;
+ return;
}
l += 5;
STREAM_GET(&p.u.prefix, s, PSIZE(p.prefixlen));
}
stream_failure:
- return 0;
+ return;
}
/* FEC unregister */
-static int zserv_fec_unregister(struct zserv *client, u_short length)
+static void zserv_fec_unregister(struct zserv *client, u_short length)
{
struct stream *s;
struct zebra_vrf *zvrf;
s = client->ibuf;
zvrf = vrf_info_lookup(VRF_DEFAULT);
if (!zvrf)
- return 0; // unexpected
+ return;
/*
* The minimum amount of data that can be sent for one
zlog_err(
"fec_unregister: Received a fec unregister of length %d, it is of insufficient size to properly decode",
length);
- return -1;
+ return;
}
while (l < length) {
zlog_err(
"fec_unregister: Received unknown family type %d\n",
p.family);
- return -1;
+ return;
}
STREAM_GETC(s, p.prefixlen);
if ((p.family == AF_INET && p.prefixlen > IPV4_MAX_BITLEN)
zlog_warn(
"%s: Received prefix length %d which is greater than %d can support",
__PRETTY_FUNCTION__, p.prefixlen, p.family);
- return -1;
+ return;
}
l += 5;
STREAM_GET(&p.u.prefix, s, PSIZE(p.prefixlen));
}
stream_failure:
- return 0;
+ return;
}
/*
/* Register zebra server interface information. Send current all
interface and address information. */
-static int zread_interface_add(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_interface_add(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct vrf *vrf;
struct interface *ifp;
continue;
if (zsend_interface_add(client, ifp) < 0)
- return -1;
+ return;
if (zsend_interface_addresses(client, ifp) < 0)
- return -1;
+ return;
}
}
- return 0;
+ return;
}
/* Unregister zebra server interface information. */
-static int zread_interface_delete(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_interface_delete(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
vrf_bitmap_unset(client->ifinfo, zvrf_id(zvrf));
- return 0;
}
void zserv_nexthop_num_warn(const char *caller, const struct prefix *p,
}
}
-static int zread_route_add(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_route_add(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
struct zapi_route api;
s = client->ibuf;
if (zapi_route_decode(s, &api) < 0)
- return -1;
+ return;
/* Allocate new route. */
vrf_id = zvrf_id(zvrf);
__PRETTY_FUNCTION__, api.nexthop_num);
nexthops_free(re->ng.nexthop);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
/* MPLS labels for BGP-LU or Segment Routing */
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_LABEL)
__PRETTY_FUNCTION__);
nexthops_free(re->ng.nexthop);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX))
src_p = &api.src_prefix;
client->v6_route_upd8_cnt++;
break;
}
-
- return 0;
}
-static int zread_route_del(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_route_del(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
struct zapi_route api;
s = client->ibuf;
if (zapi_route_decode(s, &api) < 0)
- return -1;
+ return;
afi = family2afi(api.prefix.family);
if (afi != AFI_IP6 && CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX)) {
zlog_warn("%s: Received a src prefix while afi is not v6",
__PRETTY_FUNCTION__);
- return -1;
+ return;
}
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX))
src_p = &api.src_prefix;
break;
}
- return 0;
+ return;
}
/* This function support multiple nexthop. */
* Parse the ZEBRA_IPV4_ROUTE_ADD sent from client. Update re and
* add kernel route.
*/
-static int zread_ipv4_add(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_ipv4_add(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
int i;
struct route_entry *re;
zlog_warn("%s: Specified route type %d is not a legal value\n",
__PRETTY_FUNCTION__, re->type);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
STREAM_GETW(s, re->instance);
STREAM_GETL(s, re->flags);
"%s: Specified prefix length %d is greater than what v4 can be",
__PRETTY_FUNCTION__, p.prefixlen);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
STREAM_GET(&p.u.prefix4, s, PSIZE(p.prefixlen));
__PRETTY_FUNCTION__);
nexthops_free(re->ng.nexthop);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
break;
case NEXTHOP_TYPE_BLACKHOLE:
route_entry_nexthop_blackhole_add(re, bh_type);
__PRETTY_FUNCTION__, nexthop_type);
nexthops_free(re->ng.nexthop);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
}
}
else if (ret < 0)
client->v4_route_upd8_cnt++;
- return 0;
+ return;
stream_failure:
nexthops_free(re->ng.nexthop);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
/* Zebra server IPv4 prefix delete function. */
-static int zread_ipv4_delete(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_ipv4_delete(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
struct zapi_ipv4 api;
if (p.prefixlen > IPV4_MAX_BITLEN) {
zlog_warn("%s: Passed in prefixlen %d is impossible",
__PRETTY_FUNCTION__, p.prefixlen);
- return -1;
+ return;
}
STREAM_GET(&p.u.prefix4, s, PSIZE(p.prefixlen));
client->v4_route_del_cnt++;
stream_failure:
- return 0;
+ return;
}
/* MRIB Nexthop lookup for IPv4. */
-static int zread_ipv4_nexthop_lookup_mrib(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_ipv4_nexthop_lookup_mrib(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct in_addr addr;
struct route_entry *re;
STREAM_GET(&addr.s_addr, client->ibuf, IPV4_MAX_BYTELEN);
re = rib_match_ipv4_multicast(zvrf_id(zvrf), addr, NULL);
- return zsend_ipv4_nexthop_lookup_mrib(client, addr, re, zvrf);
+ zsend_ipv4_nexthop_lookup_mrib(client, addr, re, zvrf);
+ return;
stream_failure:
- return -1;
+ return;
}
/* Zebra server IPv6 prefix add function. */
-static int zread_ipv4_route_ipv6_nexthop_add(struct zserv *client,
- u_short length,
- struct zebra_vrf *zvrf)
+static void zread_ipv4_route_ipv6_nexthop_add(struct zserv *client,
+ u_short length,
+ struct zebra_vrf *zvrf)
{
unsigned int i;
struct stream *s;
zlog_warn("%s: Specified route type: %d is not a legal value\n",
__PRETTY_FUNCTION__, re->type);
XFREE(MTYPE_RE, re);
- return -1;
+
+ return;
}
STREAM_GETW(s, re->instance);
STREAM_GETL(s, re->flags);
"%s: Prefix Length %d is greater than what a v4 address can use",
__PRETTY_FUNCTION__, p.prefixlen);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
STREAM_GET(&p.u.prefix4, s, PSIZE(p.prefixlen));
__PRETTY_FUNCTION__);
nexthops_free(re->ng.nexthop);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
}
else if (ret < 0)
client->v4_route_upd8_cnt++;
- return 0;
+ return;
stream_failure:
nexthops_free(re->ng.nexthop);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
-static int zread_ipv6_add(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_ipv6_add(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
unsigned int i;
struct stream *s;
zlog_warn("%s: Specified route type: %d is not a legal value\n",
__PRETTY_FUNCTION__, re->type);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
STREAM_GETW(s, re->instance);
STREAM_GETL(s, re->flags);
"%s: Specified prefix length %d is to large for v6 prefix",
__PRETTY_FUNCTION__, p.prefixlen);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
STREAM_GET(&p.u.prefix6, s, PSIZE(p.prefixlen));
"%s: Specified src prefix length %d is to large for v6 prefix",
__PRETTY_FUNCTION__, src_p.prefixlen);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
STREAM_GET(&src_p.prefix, s, PSIZE(src_p.prefixlen));
src_pp = &src_p;
__PRETTY_FUNCTION__);
nexthops_free(re->ng.nexthop);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
}
else if (ret < 0)
client->v6_route_upd8_cnt++;
- return 0;
+ return;
stream_failure:
nexthops_free(re->ng.nexthop);
XFREE(MTYPE_RE, re);
- return -1;
+ return;
}
/* Zebra server IPv6 prefix delete function. */
-static int zread_ipv6_delete(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_ipv6_delete(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
struct zapi_ipv6 api;
client->v6_route_del_cnt++;
stream_failure:
- return 0;
+ return;
}
/* Register zebra server router-id information. Send current router-id */
-static int zread_router_id_add(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_router_id_add(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct prefix p;
router_id_get(&p, zvrf_id(zvrf));
- return zsend_router_id_update(client, &p, zvrf_id(zvrf));
+ zsend_router_id_update(client, &p, zvrf_id(zvrf));
}
/* Unregister zebra server router-id information. */
-static int zread_router_id_delete(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_router_id_delete(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
vrf_bitmap_unset(client->ridinfo, zvrf_id(zvrf));
- return 0;
}
/* Tie up route-type and client->sock */
}
/* Unregister all information in a VRF. */
-static int zread_vrf_unregister(struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_vrf_unregister(struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
int i;
afi_t afi;
vrf_bitmap_unset(client->redist_default, zvrf_id(zvrf));
vrf_bitmap_unset(client->ifinfo, zvrf_id(zvrf));
vrf_bitmap_unset(client->ridinfo, zvrf_id(zvrf));
-
- return 0;
}
static void zread_mpls_labels(int command, struct zserv *client, u_short length,
}
}
-static int zread_pseudowire(int command, struct zserv *client, u_short length,
- struct zebra_vrf *zvrf)
+static void zread_pseudowire(int command, struct zserv *client, u_short length,
+ struct zebra_vrf *zvrf)
{
struct stream *s;
char ifname[IF_NAMESIZE];
STREAM_GET(&nexthop.ipv6, s, 16);
break;
default:
- return -1;
+ return;
}
STREAM_GETL(s, local_label);
STREAM_GETL(s, remote_label);
zlog_warn("%s: pseudowire %s already exists [%s]",
__func__, ifname,
zserv_command_string(command));
- return -1;
+ return;
}
zebra_pw_add(zvrf, ifname, protocol, client);
if (!pw) {
zlog_warn("%s: pseudowire %s not found [%s]", __func__,
ifname, zserv_command_string(command));
- return -1;
+ return;
}
zebra_pw_del(zvrf, pw);
if (!pw) {
zlog_warn("%s: pseudowire %s not found [%s]", __func__,
ifname, zserv_command_string(command));
- return -1;
+ return;
}
switch (command) {
}
stream_failure:
- return 0;
+ return;
}
/* Cleanup registered nexthops (across VRFs) upon client disconnect. */
zebra_vrf_update_all(client);
}
-static int zread_interface_set_master(struct zserv *client, u_short length)
+static void zread_interface_set_master(struct zserv *client, u_short length)
{
struct interface *master;
struct interface *slave;
slave = if_lookup_by_index(ifindex, vrf_id);
if (!master || !slave)
- return 0;
+ return;
kernel_interface_set_master(master, slave);
stream_failure:
- return 1;
+ return;
}