[spp] [PATCH 1/5] spp_nfv: chage to return msg of exit command

ogawa.yasufumi at lab.ntt.co.jp ogawa.yasufumi at lab.ntt.co.jp
Thu Oct 25 07:19:39 CEST 2018


From: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>

This patch is to fix error of receiving data of NfvProc in spp-ctl.
Spp_nfv returns no message after exit command while spp-ctl expects
to get any of message as a result. To fix, change to return empty
message.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
 src/nfv/nfv.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/nfv/nfv.c b/src/nfv/nfv.c
index 05290ed..84d3df4 100644
--- a/src/nfv/nfv.c
+++ b/src/nfv/nfv.c
@@ -926,6 +926,7 @@ main(int argc, char *argv[])
 	int connected = 0;
 	char str[MSG_SIZE];
 	unsigned int i;
+	int flg_exit;  // used as res of parse_command() to exit if -1
 	int ret;
 
 	ret = rte_eal_init(argc, argv);
@@ -1000,13 +1001,14 @@ main(int argc, char *argv[])
 
 		RTE_LOG(DEBUG, APP, "Received string: %s\n", str);
 
-		ret = parse_command(str);
-		if (ret < 0)  /* terminate process if exit is called */
-			break;
+		flg_exit = parse_command(str);
 
 		/*Send the message back to client*/
 		ret = do_send(&connected, &sock, str);
-		if (ret < 0)
+
+		if (flg_exit < 0)  /* terminate process if exit is called */
+			break;
+		else if (ret < 0)
 			continue;
 	}
 
-- 
2.7.4



More information about the spp mailing list