This patch adds passing the ESN flag to the kernel if ESN was negotiated
and the appropriate flag is present in the kernel headers, which will
be the case in future FreeBSD releases.
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Closes strongswan/strongswan#155.
sa->sadb_sa_replay = min(data->replay_window, 32);
#else
sa->sadb_sa_replay = min((data->replay_window + 7) / 8, UINT8_MAX);
+#endif
+ }
+ if (data->esn)
+ {
+#ifdef SADB_X_SAFLAGS_ESN
+ DBG2(DBG_KNL, " using extended sequence numbers (ESN)");
+ sa->sadb_sa_flags |= SADB_X_SAFLAGS_ESN;
+#else
+ DBG1(DBG_KNL, "extended sequence numbers (ESN) not supported by "
+ "kernel!");
+ return FAILED;
#endif
}
sa->sadb_sa_auth = lookup_algorithm(INTEGRITY_ALGORITHM, data->int_alg);