Skip to contentSkip to conversation

ipvsadm: Fix wrong format of -o option in FMT_RULE listing

PATCH New Krzysztof Gajdemski 1 participant 2 messages Mar 21, 2013 1 message not in the archive IPVS

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/2 ipvsadm: Fix wrong format of -o option in FMT_RULE listing

'ipvsadm -S' listed one-packet scheduling option in wrong format ('ops' instead of '--ops' or '-o') preventing any service with OPS feature from restoring using 'ipvsadm -R'. Now we use '-o' which works well with save/restore commands.

---
 ipvsadm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ipvsadm.c +1 -1
index 9afd125..587bfc1 100644
@@ -1487,7 +1487,7 @@ print_service_entry(ipvs_service_entry_t *se, unsigned int format)
 		if (se->pe_name[0])
 			printf(" pe %s", se->pe_name);
 		if (se->flags & IP_VS_SVC_F_ONEPACKET)
-			printf(" ops");
+			printf(" -o");
 	} else if (format & FMT_STATS) {
 		printf("%-33s", svc_name);
 		print_largenum(se->stats.conns, format);
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/2 ipvsadm: Show 'ops' flag regardless of service persistence

In reply to a message not in the archive

In print_service_entry() 'ops' option is displayed only for services which have the IP_VS_SVC_F_PERSISTENT flag set. However, it should be displayed for any VS with one-packet scheduling because OPS can be also used without persistence.

---
 ipvsadm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
ipvsadm.c +2 -2
index 587bfc1..45a71af 100644
@@ -1517,9 +1517,9 @@ print_service_entry(ipvs_service_entry_t *se, unsigned int format)
 					printf(" mask %i", se->netmask);
 			if (se->pe_name[0])
 				printf(" pe %s", se->pe_name);
-			if (se->flags & IP_VS_SVC_F_ONEPACKET)
-				printf(" ops");
 		}
+		if (se->flags & IP_VS_SVC_F_ONEPACKET)
+			printf(" ops");
 	}
 	printf("\n");
 
Signature · 1 line
1.7.10.4