Add a per-peer flag if it supports IPv6 routes adv.
authorBenjamin Cama <benoar@dolka.fr>
Tue, 19 Jul 2011 21:59:27 +0000 (23:59 +0200)
committerBenjamin Cama <benoar@dolka.fr>
Thu, 28 Jul 2011 12:58:30 +0000 (14:58 +0200)
Signed-off-by: Benjamin Cama <benoar@dolka.fr>
bgp.c
bgp.h

diff --git a/bgp.c b/bgp.c
index 9d237c9..a9ce8ec 100644 (file)
--- a/bgp.c
+++ b/bgp.c
@@ -762,6 +762,8 @@ static int bgp_connect(struct bgp_peer *peer)
 
     LOG(4, 0, 0, "BGP peer %s: state Active\n", inet_ntoa(addr.sin_addr));
 
 
     LOG(4, 0, 0, "BGP peer %s: state Active\n", inet_ntoa(addr.sin_addr));
 
+    peer->handle_ipv6_routes = 0;
+
     return bgp_send_open(peer);
 }
 
     return bgp_send_open(peer);
 }
 
@@ -785,6 +787,8 @@ static int bgp_handle_connect(struct bgp_peer *peer)
 
     LOG(4, 0, 0, "BGP peer %s: state Active\n", peer->name);
 
 
     LOG(4, 0, 0, "BGP peer %s: state Active\n", peer->name);
 
+    peer->handle_ipv6_routes = 0;
+
     return bgp_send_open(peer);
 }
 
     return bgp_send_open(peer);
 }
 
@@ -1051,6 +1055,7 @@ static int bgp_handle_input(struct bgp_peer *peer)
                        continue;
                    }
 
                        continue;
                    }
 
+                   peer->handle_ipv6_routes = 1;
                }
            }
 
                }
            }
 
diff --git a/bgp.h b/bgp.h
index 28b315b..79906e2 100644 (file)
--- a/bgp.h
+++ b/bgp.h
@@ -205,6 +205,7 @@ struct bgp_peer {
     int path_attr_len;                 /* length of path attrs */
     uint32_t events;                   /* events to poll */
     struct event_data edata;           /* poll data */
     int path_attr_len;                 /* length of path attrs */
     uint32_t events;                   /* events to poll */
     struct event_data edata;           /* poll data */
+    int handle_ipv6_routes;            /* can handle IPv6 routes advertisements */
 };
 
 /* bgp_peer.cli_flag */
 };
 
 /* bgp_peer.cli_flag */