diff options
-rw-r--r-- | contrib/ofed/librdmacm/examples/rping.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/ofed/librdmacm/examples/rping.c b/contrib/ofed/librdmacm/examples/rping.c index 144816244d4b..adae9f6f156b 100644 --- a/contrib/ofed/librdmacm/examples/rping.c +++ b/contrib/ofed/librdmacm/examples/rping.c @@ -1177,10 +1177,14 @@ int main(int argc, char *argv[]) cb->server = -1; cb->state = IDLE; cb->size = 64; - cb->sin.ss_family = PF_INET; cb->port = htobe16(7174); sem_init(&cb->sem, 0, 0); + /* initialize sockaddr structure with defaults */ + ret = get_addr("0.0.0.0", (struct sockaddr *) &cb->sin); + if (ret) + goto out; + opterr = 0; while ((op=getopt(argc, argv, "a:I:Pp:C:S:t:scvVd")) != -1) { switch (op) { |