diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-07-25 12:03:31 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-07-25 12:03:31 +0200 |
commit | 530c6eaf60cb76ab79b326c348b2039ed396e687 (patch) | |
tree | a0471a71628449483204e814c707d634a7b0e494 /src | |
parent | aaa2e11810cfcb724a24154ee311cd9e702ba799 (diff) | |
download | fastd-530c6eaf60cb76ab79b326c348b2039ed396e687.tar fastd-530c6eaf60cb76ab79b326c348b2039ed396e687.zip |
Make PMTU discovery configurable
Diffstat (limited to 'src')
-rw-r--r-- | src/config.l | 2 | ||||
-rw-r--r-- | src/config.y | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/config.l b/src/config.l index 6ba2fa1..53b52d6 100644 --- a/src/config.l +++ b/src/config.l @@ -60,6 +60,7 @@ interface { TOKEN(TOK_INTERFACE); } bind { TOKEN(TOK_BIND); } mtu { TOKEN(TOK_MTU); } +pmtu { TOKEN(TOK_PMTU); } mode { TOKEN(TOK_MODE); } protocol { TOKEN(TOK_PROTOCOL); } method { TOKEN(TOK_METHOD); } @@ -111,6 +112,7 @@ hide { TOKEN(TOK_HIDE); } ip { TOKEN(TOK_IP); } mac { TOKEN(TOK_MAC); } addresses { TOKEN(TOK_ADDRESSES); } +auto { TOKEN(TOK_AUTO); } [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} { UPDATE_LOCATION; diff --git a/src/config.y b/src/config.y index fde2873..e0fa412 100644 --- a/src/config.y +++ b/src/config.y @@ -45,6 +45,7 @@ fastd_string_stack_t *str; char *error; bool boolean; + fastd_tristate_t tristate; struct in_addr addr4; struct in6_addr addr6; fastd_peer_address_t addr; @@ -60,6 +61,7 @@ %token TOK_INTERFACE %token TOK_BIND %token TOK_MTU +%token TOK_PMTU %token TOK_MODE %token TOK_PROTOCOL %token TOK_METHOD @@ -111,6 +113,7 @@ %token TOK_IP %token TOK_MAC %token TOK_ADDRESSES +%token TOK_AUTO %token <addr4> TOK_ADDR4 %token <addr6> TOK_ADDR6 @@ -139,6 +142,7 @@ %type <num> maybe_bind_default %type <num> bind_default %type <num> drop_capabilities_enabled +%type <tristate> autobool %% start: START_CONFIG config @@ -164,6 +168,7 @@ statement: peer_group_statement | TOK_INTERFACE interface ';' | TOK_BIND bind ';' | TOK_MTU mtu ';' + | TOK_PMTU pmtu ';' | TOK_MODE mode ';' | TOK_PROTOCOL protocol ';' | TOK_METHOD method ';' @@ -304,6 +309,9 @@ bind_default: mtu: TOK_INTEGER { conf->mtu = $1; } ; +pmtu: autobool { conf->pmtu = $1; } + ; + mode: TOK_TAP { conf->mode = MODE_TAP; } | TOK_TUN { conf->mode = MODE_TUN; } ; @@ -511,6 +519,10 @@ boolean: TOK_YES { $$ = true; } | TOK_NO { $$ = false; } ; +autobool: TOK_AUTO { $$ = (fastd_tristate_t){ .set = false }; } + | boolean { $$ = (fastd_tristate_t){ .set = true, .state = $1 }; } + ; + colon_or_port: ':' | TOK_PORT ; @@ -523,6 +535,7 @@ port: colon_or_port TOK_INTEGER { $$ = $2; } ; + %% void fastd_config_error(YYLTYPE *loc, fastd_context_t *ctx, fastd_config_t *conf, const char *filename, int depth, char *s) { pr_error(ctx, "config error: %s at %s:%i:%i", s, filename, loc->first_line, loc->first_column); |