diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2021-12-10 11:27:27 +0200 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2021-12-22 09:25:13 +0200 |
commit | d360c6feb61f84c5d7bb1a8be6cd3c9aaad27bae (patch) | |
tree | 292b75e0b12dd9c9d6840bce6dcafae0a3199904 | |
parent | 23b4dec2aff82050dad0a278ab3b6904b8981e3c (diff) |
example: ipsec_crypto: remove unnecessary IP ID randomization
Randomizing the initial IP ID (fragment identification) value of a
tunnel may reduce IP ID clashes, but there does not seem to be any
clear benefit of jumping to a new random ID value when the ID wraps
around. Remove the re-randomization to make the code simpler.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
-rw-r--r-- | example/ipsec_crypto/odp_ipsec.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/example/ipsec_crypto/odp_ipsec.c b/example/ipsec_crypto/odp_ipsec.c index 647755755..c6a64399f 100644 --- a/example/ipsec_crypto/odp_ipsec.c +++ b/example/ipsec_crypto/odp_ipsec.c @@ -974,20 +974,9 @@ pkt_disposition_e do_ipsec_out_seq(odp_packet_t *pkt, } if (ctx->ipsec.tun_hdr_offset) { odph_ipv4hdr_t *ip; - int ret; ip = (odph_ipv4hdr_t *)(ctx->ipsec.tun_hdr_offset + buf); ip->id = odp_cpu_to_be_16((*ctx->ipsec.tun_hdr_id)++); - if (!ip->id) { - /* re-init tunnel hdr id */ - ret = odp_random_data((uint8_t *)ctx->ipsec.tun_hdr_id, - sizeof(*ctx->ipsec.tun_hdr_id), - 1); - if (ret != sizeof(*ctx->ipsec.tun_hdr_id)) { - ODPH_ERR("Error: Not enough random data\n"); - exit(EXIT_FAILURE); - } - } } out_pkt = entry->in_place ? *pkt : ODP_PACKET_INVALID; |