jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * IS-IS Rout(e)ing protocol - isis_route.c |
| 3 | * Copyright (C) 2001,2002 Sampo Saaristo |
| 4 | * Tampere University of Technology |
| 5 | * Institute of Communications Engineering |
| 6 | * |
| 7 | * based on ../ospf6d/ospf6_route.[ch] |
| 8 | * by Yasuhiro Ohara |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify it |
| 11 | * under the terms of the GNU General Public Licenseas published by the Free |
| 12 | * Software Foundation; either version 2 of the License, or (at your option) |
| 13 | * any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful,but WITHOUT |
| 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 18 | * more details. |
| 19 | |
| 20 | * You should have received a copy of the GNU General Public License along |
| 21 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 22 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 23 | */ |
| 24 | |
| 25 | #include <stdlib.h> |
| 26 | #include <stdio.h> |
| 27 | #include <zebra.h> |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 28 | |
| 29 | #include "thread.h" |
| 30 | #include "linklist.h" |
| 31 | #include "vty.h" |
| 32 | #include "log.h" |
| 33 | #include "memory.h" |
| 34 | #include "prefix.h" |
| 35 | #include "hash.h" |
| 36 | #include "if.h" |
| 37 | #include "table.h" |
| 38 | |
| 39 | #include "isis_constants.h" |
| 40 | #include "isis_common.h" |
| 41 | #include "dict.h" |
| 42 | #include "isisd.h" |
| 43 | #include "isis_misc.h" |
| 44 | #include "isis_adjacency.h" |
| 45 | #include "isis_circuit.h" |
| 46 | #include "isis_tlv.h" |
| 47 | #include "isis_pdu.h" |
| 48 | #include "isis_lsp.h" |
| 49 | #include "isis_spf.h" |
| 50 | #include "isis_route.h" |
| 51 | #include "isis_zebra.h" |
| 52 | |
| 53 | extern struct isis *isis; |
| 54 | extern struct thread_master *master; |
| 55 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 56 | static struct isis_nexthop * |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 57 | isis_nexthop_create (struct in_addr *ip, unsigned int ifindex) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 58 | { |
| 59 | struct listnode *node; |
| 60 | struct isis_nexthop *nexthop; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 61 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 62 | for (ALL_LIST_ELEMENTS_RO (isis->nexthops, node, nexthop)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 63 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 64 | if (nexthop->ifindex != ifindex) |
| 65 | continue; |
| 66 | if (ip && memcmp (&nexthop->ip, ip, sizeof (struct in_addr)) != 0) |
| 67 | continue; |
| 68 | |
| 69 | nexthop->lock++; |
| 70 | return nexthop; |
| 71 | } |
| 72 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 73 | nexthop = XMALLOC (MTYPE_ISIS_NEXTHOP, sizeof (struct isis_nexthop)); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 74 | if (!nexthop) |
| 75 | { |
| 76 | zlog_err ("ISIS-Rte: isis_nexthop_create: out of memory!"); |
| 77 | } |
| 78 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 79 | memset (nexthop, 0, sizeof (struct isis_nexthop)); |
| 80 | nexthop->ifindex = ifindex; |
| 81 | memcpy (&nexthop->ip, ip, sizeof (struct in_addr)); |
| 82 | listnode_add (isis->nexthops, nexthop); |
| 83 | nexthop->lock++; |
| 84 | |
| 85 | return nexthop; |
| 86 | } |
| 87 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 88 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 89 | isis_nexthop_delete (struct isis_nexthop *nexthop) |
| 90 | { |
| 91 | nexthop->lock--; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 92 | if (nexthop->lock == 0) |
| 93 | { |
| 94 | listnode_delete (isis->nexthops, nexthop); |
| 95 | XFREE (MTYPE_ISIS_NEXTHOP, nexthop); |
| 96 | } |
| 97 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 98 | return; |
| 99 | } |
| 100 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 101 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 102 | nexthoplookup (struct list *nexthops, struct in_addr *ip, |
| 103 | unsigned int ifindex) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 104 | { |
| 105 | struct listnode *node; |
| 106 | struct isis_nexthop *nh; |
| 107 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 108 | for (ALL_LIST_ELEMENTS_RO (nexthops, node, nh)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 109 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 110 | if (!(memcmp (ip, &nh->ip, sizeof (struct in_addr))) && |
| 111 | ifindex == nh->ifindex) |
| 112 | return 1; |
| 113 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 114 | |
| 115 | return 0; |
| 116 | } |
| 117 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 118 | #if 0 /* Old or new code? */ |
| 119 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 120 | nexthop_print (struct isis_nexthop *nh) |
| 121 | { |
| 122 | u_char buf[BUFSIZ]; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 123 | |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 124 | inet_ntop (AF_INET, &nh->ip, (char *) buf, BUFSIZ); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 125 | |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 126 | zlog_debug (" %s %u", buf, nh->ifindex); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 127 | } |
| 128 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 129 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 130 | nexthops_print (struct list *nhs) |
| 131 | { |
| 132 | struct listnode *node; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 133 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 134 | for (ALL_LIST_ELEMENTS_RO (nhs, node, nh)) |
| 135 | nexthop_print (nh); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 136 | } |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 137 | #endif /* 0 */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 138 | |
| 139 | #ifdef HAVE_IPV6 |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 140 | static struct isis_nexthop6 * |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 141 | isis_nexthop6_new (struct in6_addr *ip6, unsigned int ifindex) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 142 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 143 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 144 | struct isis_nexthop6 *nexthop6; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 145 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 146 | nexthop6 = XMALLOC (MTYPE_ISIS_NEXTHOP6, sizeof (struct isis_nexthop6)); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 147 | if (!nexthop6) |
| 148 | { |
| 149 | zlog_err ("ISIS-Rte: isis_nexthop_create6: out of memory!"); |
| 150 | } |
| 151 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 152 | memset (nexthop6, 0, sizeof (struct isis_nexthop6)); |
| 153 | nexthop6->ifindex = ifindex; |
| 154 | memcpy (&nexthop6->ip6, ip6, sizeof (struct in6_addr)); |
| 155 | nexthop6->lock++; |
| 156 | |
| 157 | return nexthop6; |
| 158 | } |
| 159 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 160 | static struct isis_nexthop6 * |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 161 | isis_nexthop6_create (struct in6_addr *ip6, unsigned int ifindex) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 162 | { |
| 163 | struct listnode *node; |
| 164 | struct isis_nexthop6 *nexthop6; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 165 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 166 | for (ALL_LIST_ELEMENTS_RO (isis->nexthops6, node, nexthop6)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 167 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 168 | if (nexthop6->ifindex != ifindex) |
| 169 | continue; |
| 170 | if (ip6 && memcmp (&nexthop6->ip6, ip6, sizeof (struct in6_addr)) != 0) |
| 171 | continue; |
| 172 | |
| 173 | nexthop6->lock++; |
| 174 | return nexthop6; |
| 175 | } |
| 176 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 177 | nexthop6 = isis_nexthop6_new (ip6, ifindex); |
| 178 | |
| 179 | return nexthop6; |
| 180 | } |
| 181 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 182 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 183 | isis_nexthop6_delete (struct isis_nexthop6 *nexthop6) |
| 184 | { |
| 185 | |
| 186 | nexthop6->lock--; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 187 | if (nexthop6->lock == 0) |
| 188 | { |
| 189 | listnode_delete (isis->nexthops6, nexthop6); |
| 190 | XFREE (MTYPE_ISIS_NEXTHOP6, nexthop6); |
| 191 | } |
| 192 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 193 | return; |
| 194 | } |
| 195 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 196 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 197 | nexthop6lookup (struct list *nexthops6, struct in6_addr *ip6, |
| 198 | unsigned int ifindex) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 199 | { |
| 200 | struct listnode *node; |
| 201 | struct isis_nexthop6 *nh6; |
| 202 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 203 | for (ALL_LIST_ELEMENTS_RO (nexthops6, node, nh6)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 204 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 205 | if (!(memcmp (ip6, &nh6->ip6, sizeof (struct in6_addr))) && |
| 206 | ifindex == nh6->ifindex) |
| 207 | return 1; |
| 208 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 209 | |
| 210 | return 0; |
| 211 | } |
| 212 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 213 | #ifdef EXTREME_DEBUG |
| 214 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 215 | nexthop6_print (struct isis_nexthop6 *nh6) |
| 216 | { |
| 217 | u_char buf[BUFSIZ]; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 218 | |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 219 | inet_ntop (AF_INET6, &nh6->ip6, (char *) buf, BUFSIZ); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 220 | |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 221 | zlog_debug (" %s %u", buf, nh6->ifindex); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 222 | } |
| 223 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 224 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 225 | nexthops6_print (struct list *nhs6) |
| 226 | { |
| 227 | struct listnode *node; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 228 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 229 | for (ALL_LIST_ELEMENTS_RO (nhs6, node, nh6)) |
| 230 | nexthop6_print (nh6); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 231 | } |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 232 | #endif /* EXTREME_DEBUG */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 233 | #endif /* HAVE_IPV6 */ |
| 234 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 235 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 236 | adjinfo2nexthop (struct list *nexthops, struct isis_adjacency *adj) |
| 237 | { |
| 238 | struct isis_nexthop *nh; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 239 | struct listnode *node, *nnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 240 | struct in_addr *ipv4_addr; |
| 241 | |
| 242 | if (adj->ipv4_addrs == NULL) |
| 243 | return; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 244 | |
| 245 | for (ALL_LIST_ELEMENTS (adj->ipv4_addrs, node, nnode, ipv4_addr)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 246 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 247 | if (!nexthoplookup (nexthops, ipv4_addr, |
| 248 | adj->circuit->interface->ifindex)) |
| 249 | { |
| 250 | nh = isis_nexthop_create (ipv4_addr, |
| 251 | adj->circuit->interface->ifindex); |
| 252 | listnode_add (nexthops, nh); |
| 253 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 254 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 255 | } |
| 256 | |
| 257 | #ifdef HAVE_IPV6 |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 258 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 259 | adjinfo2nexthop6 (struct list *nexthops6, struct isis_adjacency *adj) |
| 260 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 261 | struct listnode *node, *nnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 262 | struct in6_addr *ipv6_addr; |
| 263 | struct isis_nexthop6 *nh6; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 264 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 265 | if (!adj->ipv6_addrs) |
| 266 | return; |
| 267 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 268 | for (ALL_LIST_ELEMENTS (adj->ipv6_addrs, node, nnode, ipv6_addr)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 269 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 270 | if (!nexthop6lookup (nexthops6, ipv6_addr, |
| 271 | adj->circuit->interface->ifindex)) |
| 272 | { |
| 273 | nh6 = isis_nexthop6_create (ipv6_addr, |
| 274 | adj->circuit->interface->ifindex); |
| 275 | listnode_add (nexthops6, nh6); |
| 276 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 277 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 278 | } |
| 279 | #endif /* HAVE_IPV6 */ |
| 280 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 281 | static struct isis_route_info * |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 282 | isis_route_info_new (uint32_t cost, uint32_t depth, u_char family, |
| 283 | struct list *adjacencies) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 284 | { |
| 285 | struct isis_route_info *rinfo; |
| 286 | struct isis_adjacency *adj; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 287 | struct listnode *node, *nnode; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 288 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 289 | rinfo = XMALLOC (MTYPE_ISIS_ROUTE_INFO, sizeof (struct isis_route_info)); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 290 | if (!rinfo) |
| 291 | { |
| 292 | zlog_err ("ISIS-Rte: isis_route_info_new: out of memory!"); |
| 293 | return NULL; |
| 294 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 295 | memset (rinfo, 0, sizeof (struct isis_route_info)); |
| 296 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 297 | if (family == AF_INET) |
| 298 | { |
| 299 | rinfo->nexthops = list_new (); |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 300 | for (ALL_LIST_ELEMENTS (adjacencies, node, nnode, adj)) |
| 301 | adjinfo2nexthop (rinfo->nexthops, adj); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 302 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 303 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 304 | if (family == AF_INET6) |
| 305 | { |
| 306 | rinfo->nexthops6 = list_new (); |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 307 | for (ALL_LIST_ELEMENTS (adjacencies, node, nnode, adj)) |
| 308 | adjinfo2nexthop6 (rinfo->nexthops6, adj); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 309 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 310 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 311 | #endif /* HAVE_IPV6 */ |
| 312 | |
| 313 | rinfo->cost = cost; |
| 314 | rinfo->depth = depth; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 315 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 316 | return rinfo; |
| 317 | } |
| 318 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 319 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 320 | isis_route_info_delete (struct isis_route_info *route_info) |
| 321 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 322 | if (route_info->nexthops) |
| 323 | { |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 324 | route_info->nexthops->del = (void (*)(void *)) isis_nexthop_delete; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 325 | list_delete (route_info->nexthops); |
| 326 | } |
| 327 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 328 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 329 | if (route_info->nexthops6) |
| 330 | { |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 331 | route_info->nexthops6->del = (void (*)(void *)) isis_nexthop6_delete; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 332 | list_delete (route_info->nexthops6); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 333 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 334 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 335 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 336 | XFREE (MTYPE_ISIS_ROUTE_INFO, route_info); |
| 337 | } |
| 338 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 339 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 340 | isis_route_info_same_attrib (struct isis_route_info *new, |
| 341 | struct isis_route_info *old) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 342 | { |
| 343 | if (new->cost != old->cost) |
| 344 | return 0; |
| 345 | if (new->depth != old->depth) |
| 346 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 347 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 348 | return 1; |
| 349 | } |
| 350 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 351 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 352 | isis_route_info_same (struct isis_route_info *new, |
| 353 | struct isis_route_info *old, u_char family) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 354 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 355 | struct listnode *node, *nnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 356 | struct isis_nexthop *nexthop; |
| 357 | #ifdef HAVE_IPV6 |
| 358 | struct isis_nexthop6 *nexthop6; |
| 359 | #endif /* HAVE_IPV6 */ |
| 360 | if (!isis_route_info_same_attrib (new, old)) |
| 361 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 362 | |
| 363 | if (family == AF_INET) |
| 364 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 365 | for (ALL_LIST_ELEMENTS (new->nexthops, node, nnode, nexthop)) |
| 366 | if (nexthoplookup (old->nexthops, &nexthop->ip, nexthop->ifindex) |
| 367 | == 0) |
| 368 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 369 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 370 | for (ALL_LIST_ELEMENTS (old->nexthops, node, nnode, nexthop)) |
| 371 | if (nexthoplookup (new->nexthops, &nexthop->ip, nexthop->ifindex) |
| 372 | == 0) |
| 373 | return 0; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 374 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 375 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 376 | else if (family == AF_INET6) |
| 377 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 378 | for (ALL_LIST_ELEMENTS (new->nexthops6, node, nnode, nexthop6)) |
| 379 | if (nexthop6lookup (old->nexthops6, &nexthop6->ip6, |
| 380 | nexthop6->ifindex) == 0) |
| 381 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 382 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 383 | for (ALL_LIST_ELEMENTS (old->nexthops6, node, nnode, nexthop6)) |
| 384 | if (nexthop6lookup (new->nexthops6, &nexthop6->ip6, |
| 385 | nexthop6->ifindex) == 0) |
| 386 | return 0; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 387 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 388 | #endif /* HAVE_IPV6 */ |
| 389 | |
| 390 | return 1; |
| 391 | } |
| 392 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 393 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 394 | isis_nexthops_merge (struct list *new, struct list *old) |
| 395 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 396 | struct listnode *node, *nnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 397 | struct isis_nexthop *nexthop; |
| 398 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 399 | for (ALL_LIST_ELEMENTS (new, node, nnode, nexthop)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 400 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 401 | if (nexthoplookup (old, &nexthop->ip, nexthop->ifindex)) |
| 402 | continue; |
| 403 | listnode_add (old, nexthop); |
| 404 | nexthop->lock++; |
| 405 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 406 | } |
| 407 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 408 | #ifdef HAVE_IPV6 |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 409 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 410 | isis_nexthops6_merge (struct list *new, struct list *old) |
| 411 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 412 | struct listnode *node, *nnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 413 | struct isis_nexthop6 *nexthop6; |
| 414 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 415 | for (ALL_LIST_ELEMENTS (new, node, nnode, nexthop6)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 416 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 417 | if (nexthop6lookup (old, &nexthop6->ip6, nexthop6->ifindex)) |
| 418 | continue; |
| 419 | listnode_add (old, nexthop6); |
| 420 | nexthop6->lock++; |
| 421 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 422 | } |
| 423 | #endif /* HAVE_IPV6 */ |
| 424 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 425 | static void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 426 | isis_route_info_merge (struct isis_route_info *new, |
| 427 | struct isis_route_info *old, u_char family) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 428 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 429 | if (family == AF_INET) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 430 | isis_nexthops_merge (new->nexthops, old->nexthops); |
| 431 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 432 | else if (family == AF_INET6) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 433 | isis_nexthops6_merge (new->nexthops6, old->nexthops6); |
| 434 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 435 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 436 | return; |
| 437 | } |
| 438 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 439 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 440 | isis_route_info_prefer_new (struct isis_route_info *new, |
| 441 | struct isis_route_info *old) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 442 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 443 | if (!CHECK_FLAG (old->flag, ISIS_ROUTE_FLAG_ACTIVE)) |
| 444 | return 1; |
| 445 | |
| 446 | if (new->cost < old->cost) |
| 447 | return 1; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 448 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 449 | return 0; |
| 450 | } |
| 451 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 452 | struct isis_route_info * |
| 453 | isis_route_create (struct prefix *prefix, u_int32_t cost, u_int32_t depth, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 454 | struct list *adjacencies, struct isis_area *area) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 455 | { |
| 456 | struct route_node *route_node; |
| 457 | struct isis_route_info *rinfo_new, *rinfo_old, *route_info = NULL; |
| 458 | u_char buff[BUFSIZ]; |
| 459 | u_char family; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 460 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 461 | family = prefix->family; |
| 462 | /* for debugs */ |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 463 | prefix2str (prefix, (char *) buff, BUFSIZ); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 464 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 465 | rinfo_new = isis_route_info_new (cost, depth, family, adjacencies); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 466 | if (!rinfo_new) |
| 467 | { |
| 468 | zlog_err ("ISIS-Rte (%s): isis_route_create: out of memory!", |
| 469 | area->area_tag); |
| 470 | return NULL; |
| 471 | } |
| 472 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 473 | if (family == AF_INET) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 474 | route_node = route_node_get (area->route_table, prefix); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 475 | #ifdef HAVE_IPV6 |
| 476 | else if (family == AF_INET6) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 477 | route_node = route_node_get (area->route_table6, prefix); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 478 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 479 | else |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 480 | return NULL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 481 | rinfo_old = route_node->info; |
| 482 | if (!rinfo_old) |
| 483 | { |
| 484 | if (isis->debugs & DEBUG_RTE_EVENTS) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 485 | zlog_debug ("ISIS-Rte (%s) route created: %s", area->area_tag, buff); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 486 | SET_FLAG (rinfo_new->flag, ISIS_ROUTE_FLAG_ACTIVE); |
| 487 | route_node->info = rinfo_new; |
| 488 | return rinfo_new; |
| 489 | } |
| 490 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 491 | if (isis->debugs & DEBUG_RTE_EVENTS) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 492 | zlog_debug ("ISIS-Rte (%s) route already exists: %s", area->area_tag, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 493 | buff); |
| 494 | |
| 495 | if (isis_route_info_same (rinfo_new, rinfo_old, family)) |
| 496 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 497 | if (isis->debugs & DEBUG_RTE_EVENTS) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 498 | zlog_debug ("ISIS-Rte (%s) route unchanged: %s", area->area_tag, buff); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 499 | isis_route_info_delete (rinfo_new); |
| 500 | route_info = rinfo_old; |
| 501 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 502 | else if (isis_route_info_same_attrib (rinfo_new, rinfo_old)) |
| 503 | { |
| 504 | /* merge the nexthop lists */ |
| 505 | if (isis->debugs & DEBUG_RTE_EVENTS) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 506 | zlog_debug ("ISIS-Rte (%s) route changed (same attribs): %s", |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 507 | area->area_tag, buff); |
| 508 | #ifdef EXTREME_DEBUG |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 509 | zlog_debug ("Old nexthops"); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 510 | nexthops6_print (rinfo_old->nexthops6); |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 511 | zlog_debug ("New nexthops"); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 512 | nexthops6_print (rinfo_new->nexthops6); |
| 513 | #endif /* EXTREME_DEBUG */ |
| 514 | isis_route_info_merge (rinfo_new, rinfo_old, family); |
| 515 | isis_route_info_delete (rinfo_new); |
| 516 | route_info = rinfo_old; |
| 517 | } |
| 518 | else |
| 519 | { |
| 520 | if (isis_route_info_prefer_new (rinfo_new, rinfo_old)) |
| 521 | { |
| 522 | if (isis->debugs & DEBUG_RTE_EVENTS) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 523 | zlog_debug ("ISIS-Rte (%s) route changed: %s", area->area_tag, |
| 524 | buff); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 525 | isis_route_info_delete (rinfo_old); |
| 526 | route_info = rinfo_new; |
| 527 | } |
| 528 | else |
| 529 | { |
| 530 | if (isis->debugs & DEBUG_RTE_EVENTS) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 531 | zlog_debug ("ISIS-Rte (%s) route rejected: %s", area->area_tag, |
| 532 | buff); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 533 | isis_route_info_delete (rinfo_new); |
| 534 | route_info = rinfo_old; |
| 535 | } |
| 536 | } |
| 537 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 538 | SET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ACTIVE); |
| 539 | route_node->info = route_info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 540 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 541 | return route_info; |
| 542 | } |
| 543 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 544 | static void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 545 | isis_route_delete (struct prefix *prefix, struct route_table *table) |
| 546 | { |
| 547 | struct route_node *rode; |
| 548 | struct isis_route_info *rinfo; |
| 549 | char buff[BUFSIZ]; |
| 550 | |
| 551 | /* for log */ |
| 552 | prefix2str (prefix, buff, BUFSIZ); |
| 553 | |
| 554 | |
| 555 | rode = route_node_get (table, prefix); |
| 556 | rinfo = rode->info; |
| 557 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 558 | if (rinfo == NULL) |
| 559 | { |
| 560 | if (isis->debugs & DEBUG_RTE_EVENTS) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 561 | zlog_debug ("ISIS-Rte: tried to delete non-existant route %s", buff); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 562 | return; |
| 563 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 564 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 565 | if (CHECK_FLAG (rinfo->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNC)) |
| 566 | { |
| 567 | UNSET_FLAG (rinfo->flag, ISIS_ROUTE_FLAG_ACTIVE); |
| 568 | if (isis->debugs & DEBUG_RTE_EVENTS) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 569 | zlog_debug ("ISIS-Rte: route delete %s", buff); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 570 | isis_zebra_route_update (prefix, rinfo); |
| 571 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 572 | isis_route_info_delete (rinfo); |
| 573 | rode->info = NULL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 574 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 575 | return; |
| 576 | } |
| 577 | |
| 578 | int |
| 579 | isis_route_validate (struct thread *thread) |
| 580 | { |
| 581 | struct isis_area *area; |
| 582 | struct route_table *table; |
| 583 | struct route_node *rode; |
| 584 | struct isis_route_info *rinfo; |
| 585 | u_char buff[BUFSIZ]; |
| 586 | #ifdef HAVE_IPV6 |
| 587 | int v6done = 0; |
| 588 | #endif |
| 589 | area = THREAD_ARG (thread); |
| 590 | table = area->route_table; |
| 591 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 592 | again: |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 593 | #endif |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 594 | for (rode = route_top (table); rode; rode = route_next (rode)) |
| 595 | { |
| 596 | if (rode->info == NULL) |
| 597 | continue; |
| 598 | rinfo = rode->info; |
| 599 | |
| 600 | if (isis->debugs & DEBUG_RTE_EVENTS) |
| 601 | { |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 602 | prefix2str (&rode->p, (char *) buff, BUFSIZ); |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 603 | zlog_debug ("ISIS-Rte (%s): route validate: %s %s %s", |
| 604 | area->area_tag, |
| 605 | (CHECK_FLAG (rinfo->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNC) ? |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 606 | "sync'ed" : "nosync"), |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 607 | (CHECK_FLAG (rinfo->flag, ISIS_ROUTE_FLAG_ACTIVE) ? |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 608 | "active" : "inactive"), buff); |
| 609 | } |
| 610 | |
| 611 | isis_zebra_route_update (&rode->p, rinfo); |
| 612 | if (!CHECK_FLAG (rinfo->flag, ISIS_ROUTE_FLAG_ACTIVE)) |
| 613 | isis_route_delete (&rode->p, area->route_table); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 614 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 615 | #ifdef HAVE_IPV6 |
| 616 | if (v6done) |
| 617 | return ISIS_OK; |
| 618 | table = area->route_table6; |
| 619 | v6done = 1; |
| 620 | goto again; |
| 621 | #endif |
| 622 | |
| 623 | return ISIS_OK; |
| 624 | } |