summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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; }
;