osmo-ttcn3-hacks/remsim
Harald Welte 67881aef23 Avoid generating zero-length packets
I used the construct like f_rnd_octstring(f_rnd_int(100)) in a number
of places to generate random-length packets with randomized length.

The problem I didn't realize is that f_rnd_int() of course can also
return '0', which would generate zero-length packets.  This may be
permitted in some protocols, but it leads to problems e.g. when trying
to send a UDP packet of zero length (which the kernel will not do).

So let's introduce
* f_rnd_int_nonzero() for returning non-zero randomized integers
* f_rnd_octstring_rnd_len() for returning a random-length random payload
  octet string
* replace all f_rnd_octstring(f_rnd_int()) call sites with the new
  function.

Change-Id: I818a113ff8d2a2f7cab2ec7d9c8661607c6331d6
Closes: OS#5528
2022-04-12 22:52:47 +02:00
..
REMSIM_Tests.cfg remsim: Add tests using stdin/stdout of osmo-remsim-client-shell 2020-02-19 19:56:30 +01:00
REMSIM_Tests.default HTTP_Adapter: split into f_http_tx_request() / f_http_rx_response() 2021-02-22 10:41:29 +00:00
REMSIM_Tests.ttcn library/IPA: use tr_ASP_IPA_EV instead of inline templates 2020-05-18 21:16:35 +07:00
RSPRO.asn treewide: remove FSF address 2021-12-14 12:23:26 +01:00
RSPRO_EncDec.cc Initial TTCN-3 test suite for osmo-remsim 2019-09-13 11:45:45 +00:00
RSPRO_Server.ttcn RSPRO_Server: Ignore any ID RESP messages from the client for now 2020-12-01 12:06:33 +00:00
RSPRO_Types.ttcn remsim: Update RSPRO for ResetState{Req,Res} messages 2019-12-04 21:55:05 +01:00
RSRES.ttcn Initial TTCN-3 test suite for osmo-remsim 2019-09-13 11:45:45 +00:00
RemsimBankd_Tests.ttcn remsim: add the guard timeout to all test cases 2021-02-28 17:12:32 +01:00
RemsimClient_Tests.ttcn Avoid generating zero-length packets 2022-04-12 22:52:47 +02:00
RemsimServer_Tests.ttcn remsim: add the guard timeout to all test cases 2021-02-28 17:12:32 +01:00
gen_links.sh remsim: factor-out HTTP_Adapter.ttcn 2021-02-22 10:41:29 +00:00
regen_makefile.sh regen_makefile.sh: set executable name explicitly 2021-10-13 11:12:22 +02:00