diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-05-25 10:43:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:52:55 -0500 |
commit | 18a4d22880a31dbf39076f77d2d898fa078b139e (patch) | |
tree | be31dba9cda0c95c56b7c3837ffad529df5f099f | |
parent | c31e144a2d7cb24b866bf95cb27da80f8728c857 (diff) | |
download | samba-18a4d22880a31dbf39076f77d2d898fa078b139e.tar.gz samba-18a4d22880a31dbf39076f77d2d898fa078b139e.tar.bz2 samba-18a4d22880a31dbf39076f77d2d898fa078b139e.zip |
r23139: use echo operations once a second in lockbench and openbench to ensure
we detect IP takeover on servers
(This used to be commit b5292a25edf1c071dea19877fb6b31f2501132ef)
-rw-r--r-- | source4/torture/raw/lockbench.c | 10 | ||||
-rw-r--r-- | source4/torture/raw/openbench.c | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c index 508ef88864..7ec8844cdc 100644 --- a/source4/torture/raw/lockbench.c +++ b/source4/torture/raw/lockbench.c @@ -257,6 +257,16 @@ static void report_rate(struct event_context *ev, struct timed_event *te, printf("\r"); fflush(stdout); event_add_timed(ev, state, timeval_current_ofs(1, 0), report_rate, state); + + /* send an echo on each interface to ensure it stays alive - this helps + with IP takeover */ + for (i=0;i<nprocs;i++) { + struct smb_echo p; + p.in.repeat_count = 0; + p.in.size = 0; + p.in.data = NULL; + smb_raw_echo_send(state[i].tree->session->transport, &p); + } } /* diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c index 0f4cab4062..537f67ea3a 100644 --- a/source4/torture/raw/openbench.c +++ b/source4/torture/raw/openbench.c @@ -297,6 +297,16 @@ static void report_rate(struct event_context *ev, struct timed_event *te, printf("\r"); fflush(stdout); event_add_timed(ev, state, timeval_current_ofs(1, 0), report_rate, state); + + /* send an echo on each interface to ensure it stays alive - this helps + with IP takeover */ + for (i=0;i<nprocs;i++) { + struct smb_echo p; + p.in.repeat_count = 0; + p.in.size = 0; + p.in.data = NULL; + smb_raw_echo_send(state[i].tree->session->transport, &p); + } } /* @@ -355,6 +365,7 @@ BOOL torture_bench_open(struct torture_context *torture) state[i].fnum = smbcli_open(state[i].tree, fnames[state->file_num], O_RDWR|O_CREAT, DENY_ALL); + state[i].old_fnum = state[i].fnum; state[i].stage = OPEN_OPEN; next_operation(&state[i]); } |