]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Change default for BGP IPv6 socket to V6ONLY.
authorOndrej Zajicek <santiago@crfreenet.org>
Wed, 3 Nov 2010 09:02:24 +0000 (10:02 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Wed, 3 Nov 2010 09:02:24 +0000 (10:02 +0100)
Also add a new option 'dual' for the old behavior.

doc/bird.sgml
nest/config.Y
proto/bgp/bgp.c

index a760b9db3d87c85e097a6b91609bd4b689b80462..53d9fcd075e4b986036fe9e5910b17e132ee2b41 100644 (file)
@@ -270,14 +270,15 @@ protocol rip {
 
        <tag>router id <m/IPv4 address/</tag> Set BIRD's router ID. It's a world-wide unique identification of your router, usually one of router's IPv4 addresses. Default: in IPv4 version, the lowest IP address of a non-loopback interface. In IPv6 version, this option is mandatory. 
 
-       <tag>listen bgp [address <m/address/] [port <m/port/] [v6only]</tag>
+       <tag>listen bgp [address <m/address/] [port <m/port/] [dual]</tag>
        This option allows to specify address and port where BGP
        protocol should listen. It is global option as listening
        socket is common to all BGP instances. Default is to listen on
        all addresses (0.0.0.0) and port 179. In IPv6 mode, option
-       <cf/v6only/ can be used to specify that BGP socket should
-       listen to IPv6 connections only. This is needed if you want to
-       run both bird and bird6 on the same port.
+       <cf/dual/ can be used to specify that BGP socket should accept
+       both IPv4 and IPv6 connections (but even in that case, BIRD
+       would accept IPv6 routes only). Such behavior was default in
+       older versions of BIRD.
 
        <tag>timeformat route|protocol|base|log "<m/format1/" [<m/limit/ "<m/format2/"]</tag>
        This option allows to specify a format of date/time used by
index 39cd9015f0f227fbab37d1b9a9a90caf0240b560..920a305410240605689cdc6f9813c520ae01d083 100644 (file)
@@ -44,7 +44,7 @@ CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
 CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS)
 CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES)
 CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREEXPORT, GENERATE)
-CF_KEYWORDS(LISTEN, BGP, V6ONLY, ADDRESS, PORT, PASSWORDS, DESCRIPTION)
+CF_KEYWORDS(LISTEN, BGP, V6ONLY, DUAL, ADDRESS, PORT, PASSWORDS, DESCRIPTION)
 CF_KEYWORDS(RELOAD, IN, OUT, MRTDUMP, MESSAGES, RESTRICT, MEMORY, IGP_METRIC)
 
 CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
@@ -97,7 +97,8 @@ listen_opts:
 listen_opt: 
    ADDRESS ipa { new_config->listen_bgp_addr = $2; }
  | PORT expr { new_config->listen_bgp_port = $2; }
- | V6ONLY { new_config->listen_bgp_flags |= SKF_V6ONLY; }
+ | V6ONLY { new_config->listen_bgp_flags = 0; }
+ | DUAL { new_config->listen_bgp_flags = 1; }
  ;
 
 
index ba5d755d05256dabf6d8dcd1e8d78af23c2bbc4e..327292a3eae437a205f4f91cbcd5afbba25f4e7b 100644 (file)
@@ -658,7 +658,7 @@ bgp_setup_listen_sk(ip_addr addr, unsigned port, u32 flags)
   s->type = SK_TCP_PASSIVE;
   s->saddr = addr;
   s->sport = port ? port : BGP_PORT;
-  s->flags = flags;
+  s->flags = flags ? 0 : SKF_V6ONLY;
   s->tos = IP_PREC_INTERNET_CONTROL;
   s->rbsize = BGP_RX_BUFFER_SIZE;
   s->tbsize = BGP_TX_BUFFER_SIZE;