summaryrefslogtreecommitdiffstats
path: root/zebra/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c51
1 files changed, 30 insertions, 21 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 229f9c1da..10f1f9210 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -441,7 +441,7 @@ static void if_addr_wakeup(struct interface *ifp)
struct listnode *node, *nnode;
struct connected *ifc;
struct prefix *p;
- int ret;
+ enum zebra_dplane_result dplane_res;
for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, ifc)) {
p = ifc->address;
@@ -479,12 +479,13 @@ static void if_addr_wakeup(struct interface *ifp)
if_refresh(ifp);
}
- ret = if_set_prefix(ifp, ifc);
- if (ret < 0) {
+ dplane_res = dplane_intf_addr_set(ifp, ifc);
+ if (dplane_res ==
+ ZEBRA_DPLANE_REQUEST_FAILURE) {
flog_err_sys(
EC_ZEBRA_IFACE_ADDR_ADD_FAILED,
"Can't set interface's address: %s",
- safe_strerror(errno));
+ dplane_res2str(dplane_res));
continue;
}
@@ -502,12 +503,14 @@ static void if_addr_wakeup(struct interface *ifp)
if_refresh(ifp);
}
- ret = if_prefix_add_ipv6(ifp, ifc);
- if (ret < 0) {
+
+ dplane_res = dplane_intf_addr_set(ifp, ifc);
+ if (dplane_res ==
+ ZEBRA_DPLANE_REQUEST_FAILURE) {
flog_err_sys(
EC_ZEBRA_IFACE_ADDR_ADD_FAILED,
"Can't set interface's address: %s",
- safe_strerror(errno));
+ dplane_res2str(dplane_res));
continue;
}
@@ -1369,8 +1372,11 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp)
vty_out(vty, " VTEP IP: %s",
inet_ntoa(vxlan_info->vtep_ip));
if (vxlan_info->access_vlan)
- vty_out(vty, " Access VLAN Id %u",
+ vty_out(vty, " Access VLAN Id %u\n",
vxlan_info->access_vlan);
+ if (vxlan_info->mcast_grp.s_addr != INADDR_ANY)
+ vty_out(vty, " Mcast Group %s",
+ inet_ntoa(vxlan_info->mcast_grp));
vty_out(vty, "\n");
}
@@ -2626,6 +2632,7 @@ static int ip_address_install(struct vty *vty, struct interface *ifp,
struct connected *ifc;
struct prefix_ipv4 *p;
int ret;
+ enum zebra_dplane_result dplane_res;
if_data = ifp->info;
@@ -2699,10 +2706,10 @@ static int ip_address_install(struct vty *vty, struct interface *ifp,
if_refresh(ifp);
}
- ret = if_set_prefix(ifp, ifc);
- if (ret < 0) {
+ dplane_res = dplane_intf_addr_set(ifp, ifc);
+ if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
vty_out(vty, "%% Can't set interface IP address: %s.\n",
- safe_strerror(errno));
+ dplane_res2str(dplane_res));
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2723,6 +2730,7 @@ static int ip_address_uninstall(struct vty *vty, struct interface *ifp,
struct prefix_ipv4 lp, pp;
struct connected *ifc;
int ret;
+ enum zebra_dplane_result dplane_res;
/* Convert to prefix structure. */
ret = str2prefix_ipv4(addr_str, &lp);
@@ -2767,10 +2775,10 @@ static int ip_address_uninstall(struct vty *vty, struct interface *ifp,
}
/* This is real route. */
- ret = if_unset_prefix(ifp, ifc);
- if (ret < 0) {
+ dplane_res = dplane_intf_addr_unset(ifp, ifc);
+ if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
vty_out(vty, "%% Can't unset interface IP address: %s.\n",
- safe_strerror(errno));
+ dplane_res2str(dplane_res));
return CMD_WARNING_CONFIG_FAILED;
}
UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
@@ -2877,6 +2885,7 @@ static int ipv6_address_install(struct vty *vty, struct interface *ifp,
struct connected *ifc;
struct prefix_ipv6 *p;
int ret;
+ enum zebra_dplane_result dplane_res;
if_data = ifp->info;
@@ -2923,11 +2932,10 @@ static int ipv6_address_install(struct vty *vty, struct interface *ifp,
if_refresh(ifp);
}
- ret = if_prefix_add_ipv6(ifp, ifc);
-
- if (ret < 0) {
+ dplane_res = dplane_intf_addr_set(ifp, ifc);
+ if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
vty_out(vty, "%% Can't set interface IP address: %s.\n",
- safe_strerror(errno));
+ dplane_res2str(dplane_res));
return CMD_WARNING_CONFIG_FAILED;
}
@@ -2961,6 +2969,7 @@ static int ipv6_address_uninstall(struct vty *vty, struct interface *ifp,
struct prefix_ipv6 cp;
struct connected *ifc;
int ret;
+ enum zebra_dplane_result dplane_res;
/* Convert to prefix structure. */
ret = str2prefix_ipv6(addr_str, &cp);
@@ -2991,10 +3000,10 @@ static int ipv6_address_uninstall(struct vty *vty, struct interface *ifp,
}
/* This is real route. */
- ret = if_prefix_delete_ipv6(ifp, ifc);
- if (ret < 0) {
+ dplane_res = dplane_intf_addr_unset(ifp, ifc);
+ if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
vty_out(vty, "%% Can't unset interface IP address: %s.\n",
- safe_strerror(errno));
+ dplane_res2str(dplane_res));
return CMD_WARNING_CONFIG_FAILED;
}