]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_nexthop.c
bgpd: Print the correct table in "show ip bgp x.x.x.x"
[mirror_frr.git] / bgpd / bgp_nexthop.c
CommitLineData
718e3744 1/* BGP nexthop scan
2 Copyright (C) 2000 Kunihiro Ishiguro
3
4This file is part of GNU Zebra.
5
6GNU Zebra is free software; you can redistribute it and/or modify it
7under the terms of the GNU General Public License as published by the
8Free Software Foundation; either version 2, or (at your option) any
9later version.
10
11GNU Zebra is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Zebra; see the file COPYING. If not, write to the Free
18Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1902111-1307, USA. */
20
21#include <zebra.h>
22
23#include "command.h"
24#include "thread.h"
25#include "prefix.h"
26#include "zclient.h"
27#include "stream.h"
28#include "network.h"
29#include "log.h"
30#include "memory.h"
10f9bf3f
JBD
31#include "hash.h"
32#include "jhash.h"
fb018d25 33#include "nexthop.h"
3f9c7369 34#include "queue.h"
718e3744 35
36#include "bgpd/bgpd.h"
37#include "bgpd/bgp_table.h"
38#include "bgpd/bgp_route.h"
39#include "bgpd/bgp_attr.h"
40#include "bgpd/bgp_nexthop.h"
fb018d25 41#include "bgpd/bgp_nht.h"
718e3744 42#include "bgpd/bgp_debug.h"
43#include "bgpd/bgp_damp.h"
8ffedcea 44#include "bgpd/bgp_fsm.h"
8386ac43 45#include "bgpd/bgp_vty.h"
718e3744 46#include "zebra/rib.h"
47#include "zebra/zserv.h" /* For ZEBRA_SERV_PATH. */
48
fb018d25 49
718e3744 50
fb018d25
DS
51char *
52bnc_str (struct bgp_nexthop_cache *bnc, char *buf, int size)
53{
54 prefix2str(&(bnc->node->p), buf, size);
55 return buf;
56}
57
fb018d25 58void
718e3744 59bnc_nexthop_free (struct bgp_nexthop_cache *bnc)
60{
61 struct nexthop *nexthop;
62 struct nexthop *next = NULL;
63
64 for (nexthop = bnc->nexthop; nexthop; nexthop = next)
65 {
66 next = nexthop->next;
67 XFREE (MTYPE_NEXTHOP, nexthop);
68 }
69}
70
fb018d25 71struct bgp_nexthop_cache *
ffd0c037 72bnc_new (void)
718e3744 73{
fb018d25
DS
74 struct bgp_nexthop_cache *bnc;
75
76 bnc = XCALLOC (MTYPE_BGP_NEXTHOP_CACHE, sizeof (struct bgp_nexthop_cache));
77 LIST_INIT(&(bnc->paths));
78 return bnc;
718e3744 79}
80
fb018d25 81void
718e3744 82bnc_free (struct bgp_nexthop_cache *bnc)
83{
84 bnc_nexthop_free (bnc);
85 XFREE (MTYPE_BGP_NEXTHOP_CACHE, bnc);
86}
6b0655a2 87
718e3744 88/* Reset and free all BGP nexthop cache. */
94f2b392 89static void
718e3744 90bgp_nexthop_cache_reset (struct bgp_table *table)
91{
92 struct bgp_node *rn;
93 struct bgp_nexthop_cache *bnc;
94
95 for (rn = bgp_table_top (table); rn; rn = bgp_route_next (rn))
96 if ((bnc = rn->info) != NULL)
97 {
98 bnc_free (bnc);
99 rn->info = NULL;
100 bgp_unlock_node (rn);
101 }
102}
103
10f9bf3f
JBD
104/* BGP own address structure */
105struct bgp_addr
106{
107 struct in_addr addr;
108 int refcnt;
109};
110
10f9bf3f
JBD
111static void *
112bgp_address_hash_alloc (void *p)
113{
ffd0c037 114 const struct in_addr *val = (const struct in_addr *)p;
10f9bf3f
JBD
115 struct bgp_addr *addr;
116
117 addr = XMALLOC (MTYPE_BGP_ADDR, sizeof (struct bgp_addr));
118 addr->refcnt = 0;
119 addr->addr.s_addr = val->s_addr;
120
121 return addr;
122}
123
124static unsigned int
125bgp_address_hash_key_make (void *p)
126{
127 const struct bgp_addr *addr = p;
128
129 return jhash_1word(addr->addr.s_addr, 0);
130}
131
132static int
133bgp_address_hash_cmp (const void *p1, const void *p2)
134{
135 const struct bgp_addr *addr1 = p1;
136 const struct bgp_addr *addr2 = p2;
137
138 return addr1->addr.s_addr == addr2->addr.s_addr;
139}
140
141void
6aeb9e78 142bgp_address_init (struct bgp *bgp)
10f9bf3f 143{
6aeb9e78 144 bgp->address_hash = hash_create (bgp_address_hash_key_make,
10f9bf3f
JBD
145 bgp_address_hash_cmp);
146}
147
bb86c601
LB
148void
149bgp_address_destroy (struct bgp *bgp)
150{
005b6bc0
LB
151 if (bgp->address_hash == NULL)
152 return;
bb86c601
LB
153 hash_clean(bgp->address_hash, NULL);
154 hash_free(bgp->address_hash);
155 bgp->address_hash = NULL;
156}
157
10f9bf3f 158static void
6aeb9e78 159bgp_address_add (struct bgp *bgp, struct prefix *p)
10f9bf3f
JBD
160{
161 struct bgp_addr tmp;
162 struct bgp_addr *addr;
163
164 tmp.addr = p->u.prefix4;
165
6aeb9e78 166 addr = hash_get (bgp->address_hash, &tmp, bgp_address_hash_alloc);
5ce10e92
DS
167 if (!addr)
168 return;
169
10f9bf3f
JBD
170 addr->refcnt++;
171}
172
173static void
6aeb9e78 174bgp_address_del (struct bgp *bgp, struct prefix *p)
10f9bf3f
JBD
175{
176 struct bgp_addr tmp;
177 struct bgp_addr *addr;
178
179 tmp.addr = p->u.prefix4;
180
6aeb9e78 181 addr = hash_lookup (bgp->address_hash, &tmp);
9e47abd8
RG
182 /* may have been deleted earlier by bgp_interface_down() */
183 if (addr == NULL)
184 return;
185
10f9bf3f
JBD
186 addr->refcnt--;
187
188 if (addr->refcnt == 0)
189 {
6aeb9e78 190 hash_release (bgp->address_hash, addr);
10f9bf3f
JBD
191 XFREE (MTYPE_BGP_ADDR, addr);
192 }
193}
194
6b0655a2 195
5932020b 196struct bgp_connected_ref
718e3744 197{
198 unsigned int refcnt;
199};
200
201void
6aeb9e78 202bgp_connected_add (struct bgp *bgp, struct connected *ifc)
718e3744 203{
204 struct prefix p;
205 struct prefix *addr;
718e3744 206 struct bgp_node *rn;
5932020b 207 struct bgp_connected_ref *bc;
6aeb9e78 208 struct listnode *node, *nnode;
8ffedcea 209 struct peer *peer;
718e3744 210
718e3744 211 addr = ifc->address;
718e3744 212
4608cb43 213 p = *(CONNECTED_PREFIX(ifc));
718e3744 214 if (addr->family == AF_INET)
215 {
718e3744 216 apply_mask_ipv4 ((struct prefix_ipv4 *) &p);
217
218 if (prefix_ipv4_any ((struct prefix_ipv4 *) &p))
219 return;
220
6aeb9e78 221 bgp_address_add (bgp, addr);
10f9bf3f 222
6aeb9e78 223 rn = bgp_node_get (bgp->connected_table[AFI_IP], (struct prefix *) &p);
718e3744 224 if (rn->info)
225 {
226 bc = rn->info;
227 bc->refcnt++;
228 }
229 else
230 {
6c88b44d 231 bc = XCALLOC (MTYPE_BGP_CONN, sizeof (struct bgp_connected_ref));
718e3744 232 bc->refcnt = 1;
233 rn->info = bc;
234 }
8ffedcea 235
6aeb9e78
DS
236 for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
237 {
238 if (peer->conf_if && (strcmp (peer->conf_if, ifc->ifp->name) == 0) &&
239 !CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY))
240 {
241 if (peer_active(peer))
242 BGP_EVENT_ADD (peer, BGP_Stop);
243 BGP_EVENT_ADD (peer, BGP_Start);
244 }
245 }
718e3744 246 }
247#ifdef HAVE_IPV6
e4529636 248 else if (addr->family == AF_INET6)
718e3744 249 {
718e3744 250 apply_mask_ipv6 ((struct prefix_ipv6 *) &p);
251
252 if (IN6_IS_ADDR_UNSPECIFIED (&p.u.prefix6))
253 return;
254
255 if (IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6))
256 return;
257
6aeb9e78 258 rn = bgp_node_get (bgp->connected_table[AFI_IP6], (struct prefix *) &p);
718e3744 259 if (rn->info)
260 {
261 bc = rn->info;
262 bc->refcnt++;
263 }
264 else
265 {
6c88b44d 266 bc = XCALLOC (MTYPE_BGP_CONN, sizeof (struct bgp_connected_ref));
718e3744 267 bc->refcnt = 1;
268 rn->info = bc;
269 }
270 }
271#endif /* HAVE_IPV6 */
272}
273
274void
6aeb9e78 275bgp_connected_delete (struct bgp *bgp, struct connected *ifc)
718e3744 276{
277 struct prefix p;
278 struct prefix *addr;
718e3744 279 struct bgp_node *rn;
5932020b 280 struct bgp_connected_ref *bc;
718e3744 281
718e3744 282 addr = ifc->address;
718e3744 283
4608cb43 284 p = *(CONNECTED_PREFIX(ifc));
718e3744 285 if (addr->family == AF_INET)
286 {
718e3744 287 apply_mask_ipv4 ((struct prefix_ipv4 *) &p);
288
289 if (prefix_ipv4_any ((struct prefix_ipv4 *) &p))
290 return;
291
6aeb9e78 292 bgp_address_del (bgp, addr);
10f9bf3f 293
6aeb9e78 294 rn = bgp_node_lookup (bgp->connected_table[AFI_IP], &p);
718e3744 295 if (! rn)
296 return;
297
298 bc = rn->info;
299 bc->refcnt--;
300 if (bc->refcnt == 0)
301 {
6c88b44d 302 XFREE (MTYPE_BGP_CONN, bc);
718e3744 303 rn->info = NULL;
304 }
305 bgp_unlock_node (rn);
306 bgp_unlock_node (rn);
307 }
308#ifdef HAVE_IPV6
309 else if (addr->family == AF_INET6)
310 {
718e3744 311 apply_mask_ipv6 ((struct prefix_ipv6 *) &p);
312
313 if (IN6_IS_ADDR_UNSPECIFIED (&p.u.prefix6))
314 return;
315
316 if (IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6))
317 return;
318
6aeb9e78 319 rn = bgp_node_lookup (bgp->connected_table[AFI_IP6], (struct prefix *) &p);
718e3744 320 if (! rn)
321 return;
322
323 bc = rn->info;
324 bc->refcnt--;
325 if (bc->refcnt == 0)
326 {
6c88b44d 327 XFREE (MTYPE_BGP_CONN, bc);
718e3744 328 rn->info = NULL;
329 }
330 bgp_unlock_node (rn);
331 bgp_unlock_node (rn);
332 }
333#endif /* HAVE_IPV6 */
334}
335
336int
6aeb9e78 337bgp_nexthop_self (struct bgp *bgp, struct attr *attr)
718e3744 338{
10f9bf3f 339 struct bgp_addr tmp, *addr;
718e3744 340
10f9bf3f
JBD
341 tmp.addr = attr->nexthop;
342
6aeb9e78 343 addr = hash_lookup (bgp->address_hash, &tmp);
10f9bf3f
JBD
344 if (addr)
345 return 1;
718e3744 346
718e3744 347 return 0;
348}
6b0655a2 349
718e3744 350int
fc9a856f 351bgp_multiaccess_check_v4 (struct in_addr nexthop, struct peer *peer)
718e3744 352{
353 struct bgp_node *rn1;
354 struct bgp_node *rn2;
fc9a856f 355 struct prefix p;
718e3744 356 int ret;
357
fc9a856f
DS
358 p.family = AF_INET;
359 p.prefixlen = IPV4_MAX_BITLEN;
360 p.u.prefix4 = nexthop;
718e3744 361
6aeb9e78 362 rn1 = bgp_node_match (peer->bgp->connected_table[AFI_IP], &p);
fc9a856f 363 if (!rn1)
718e3744 364 return 0;
718e3744 365
fc9a856f
DS
366 p.family = AF_INET;
367 p.prefixlen = IPV4_MAX_BITLEN;
368 p.u.prefix4 = peer->su.sin.sin_addr;
718e3744 369
6aeb9e78 370 rn2 = bgp_node_match (peer->bgp->connected_table[AFI_IP], &p);
fc9a856f 371 if (!rn2)
718e3744 372 {
fc9a856f
DS
373 bgp_unlock_node(rn1);
374 return 0;
718e3744 375 }
376
fc9a856f 377 ret = (rn1 == rn2) ? 1 : 0;
718e3744 378
fc9a856f
DS
379 bgp_unlock_node(rn1);
380 bgp_unlock_node(rn2);
718e3744 381
fc9a856f 382 return (ret);
718e3744 383}
384
f186de26 385static void
386bgp_show_nexthops (struct vty *vty, struct bgp *bgp, int detail)
fb018d25
DS
387{
388 struct bgp_node *rn;
389 struct bgp_nexthop_cache *bnc;
da11a696 390 char buf[PREFIX2STR_BUFFER];
77217fd4 391 struct nexthop *nexthop;
fb018d25 392 time_t tbuf;
da11a696 393 afi_t afi;
fb018d25
DS
394
395 vty_out (vty, "Current BGP nexthop cache:%s", VTY_NEWLINE);
da11a696
DS
396 for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
397 {
6aeb9e78 398 for (rn = bgp_table_top (bgp->nexthop_cache_table[afi]); rn; rn = bgp_route_next (rn))
fb018d25 399 {
da11a696
DS
400 if ((bnc = rn->info) != NULL)
401 {
402 if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID))
77217fd4 403 {
da11a696
DS
404 vty_out (vty, " %s valid [IGP metric %d], #paths %d%s",
405 inet_ntop (rn->p.family, &rn->p.u.prefix, buf, sizeof (buf)),
406 bnc->metric, bnc->path_count, VTY_NEWLINE);
407 if (detail)
408 for (nexthop = bnc->nexthop; nexthop; nexthop = nexthop->next)
409 switch (nexthop->type)
410 {
411 case NEXTHOP_TYPE_IPV6:
412 vty_out (vty, " gate %s%s",
413 inet_ntop (AF_INET6, &nexthop->gate.ipv6,
414 buf, sizeof (buf)), VTY_NEWLINE);
415 break;
416 case NEXTHOP_TYPE_IPV6_IFINDEX:
417 vty_out(vty, " gate %s, if %s%s",
418 inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf,
419 sizeof (buf)),
420 ifindex2ifname(nexthop->ifindex),
421 VTY_NEWLINE);
422 break;
423 case NEXTHOP_TYPE_IPV4:
424 vty_out (vty, " gate %s%s",
425 inet_ntop (AF_INET, &nexthop->gate.ipv4, buf,
426 sizeof (buf)), VTY_NEWLINE);
427 break;
428 case NEXTHOP_TYPE_IFINDEX:
429 vty_out (vty, " if %s%s",
430 ifindex2ifname(nexthop->ifindex), VTY_NEWLINE);
431 break;
432 case NEXTHOP_TYPE_IPV4_IFINDEX:
433 vty_out (vty, " gate %s, if %s%s",
434 inet_ntop(AF_INET, &nexthop->gate.ipv4, buf,
435 sizeof (buf)),
436 ifindex2ifname(nexthop->ifindex), VTY_NEWLINE);
437 break;
438 default:
439 vty_out (vty, " invalid nexthop type %u%s",
440 nexthop->type, VTY_NEWLINE);
441 }
442 }
443 else
444 {
445 vty_out (vty, " %s invalid%s",
446 inet_ntop (rn->p.family, &rn->p.u.prefix,
447 buf, sizeof (buf)), VTY_NEWLINE);
448 if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED))
449 vty_out (vty, " Must be Connected%s", VTY_NEWLINE);
77217fd4 450 }
fb018d25 451#ifdef HAVE_CLOCK_MONOTONIC
da11a696
DS
452 tbuf = time(NULL) - (bgp_clock() - bnc->last_update);
453 vty_out (vty, " Last update: %s", ctime(&tbuf));
fb018d25 454#else
da11a696 455 vty_out (vty, " Last update: %s", ctime(&bnc->uptime));
fb018d25 456#endif /* HAVE_CLOCK_MONOTONIC */
da11a696
DS
457 vty_out(vty, "%s", VTY_NEWLINE);
458 }
fb018d25 459 }
da11a696 460 }
f186de26 461}
462
463static int
464show_ip_bgp_nexthop_table (struct vty *vty, const char *name, int detail)
465{
466 struct bgp *bgp;
467
468 if (name)
469 bgp = bgp_lookup_by_name (name);
470 else
471 bgp = bgp_get_default ();
472 if (!bgp)
473 {
474 vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE);
475 return CMD_WARNING;
476 }
477
478 bgp_show_nexthops (vty, bgp, detail);
479
fb018d25
DS
480 return CMD_SUCCESS;
481}
482
f186de26 483static void
484bgp_show_all_instances_nexthops_vty (struct vty *vty)
485{
486 struct listnode *node, *nnode;
487 struct bgp *bgp;
488
489 for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp))
490 {
491 vty_out (vty, "%sInstance %s:%s",
492 VTY_NEWLINE,
493 (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? "Default" : bgp->name,
494 VTY_NEWLINE);
495 bgp_show_nexthops (vty, bgp, 0);
496 }
497}
498
fb018d25
DS
499DEFUN (show_ip_bgp_nexthop,
500 show_ip_bgp_nexthop_cmd,
501 "show ip bgp nexthop",
502 SHOW_STR
503 IP_STR
504 BGP_STR
505 "BGP nexthop table\n")
506{
6aeb9e78 507 return show_ip_bgp_nexthop_table (vty, NULL, 0);
fb018d25
DS
508}
509
510DEFUN (show_ip_bgp_nexthop_detail,
511 show_ip_bgp_nexthop_detail_cmd,
512 "show ip bgp nexthop detail",
513 SHOW_STR
514 IP_STR
515 BGP_STR
516 "BGP nexthop table\n")
517{
6aeb9e78 518 return show_ip_bgp_nexthop_table (vty, NULL, 1);
fb018d25
DS
519}
520
8386ac43 521DEFUN (show_ip_bgp_instance_nexthop,
522 show_ip_bgp_instance_nexthop_cmd,
523 "show ip bgp " BGP_INSTANCE_CMD " nexthop",
50ef26d4 524 SHOW_STR
525 IP_STR
526 BGP_STR
8386ac43 527 BGP_INSTANCE_HELP_STR
50ef26d4 528 "BGP nexthop table\n")
529{
530 return show_ip_bgp_nexthop_table (vty, argv[1], 0);
531}
532
f186de26 533DEFUN (show_ip_bgp_instance_all_nexthop,
534 show_ip_bgp_instance_all_nexthop_cmd,
535 "show ip bgp " BGP_INSTANCE_ALL_CMD " nexthop",
536 SHOW_STR
537 IP_STR
538 BGP_STR
539 BGP_INSTANCE_ALL_HELP_STR
540 "BGP nexthop table\n")
541{
542 bgp_show_all_instances_nexthops_vty (vty);
543 return CMD_SUCCESS;
544}
545
8386ac43 546DEFUN (show_ip_bgp_instance_nexthop_detail,
547 show_ip_bgp_instance_nexthop_detail_cmd,
548 "show ip bgp " BGP_INSTANCE_CMD " nexthop detail",
50ef26d4 549 SHOW_STR
550 IP_STR
551 BGP_STR
8386ac43 552 BGP_INSTANCE_HELP_STR
50ef26d4 553 "BGP nexthop table\n")
554{
555 return show_ip_bgp_nexthop_table (vty, argv[1], 1);
556}
557
718e3744 558void
6aeb9e78 559bgp_scan_init (struct bgp *bgp)
718e3744 560{
6aeb9e78
DS
561 bgp->nexthop_cache_table[AFI_IP] = bgp_table_init (AFI_IP, SAFI_UNICAST);
562 bgp->connected_table[AFI_IP] = bgp_table_init (AFI_IP, SAFI_UNICAST);
563 bgp->import_check_table[AFI_IP] = bgp_table_init (AFI_IP, SAFI_UNICAST);
718e3744 564
565#ifdef HAVE_IPV6
6aeb9e78
DS
566 bgp->nexthop_cache_table[AFI_IP6] = bgp_table_init (AFI_IP6, SAFI_UNICAST);
567 bgp->connected_table[AFI_IP6] = bgp_table_init (AFI_IP6, SAFI_UNICAST);
568 bgp->import_check_table[AFI_IP6] = bgp_table_init (AFI_IP6, SAFI_UNICAST);
718e3744 569#endif /* HAVE_IPV6 */
570
fc9a856f
DS
571}
572
573void
ffd0c037 574bgp_scan_vty_init (void)
fc9a856f
DS
575{
576 install_element (ENABLE_NODE, &show_ip_bgp_nexthop_cmd);
fb018d25
DS
577 install_element (VIEW_NODE, &show_ip_bgp_nexthop_cmd);
578 install_element (VIEW_NODE, &show_ip_bgp_nexthop_detail_cmd);
fb018d25 579 install_element (ENABLE_NODE, &show_ip_bgp_nexthop_detail_cmd);
8386ac43 580 install_element (ENABLE_NODE, &show_ip_bgp_instance_nexthop_cmd);
f186de26 581 install_element (ENABLE_NODE, &show_ip_bgp_instance_all_nexthop_cmd);
8386ac43 582 install_element (VIEW_NODE, &show_ip_bgp_instance_nexthop_cmd);
f186de26 583 install_element (VIEW_NODE, &show_ip_bgp_instance_all_nexthop_cmd);
8386ac43 584 install_element (VIEW_NODE, &show_ip_bgp_instance_nexthop_detail_cmd);
585 install_element (ENABLE_NODE, &show_ip_bgp_instance_nexthop_detail_cmd);
718e3744 586}
228da428
CC
587
588void
6aeb9e78 589bgp_scan_finish (struct bgp *bgp)
228da428 590{
6c88b44d 591 /* Only the current one needs to be reset. */
6aeb9e78 592 bgp_nexthop_cache_reset (bgp->nexthop_cache_table[AFI_IP]);
6c88b44d 593
6aeb9e78
DS
594 bgp_table_unlock (bgp->nexthop_cache_table[AFI_IP]);
595 bgp->nexthop_cache_table[AFI_IP] = NULL;
228da428 596
6aeb9e78
DS
597 bgp_table_unlock (bgp->connected_table[AFI_IP]);
598 bgp->connected_table[AFI_IP] = NULL;
228da428 599
6aeb9e78
DS
600 bgp_table_unlock (bgp->import_check_table[AFI_IP]);
601 bgp->import_check_table[AFI_IP] = NULL;
078430f6 602
228da428 603#ifdef HAVE_IPV6
6c88b44d 604 /* Only the current one needs to be reset. */
6aeb9e78 605 bgp_nexthop_cache_reset (bgp->nexthop_cache_table[AFI_IP6]);
6c88b44d 606
6aeb9e78
DS
607 bgp_table_unlock (bgp->nexthop_cache_table[AFI_IP6]);
608 bgp->nexthop_cache_table[AFI_IP6] = NULL;
228da428 609
6aeb9e78
DS
610 bgp_table_unlock (bgp->connected_table[AFI_IP6]);
611 bgp->connected_table[AFI_IP6] = NULL;
078430f6 612
6aeb9e78
DS
613 bgp_table_unlock (bgp->import_check_table[AFI_IP6]);
614 bgp->import_check_table[AFI_IP6] = NULL;
228da428
CC
615#endif /* HAVE_IPV6 */
616}