@@ -301,6 +301,16 @@ static int verify_newsa_info(struct xfrm_usersa_info *p,
301
301
NL_SET_ERR_MSG (extack , "TFC padding can only be used in tunnel mode" );
302
302
goto out ;
303
303
}
304
+ if ((attrs [XFRMA_IPTFS_DROP_TIME ] ||
305
+ attrs [XFRMA_IPTFS_REORDER_WINDOW ] ||
306
+ attrs [XFRMA_IPTFS_DONT_FRAG ] ||
307
+ attrs [XFRMA_IPTFS_INIT_DELAY ] ||
308
+ attrs [XFRMA_IPTFS_MAX_QSIZE ] ||
309
+ attrs [XFRMA_IPTFS_PKT_SIZE ]) &&
310
+ p -> mode != XFRM_MODE_IPTFS ) {
311
+ NL_SET_ERR_MSG (extack , "IP-TFS options can only be used in IP-TFS mode" );
312
+ goto out ;
313
+ }
304
314
break ;
305
315
306
316
case IPPROTO_COMP :
@@ -421,6 +431,18 @@ static int verify_newsa_info(struct xfrm_usersa_info *p,
421
431
goto out ;
422
432
}
423
433
434
+ if (attrs [XFRMA_IPTFS_DROP_TIME ]) {
435
+ NL_SET_ERR_MSG (extack , "IP-TFS drop time should not be set for output SA" );
436
+ err = - EINVAL ;
437
+ goto out ;
438
+ }
439
+
440
+ if (attrs [XFRMA_IPTFS_REORDER_WINDOW ]) {
441
+ NL_SET_ERR_MSG (extack , "IP-TFS reorder window should not be set for output SA" );
442
+ err = - EINVAL ;
443
+ goto out ;
444
+ }
445
+
424
446
if (attrs [XFRMA_REPLAY_VAL ]) {
425
447
struct xfrm_replay_state * replay ;
426
448
@@ -458,6 +480,30 @@ static int verify_newsa_info(struct xfrm_usersa_info *p,
458
480
}
459
481
460
482
}
483
+
484
+ if (attrs [XFRMA_IPTFS_DONT_FRAG ]) {
485
+ NL_SET_ERR_MSG (extack , "IP-TFS don't fragment should not be set for input SA" );
486
+ err = - EINVAL ;
487
+ goto out ;
488
+ }
489
+
490
+ if (attrs [XFRMA_IPTFS_INIT_DELAY ]) {
491
+ NL_SET_ERR_MSG (extack , "IP-TFS initial delay should not be set for input SA" );
492
+ err = - EINVAL ;
493
+ goto out ;
494
+ }
495
+
496
+ if (attrs [XFRMA_IPTFS_MAX_QSIZE ]) {
497
+ NL_SET_ERR_MSG (extack , "IP-TFS max queue size should not be set for input SA" );
498
+ err = - EINVAL ;
499
+ goto out ;
500
+ }
501
+
502
+ if (attrs [XFRMA_IPTFS_PKT_SIZE ]) {
503
+ NL_SET_ERR_MSG (extack , "IP-TFS packet size should not be set for input SA" );
504
+ err = - EINVAL ;
505
+ goto out ;
506
+ }
461
507
}
462
508
463
509
if (!sa_dir && attrs [XFRMA_SA_PCPU ]) {
@@ -3220,6 +3266,12 @@ const struct nla_policy xfrma_policy[XFRMA_MAX+1] = {
3220
3266
[XFRMA_SA_DIR ] = NLA_POLICY_RANGE (NLA_U8 , XFRM_SA_DIR_IN , XFRM_SA_DIR_OUT ),
3221
3267
[XFRMA_NAT_KEEPALIVE_INTERVAL ] = { .type = NLA_U32 },
3222
3268
[XFRMA_SA_PCPU ] = { .type = NLA_U32 },
3269
+ [XFRMA_IPTFS_DROP_TIME ] = { .type = NLA_U32 },
3270
+ [XFRMA_IPTFS_REORDER_WINDOW ] = { .type = NLA_U16 },
3271
+ [XFRMA_IPTFS_DONT_FRAG ] = { .type = NLA_FLAG },
3272
+ [XFRMA_IPTFS_INIT_DELAY ] = { .type = NLA_U32 },
3273
+ [XFRMA_IPTFS_MAX_QSIZE ] = { .type = NLA_U32 },
3274
+ [XFRMA_IPTFS_PKT_SIZE ] = { .type = NLA_U32 },
3223
3275
};
3224
3276
EXPORT_SYMBOL_GPL (xfrma_policy );
3225
3277
0 commit comments