diff options
author | Jan Moskyto Matejka <mq@ucw.cz> | 2015-12-11 15:35:37 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2015-12-19 15:57:09 +0100 |
commit | d7661fbe9dea980c61daa01a11a9aa59fa7be426 (patch) | |
tree | ba6c715e5b4cb1ba638dc5b75e14008a0e6f5e84 /conf | |
parent | 9b136840d90cce887cd139054c3f0a7d8b9f57d2 (diff) |
Removed BITS_PER_IP_ADDRESS, MAX_PREFIX_LENGTH, BIRD_AF
Explicit setting of AF_INET(6|) in IP socket creation. BFD set to listen
on v6, without setting the V6ONLY flag to catch both v4 and v6 traffic.
Squashing and minor changes by Ondrej Santiago Zajicek
Diffstat (limited to 'conf')
-rw-r--r-- | conf/confbase.Y | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y index 3ad0c5f0..4bf9599b 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -76,11 +76,10 @@ CF_DECLS %token <t> TEXT %type <iface> ipa_scope -%type <i> expr bool pxlen +%type <i> expr bool pxlen4 pxlen6 %type <i32> expr_us %type <time> datetime %type <a> ipa ipa_raw -%type <px> prefix %type <net> net_ip4 net_ip6 net_ip net_or_ipa %type <net_ptr> net_any @@ -175,9 +174,9 @@ ipa_scope: /* XXXX - symbols and tests */ -net_ip4: IP4 pxlen { $$.ip4 = NET_ADDR_IP4($1, $2); } +net_ip4: IP4 pxlen4 { $$.ip4 = NET_ADDR_IP4($1, $2); } -net_ip6: IP6 pxlen { $$.ip6 = NET_ADDR_IP6($1, $2); } +net_ip6: IP6 pxlen6 { $$.ip6 = NET_ADDR_IP6($1, $2); } net_ip: net_ip4 | net_ip6 ; @@ -191,22 +190,22 @@ net_or_ipa: ; -prefix: - ipa pxlen { - if (!ip_is_prefix($1, $2)) cf_error("Invalid prefix"); - $$.addr = $1; $$.len = $2; +pxlen4: + '/' expr { + if ($2 < 0 || $2 > IP4_MAX_PREFIX_LENGTH) cf_error("Invalid prefix length %d", $2); + $$ = $2; + } + | ':' IP4 { + $$ = ip4_masklen($2); + if ($$ < 0) cf_error("Invalid netmask %I", $2); } ; -pxlen: +pxlen6: '/' expr { - if ($2 < 0 || $2 > BITS_PER_IP_ADDRESS) cf_error("Invalid prefix length %d", $2); + if ($2 < 0 || $2 > IP6_MAX_PREFIX_LENGTH) cf_error("Invalid prefix length %d", $2); $$ = $2; } - | ':' ipa { - $$ = ipa_masklen($2); - if ($$ < 0) cf_error("Invalid netmask %I", $2); - } ; datetime: |