config: move packet mark support check to Bison file

This commit is contained in:
Matthias Schiffer 2015-03-23 05:27:06 +01:00
parent b2e576bb17
commit 6a529155f1
3 changed files with 7 additions and 4 deletions

View file

@ -545,10 +545,6 @@ void fastd_configure(int argc, char *const argv[]) {
/** Performs some basic checks on the configuration */ /** Performs some basic checks on the configuration */
static void config_check_base(void) { 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 */ /** Performs more checks on the configuration */

View file

@ -362,7 +362,12 @@ bind_default:
; ;
packet_mark: TOK_UINT { packet_mark: TOK_UINT {
#ifdef USE_PACKET_MARK
conf.packet_mark = $1; conf.packet_mark = $1;
#else
fastd_config_error(&@$, state, "setting a packet mark is not supported on this system");
YYERROR;
#endif
} }
mtu: TOK_UINT { mtu: TOK_UINT {

View file

@ -206,7 +206,9 @@ struct fastd_config {
uint16_t mtu; /**< The configured MTU */ uint16_t mtu; /**< The configured MTU */
fastd_mode_t mode; /**< The configured mode of operation */ fastd_mode_t mode; /**< The configured mode of operation */
#ifdef USE_PACKET_MARK
uint32_t packet_mark; /**< The configured packet mark (or 0) */ uint32_t packet_mark; /**< The configured packet mark (or 0) */
#endif
bool forward; /**< Specifies if packet forwarding is enable */ bool forward; /**< Specifies if packet forwarding is enable */
bool secure_handshakes; /**< Can be set to false to support connections with fastd versions before v11 */ bool secure_handshakes; /**< Can be set to false to support connections with fastd versions before v11 */