Skip to content

Commit 19accb5

Browse files
yoursunnyigor-ivanov
authored andcommitted
Enable --client_ip flag in playback mode
refs #234 Signed-off-by: Junxiao Shi <[email protected]>
1 parent d7da90b commit 19accb5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/sockperf.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,16 @@ static int proc_mode_playback(int id, int argc, const char **argv) {
13161316
* List of supported under-load options.
13171317
*/
13181318
const AOPT_DESC self_opt_desc[] = {
1319+
{ OPT_CLIENTPORT,
1320+
AOPT_ARG,
1321+
aopt_set_literal(0),
1322+
aopt_set_string("client_port"),
1323+
"Force the client side to bind to a specific port (default = 0). " },
1324+
{ OPT_CLIENTADDR,
1325+
AOPT_ARG,
1326+
aopt_set_literal(0),
1327+
aopt_set_string("client_ip", "client_addr"),
1328+
"Force the client side to bind to a specific address in IPv4, IPv6, UNIX domain socket format (default = 0). " },
13191329
{ OPT_REPLY_EVERY,
13201330
AOPT_ARG,
13211331
aopt_set_literal(0),
@@ -1461,6 +1471,11 @@ static int proc_mode_playback(int id, int argc, const char **argv) {
14611471
rc = SOCKPERF_ERR_BAD_ARGUMENT;
14621472
}
14631473

1474+
if (!rc) {
1475+
// --tcp option must be processed before
1476+
rc = parse_client_bind_info(common_obj, self_obj);
1477+
}
1478+
14641479
if (rc) {
14651480
const char *help_str = NULL;
14661481
char temp_buf[30];

0 commit comments

Comments
 (0)