You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB

  1. From d95ae843845760aecbbc62a734c2b93b401b1834 Mon Sep 17 00:00:00 2001
  2. Message-Id: <d95ae843845760aecbbc62a734c2b93b401b1834.1624798048.git.mschiffer@universe-factory.net>
  3. From: Matthias Schiffer <mschiffer@universe-factory.net>
  4. Date: Sun, 27 Jun 2021 14:45:46 +0200
  5. Subject: [PATCH] config: allow disabling L2TP offload when fastd doesn't
  6. support it
  7. Only attempting to enable the offloading should raise an error when it
  8. is not supported.
  9. ---
  10. src/config.y | 8 +++++---
  11. 1 file changed, 5 insertions(+), 3 deletions(-)
  12. --- a/src/config.y
  13. +++ b/src/config.y
  14. @@ -282,12 +282,14 @@ offload: TOK_L2TP boolean {
  15. #ifdef WITH_OFFLOAD_L2TP
  16. conf.offload_l2tp = $2;
  17. #else
  18. + if ($2) {
  19. # ifdef __linux__
  20. - fastd_config_error(&@$, state, "L2TP offload is not supported by this build of fastd");
  21. + fastd_config_error(&@$, state, "L2TP offload is not supported by this build of fastd");
  22. # else
  23. - fastd_config_error(&@$, state, "L2TP offload is not supported on this platform");
  24. + fastd_config_error(&@$, state, "L2TP offload is not supported on this platform");
  25. # endif
  26. - YYERROR;
  27. + YYERROR;
  28. + }
  29. #endif
  30. }
  31. ;