summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-10-29 22:48:06 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-10-29 22:48:06 +0100
commit2f021fd3e127da7ef80106e8e09c6fbb75be56c2 (patch)
tree86ac93b56452955b7d6e03c869049107c51bc7d4
parent2c6a4b5c117fc2a2a5ba730ffc86e75d71140200 (diff)
downloadfastd-2f021fd3e127da7ef80106e8e09c6fbb75be56c2.tar
fastd-2f021fd3e127da7ef80106e8e09c6fbb75be56c2.zip
Allow setting bind interface
-rw-r--r--src/config.y14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/config.y b/src/config.y
index d87c151..0693294 100644
--- a/src/config.y
+++ b/src/config.y
@@ -192,22 +192,23 @@ bind_new: {
addr->next = conf->bind_addrs;
conf->bind_addrs = addr;
}
+ ;
-bind: bind_new TOK_ADDR maybe_port {
+bind: bind_new TOK_ADDR maybe_port maybe_bind_to_device {
conf->bind_addrs->addr.in.sin_family = AF_INET;
conf->bind_addrs->addr.in.sin_addr = $2;
conf->bind_addrs->addr.in.sin_port = htons($3);
if (!conf->bind_addr_default_v4)
conf->bind_addr_default_v4 = conf->bind_addrs;
}
- | bind_new TOK_ADDR6 maybe_port {
+ | bind_new TOK_ADDR6 maybe_port maybe_bind_to_device {
conf->bind_addrs->addr.in6.sin6_family = AF_INET6;
conf->bind_addrs->addr.in6.sin6_addr = $2;
conf->bind_addrs->addr.in6.sin6_port = htons($3);
if (!conf->bind_addr_default_v6)
conf->bind_addr_default_v6 = conf->bind_addrs;
}
- | bind_new TOK_ANY maybe_port {
+ | bind_new TOK_ANY maybe_port maybe_bind_to_device {
conf->bind_addrs->addr.in.sin_port = htons($3);
if (!conf->bind_addr_default_v4)
conf->bind_addr_default_v4 = conf->bind_addrs;
@@ -216,6 +217,13 @@ bind: bind_new TOK_ADDR maybe_port {
}
;
+maybe_bind_to_device:
+ TOK_INTERFACE TOK_STRING {
+ conf->bind_addrs->bindtodev = strdup($2->str);
+ }
+ | {}
+ ;
+
mtu: TOK_INTEGER { conf->mtu = $1; }
;