@@ -240,12 +240,12 @@ get_ip_encap_overhead(const struct options *options, const struct link_socket_in
240240
241241static void
242242frame_calculate_fragment (struct frame * frame , struct key_type * kt , const struct options * options ,
243- struct link_socket_info * lsi )
243+ unsigned int crypto_flags , struct link_socket_info * lsi )
244244{
245245#if defined(ENABLE_FRAGMENT )
246246 size_t overhead ;
247247
248- overhead = frame_calculate_protocol_header_size (kt , options , false);
248+ overhead = frame_calculate_protocol_header_size (kt , options , crypto_flags , false);
249249
250250 if (options -> ce .fragment_encap )
251251 {
@@ -263,14 +263,14 @@ frame_calculate_fragment(struct frame *frame, struct key_type *kt, const struct
263263 {
264264 /* The packet id gets added to *each* fragment in CBC mode, so we need
265265 * to account for it */
266- frame -> max_fragment_size -= calc_packet_id_size_dc (options , kt );
266+ frame -> max_fragment_size -= calc_packet_id_size_dc (options , kt , crypto_flags );
267267 }
268268#endif
269269}
270270
271271static void
272272frame_calculate_mssfix (struct frame * frame , struct key_type * kt , const struct options * options ,
273- struct link_socket_info * lsi )
273+ unsigned int crypto_flags , struct link_socket_info * lsi )
274274{
275275 if (options -> ce .mssfix_fixed )
276276 {
@@ -282,11 +282,12 @@ frame_calculate_mssfix(struct frame *frame, struct key_type *kt, const struct op
282282
283283 size_t overhead , payload_overhead ;
284284
285- overhead = frame_calculate_protocol_header_size (kt , options , false);
285+ overhead = frame_calculate_protocol_header_size (kt , options , crypto_flags , false);
286286
287287 /* Calculate the number of bytes that the payload differs from the payload
288288 * MTU. This are fragment/compression/ethernet headers */
289- payload_overhead = frame_calculate_payload_overhead (frame -> extra_tun , options , kt );
289+ payload_overhead =
290+ frame_calculate_payload_overhead (frame -> extra_tun , options , kt , crypto_flags );
290291
291292 /* We are in a "liberal" position with respect to MSS,
292293 * i.e. we assume that MSS can be calculated from MTU
@@ -315,16 +316,16 @@ frame_calculate_mssfix(struct frame *frame, struct key_type *kt, const struct op
315316
316317void
317318frame_calculate_dynamic (struct frame * frame , struct key_type * kt , const struct options * options ,
318- struct link_socket_info * lsi )
319+ unsigned int crypto_flags , struct link_socket_info * lsi )
319320{
320321 if (options -> ce .fragment > 0 )
321322 {
322- frame_calculate_fragment (frame , kt , options , lsi );
323+ frame_calculate_fragment (frame , kt , options , crypto_flags , lsi );
323324 }
324325
325326 if (options -> ce .mssfix > 0 )
326327 {
327- frame_calculate_mssfix (frame , kt , options , lsi );
328+ frame_calculate_mssfix (frame , kt , options , crypto_flags , lsi );
328329 }
329330}
330331
@@ -354,7 +355,8 @@ frame_adjust_path_mtu(struct context *c)
354355 o -> ce .mssfix , mtustr , pmtu );
355356 o -> ce .mssfix = pmtu ;
356357 o -> ce .mssfix_encap = true;
357- frame_calculate_dynamic (& c -> c2 .frame , & c -> c1 .ks .key_type , o , lsi );
358+ frame_calculate_dynamic (& c -> c2 .frame , & c -> c1 .ks .key_type , o ,
359+ c -> c2 .crypto_options .flags , lsi );
358360 }
359361
360362#if defined(ENABLE_FRAGMENT )
@@ -367,7 +369,8 @@ frame_adjust_path_mtu(struct context *c)
367369 o -> ce .fragment , mtustr , pmtu );
368370 o -> ce .fragment = pmtu ;
369371 o -> ce .fragment_encap = true;
370- frame_calculate_dynamic (& c -> c2 .frame_fragment , & c -> c1 .ks .key_type , o , lsi );
372+ frame_calculate_dynamic (& c -> c2 .frame_fragment , & c -> c1 .ks .key_type , o ,
373+ c -> c2 .crypto_options .flags , lsi );
371374 }
372375#endif
373376}
0 commit comments