Feature #423

ipsec.conf can't include more then 20 files

Added by Piyush Patel over 8 years ago. Updated over 7 years ago.

Target version:
Start date:
Due date:
Estimated time:


When I have large number of includes ipsec daemon won't startup. It errors out with:

max inclusion depth reached []

Below patch increases the limit to larger number:

*** strongswan-5.1.0/src/starter/lexer.c.orig   2013-09-03 08:22:07.497059596
--- strongswan-5.1.0/src/starter/lexer.c    2013-09-03 08:20:42.644574870 -0700
*** 513,519 ****

  #include "parser.h" 

! #define MAX_INCLUDE_DEPTH  20

  extern void yyerror(const char *);
  extern int yylex(void);
--- 513,519 ----

  #include "parser.h" 

! #define MAX_INCLUDE_DEPTH  4096

  extern void yyerror(const char *);
  extern int yylex(void);

strongswan-include.patch (6.07 KB) strongswan-include.patch support for larger include file globs Joe Crayne, 22.11.2013 23:49

Associated revisions

Revision 63642192
Added by Tobias Brunner over 7 years ago

Merge branch 'ipsec.conf-parser'

Replaces the ipsec.conf parser in starter. The new parser is also based
on flex/bison but it simply returns key/value collections of all sections.
It already resolves also= and allows overriding options in all included
sections (not only %default), options set in included section can also
be cleared again (key=). It provides other improvements too, like quoted
strings (with escape sequences), unlimited includes and better
whitespace/comment handling.

Fixes #423.
Fixes #560.


#1 Updated by Joe Crayne about 8 years ago

The issue is related to file globs. Entering a file from an expanded glob shouldn't be considered as entering a nested include.

I've done work to resolve this issue.

A side effect of the attached patch is that you can now include multiple space-delimited files with a single directive.

#2 Updated by Tobias Brunner over 7 years ago

  • Tracker changed from Issue to Feature
  • Category set to starter
  • Status changed from New to Closed
  • Assignee set to Tobias Brunner
  • Target version set to 5.2.0
  • Resolution set to Fixed

Fixed with the associated merge.

Also available in: Atom PDF