summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-03-23 05:27:06 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-03-23 05:27:06 +0100
commit6a529155f1f826ace040dd85c8367132d45bde99 (patch)
tree8bc1c97aee5b731bd6222b8f283c6a3e9eccb7a5 /src
parentb2e576bb172fcce419e639216393126c94fc99fa (diff)
downloadfastd-6a529155f1f826ace040dd85c8367132d45bde99.tar
fastd-6a529155f1f826ace040dd85c8367132d45bde99.zip
config: move packet mark support check to Bison file
Diffstat (limited to 'src')
-rw-r--r--src/config.c4
-rw-r--r--src/config.y5
-rw-r--r--src/fastd.h2
3 files changed, 7 insertions, 4 deletions
diff --git a/src/config.c b/src/config.c
index 511d4e7..deb3208 100644
--- a/src/config.c
+++ b/src/config.c
@@ -545,10 +545,6 @@ void fastd_configure(int argc, char *const argv[]) {
/** Performs some basic checks on the configuration */
static void config_check_base(void) {
-#ifndef USE_PACKET_MARK
- if (conf.packet_mark)
- exit_error("config error: setting a packet mark is not supported on this system");
-#endif
}
/** Performs more checks on the configuration */
diff --git a/src/config.y b/src/config.y
index fb2ceee..a11460f 100644
--- a/src/config.y
+++ b/src/config.y
@@ -362,7 +362,12 @@ bind_default:
;
packet_mark: TOK_UINT {
+#ifdef USE_PACKET_MARK
conf.packet_mark = $1;
+#else
+ fastd_config_error(&@$, state, "setting a packet mark is not supported on this system");
+ YYERROR;
+#endif
}
mtu: TOK_UINT {
diff --git a/src/fastd.h b/src/fastd.h
index 212d439..b320c74 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -206,7 +206,9 @@ struct fastd_config {
uint16_t mtu; /**< The configured MTU */
fastd_mode_t mode; /**< The configured mode of operation */
+#ifdef USE_PACKET_MARK
uint32_t packet_mark; /**< The configured packet mark (or 0) */
+#endif
bool forward; /**< Specifies if packet forwarding is enable */
bool secure_handshakes; /**< Can be set to false to support connections with fastd versions before v11 */