[OpenWrt-Devel] [PATCH] openl2tp - finally enable config file option

Bogdan Roman abr28 at cam.ac.uk
Mon Oct 17 19:34:50 CEST 2011


Until now the openl2tpg package only allowed configuration through RPC 
by using the l2tpconfig command, making many some tasks difficult. 
Discussion exists at https://dev.openwrt.org/ticket/10164 . Enabling the 
config file option requires working around the flex library ( (libfl) 
and a few compile fixes. The following 2 patches enable the config file 
option in addition to the RPC option. Tested against trunk r28428. Note 
that the openwrt openl2tp package is still not fully finished, e.g. a 
proper init.d script and sample conf files should be included, see 
build_dir/*/openl2tp-1.8/{etc,ipsec}/*. I may sort that out as well later.

Signed-off-by: Bogdan Roman <abr28 at cam.ac.uk>


File: 020-makefile-conf-file.patch

--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ L2TP_FEATURE_LAIC_SUPPORT=  y
  L2TP_FEATURE_LAOC_SUPPORT= y
  L2TP_FEATURE_LNIC_SUPPORT= y
  L2TP_FEATURE_LNOC_SUPPORT= y
-#L2TP_FEATURE_LOCAL_CONF_FILE= y
+L2TP_FEATURE_LOCAL_CONF_FILE=  y
  #L2TP_FEATURE_LOCAL_STAT_FILE= y

  # Define USE_DMALLOC to enable dmalloc memory debugging
@@ -204,7 +204,7 @@ ifeq ($(L2TP_FEATURE_LOCAL_CONF_FILE),y)
  # Config file parser
  LEX=           flex
  YACC=          bison
-LDFLAGS.l2tpd+=        -lfl
+#LDFLAGS.l2tpd+=       -lfl
  %.c:   %.l
             $(LEX) -o$@ $<

@@ -212,10 +212,10 @@ LDFLAGS.l2tpd+=       -lfl
             $(YACC) -d -o l2tp_config_parse.c $<

  l2tp_config_token.o:   l2tp_config_token.c
-           $(CC) -I. -MMD -w $(CFLAGS.optimize) -c -DYY_NO_UNPUT $<
+           $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) 
-DYY_NO_UNPUT $<

  l2tp_config_parse.o:   l2tp_config_parse.c l2tp_config_parse.h
-           $(CC) -I. -MMD -w $(CFLAGS.optimize) -c -DYY_NO_UNPUT $<
+           $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) 
-DYY_NO_UNPUT $<
  endif

  # Compile without -Wall because rpcgen-generated code is full of warnings.


File: 020-conf-no-libfl.patch

--- a/l2tp_config_token.l
+++ b/l2tp_config_token.l
@@ -23,6 +23,8 @@ static int resolveip(const char *val, st
  int lineno;
  int command;
.
+int yywrap(void) { return 1; }
+
  %}
.
  /* common section */


-- 
Bogdan Roman, http://www.cl.cam.ac.uk/~abr28/


More information about the openwrt-devel mailing list