Skip to contentSkip to conversation

ip nexthop: Add space to display properly when showing a group

PATCH In review Donald Sharp 2 participants 2 messages Aug 10, 2019 – Aug 12, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ip nexthop: Add space to display properly when showing a group

When displaying a nexthop group made up of other nexthops, the display line shows this when you have additional data at the end:

id 42 group 43/44/45/46/47/48/49/50/51/52/53/54/55/56/57/58/59/60/61/62/63/64/65/66/67/68/69/70/71/72/73/74proto zebra

Modify code so that it shows:

id 42 group 43/44/45/46/47/48/49/50/51/52/53/54/55/56/57/58/59/60/61/62/63/64/65/66/67/68/69/70/71/72/73/74 proto zebra

---
 ip/ipnexthop.c | 1 +
 1 file changed, 1 insertion(+)
ip/ipnexthop.c +1 -0
index 97f09e74..f35aab52 100644
@@ -186,6 +186,7 @@ static void print_nh_group(FILE *fp, const struct rtattr *grps_attr)
 
 		close_json_object();
 	}
+	print_string(PRINT_FP, NULL, "%s", " ");
 	close_json_array(PRINT_JSON, NULL);
 }
 
Signature · 1 line
2.21.0
Reviewed-by on v1 1/2
#1 lore raw
Quoted 20 lines · Donald Sharp

When displaying a nexthop group made up of other nexthops, the display line shows this when you have additional data at the end:

id 42 group 43/44/45/46/47/48/49/50/51/52/53/54/55/56/57/58/59/60/61/62/63/64/65/66/67/68/69/70/71/72/73/74proto zebra

Modify code so that it shows:

id 42 group 43/44/45/46/47/48/49/50/51/52/53/54/55/56/57/58/59/60/61/62/63/64/65/66/67/68/69/70/71/72/73/74 proto zebra

---
 ip/ipnexthop.c | 1 +
 1 file changed, 1 insertion(+)
ip/ipnexthop.c +0 -0
index 97f09e74..f35aab52 100644

ip/ipnexthop.c static void print_nh_group(FILE *fp, const struct rtattr *grps_attr) · line 192

Quoted 7 lines
ip/ipnexthop.c +1 -0
@@ -186,6 +186,7 @@ static void print_nh_group(FILE *fp, const struct rtattr *grps_attr)
 
 		close_json_object();
 	}
+	print_string(PRINT_FP, NULL, "%s", " ");
 	close_json_array(PRINT_JSON, NULL);
 }
 

Looks right to me:

Stephen: this should go through your tree.