diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-06-08 12:18:16 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-06-08 12:18:16 +0200 |
commit | 4324025f981a8f545cc28ab16426ab7c2d1843cd (patch) | |
tree | 758113142daa2d8fa57c11e2b4955b74df9fe4ff /proto/babel/config.Y | |
parent | 801fd81efea5bf51fe459d951e4be95119798b2b (diff) |
Babel: Add support for dual-stack IPv4/IPv6 operation
This adds support for dual-stack v4/v6 operation to the Babel protocol.
Routing messages will be exchanged over IPv6, but IPv4 routes can be
carried in the messages being exchanged. This matches how the reference
Babel implementation (babeld) works.
The nexthop address for v4 can be configured per interface, and will
default to the first available IPv4 address on the given interface. For
symmetry, a configuration option to configure the IPv6 nexthop address
is also added.
Thanks to Toke Høiland-Jørgensen <toke@toke.dk> for the patch.
Diffstat (limited to 'proto/babel/config.Y')
-rw-r--r-- | proto/babel/config.Y | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/proto/babel/config.Y b/proto/babel/config.Y index cf8983fa..93c92790 100644 --- a/proto/babel/config.Y +++ b/proto/babel/config.Y @@ -21,7 +21,8 @@ CF_DEFINES CF_DECLS CF_KEYWORDS(BABEL, METRIC, RXCOST, HELLO, UPDATE, INTERVAL, PORT, WIRED, -WIRELESS, RX, TX, BUFFER, LENGTH, CHECK, LINK, BABEL_METRIC) + WIRELESS, RX, TX, BUFFER, LENGTH, CHECK, LINK, BABEL_METRIC, NEXT, HOP, + IPV4, IPV6) CF_GRAMMAR @@ -30,7 +31,6 @@ CF_ADDTO(proto, babel_proto) babel_proto_start: proto_start BABEL { this_proto = proto_config_new(&proto_babel, $1); - this_proto->net_type = NET_IP6; init_list(&BABEL_CFG->iface_list); }; @@ -98,6 +98,8 @@ babel_iface_item: | TX tos { BABEL_IFACE->tx_tos = $2; } | TX PRIORITY expr { BABEL_IFACE->tx_priority = $3; } | CHECK LINK bool { BABEL_IFACE->check_link = $3; } + | NEXT HOP IPV4 ipa { BABEL_IFACE->next_hop_ip4 = $4; if (!ipa_is_ip4($4)) cf_error("Must be an IPv4 address"); } + | NEXT HOP IPV6 ipa { BABEL_IFACE->next_hop_ip6 = $4; if (!ipa_is_ip6($4)) cf_error("Must be an IPv6 address"); } ; babel_iface_opts: |