diff --git a/cli/complete.c b/cli/complete.c index 69c446a09..05e6fa8ce 100644 --- a/cli/complete.c +++ b/cli/complete.c @@ -42,7 +42,7 @@ static struct ec_node *bash_complete_node(struct ec_node *cmdlist) { EC_NO_ID, ec_node("any", "prog_name"), ec_node_option(EC_NO_ID, grcli_options_node()), - cmdlist + ec_node_clone(cmdlist) ) ); } @@ -81,22 +81,23 @@ int bash_complete(struct ec_node *cmdlist) { if (comp_line == NULL) { errorf("COMP_LINE is not defined"); - goto end; + return ret; } if (comp_point == NULL) { errorf("COMP_POINT is not defined"); - goto end; + return ret; } if (ec_str_parse_ullint(comp_point, 10, 0, strlen(comp_line), &i) < 0) { errorf("invalid COMP_POINT value"); - goto end; + return ret; } - gr_strcpy(buf, i, comp_line); + memcpy(buf, comp_line, i); + buf[i] = '\0'; if ((cmdlist = bash_complete_node(cmdlist)) == NULL) { errorf("bash_complete_node: %s", strerror(errno)); - goto end; + return ret; } if ((vec = ec_strvec_sh_lex_str(buf, EC_STRVEC_TRAILSP, NULL)) == NULL) { diff --git a/modules/l2/cli/vxlan.c b/modules/l2/cli/vxlan.c index 196da0511..a56d638c8 100644 --- a/modules/l2/cli/vxlan.c +++ b/modules/l2/cli/vxlan.c @@ -17,7 +17,7 @@ static void vxlan_show(struct gr_api_client *c, const struct gr_iface *iface, st const struct gr_iface_info_vxlan *vxlan = (const struct gr_iface_info_vxlan *)iface->info; gr_object_field(o, "vni", GR_DISP_INT, "%u", vxlan->vni); - gr_object_field(o, "local", 0, IP4_F, &vxlan->local); + gr_object_field(o, "local", 0, ADDR_F, ADDR_W(vxlan->local.af), &vxlan->local.addr); gr_object_field(o, "encap_vrf", 0, "%s", iface_name_from_id(c, vxlan->encap_vrf_id)); gr_object_field(o, "dst_port", GR_DISP_INT, "%u", vxlan->dst_port); gr_object_field(o, "mac", 0, ETH_F, &vxlan->mac); @@ -30,9 +30,10 @@ vxlan_list_info(struct gr_api_client *c, const struct gr_iface *iface, char *buf snprintf( buf, len, - "vni=%u local=" IP4_F " encap_vrf=%s", + "vni=%u local=" ADDR_F " encap_vrf=%s", vxlan->vni, - &vxlan->local, + ADDR_W(vxlan->local.af), + &vxlan->local.addr, iface_name_from_id(c, vxlan->encap_vrf_id) ); }