jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * IS-IS Rout(e)ing protocol - isis_zebra.c |
| 3 | * |
| 4 | * Copyright (C) 2001,2002 Sampo Saaristo |
| 5 | * Tampere University of Technology |
| 6 | * Institute of Communications Engineering |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public Licenseas published by the Free |
| 10 | * Software Foundation; either version 2 of the License, or (at your option) |
| 11 | * any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful,but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 16 | * more details. |
| 17 | |
| 18 | * You should have received a copy of the GNU General Public License along |
| 19 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 21 | */ |
| 22 | |
| 23 | #include <zebra.h> |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 24 | |
| 25 | #include "thread.h" |
| 26 | #include "command.h" |
| 27 | #include "memory.h" |
| 28 | #include "log.h" |
| 29 | #include "if.h" |
| 30 | #include "network.h" |
| 31 | #include "prefix.h" |
| 32 | #include "zclient.h" |
| 33 | #include "stream.h" |
| 34 | #include "linklist.h" |
| 35 | |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 36 | #include "isisd/dict.h" |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 37 | #include "isisd/isis_constants.h" |
| 38 | #include "isisd/isis_common.h" |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 39 | #include "isisd/isis_flags.h" |
| 40 | #include "isisd/isis_misc.h" |
| 41 | #include "isisd/isis_circuit.h" |
| 42 | #include "isisd/isis_tlv.h" |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 43 | #include "isisd/isisd.h" |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 44 | #include "isisd/isis_circuit.h" |
| 45 | #include "isisd/isis_csm.h" |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 46 | #include "isisd/isis_lsp.h" |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 47 | #include "isisd/isis_route.h" |
| 48 | #include "isisd/isis_zebra.h" |
| 49 | |
| 50 | struct zclient *zclient = NULL; |
| 51 | |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 52 | /* Router-id update message from zebra. */ |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 53 | static int |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 54 | isis_router_id_update_zebra (int command, struct zclient *zclient, |
| 55 | zebra_size_t length) |
| 56 | { |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 57 | struct isis_area *area; |
| 58 | struct listnode *node; |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 59 | struct prefix router_id; |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 60 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 61 | zebra_router_id_update_read (zclient->ibuf, &router_id); |
| 62 | if (isis->router_id == router_id.u.prefix4.s_addr) |
| 63 | return 0; |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 64 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 65 | isis->router_id = router_id.u.prefix4.s_addr; |
| 66 | for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) |
| 67 | if (listcount (area->area_addrs) > 0) |
| 68 | lsp_regenerate_schedule (area, area->is_type, 0); |
| 69 | |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 70 | return 0; |
| 71 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 72 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 73 | static int |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 74 | isis_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length) |
| 75 | { |
| 76 | struct interface *ifp; |
| 77 | |
| 78 | ifp = zebra_interface_add_read (zclient->ibuf); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 79 | |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 80 | if (isis->debugs & DEBUG_ZEBRA) |
| 81 | zlog_debug ("Zebra I/F add: %s index %d flags %ld metric %d mtu %d", |
Paul Jakma | 41b36e9 | 2006-12-08 01:09:50 +0000 | [diff] [blame] | 82 | ifp->name, ifp->ifindex, (long)ifp->flags, ifp->metric, ifp->mtu); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 83 | |
hasso | b30c5e6 | 2004-12-29 20:06:41 +0000 | [diff] [blame] | 84 | if (if_is_operative (ifp)) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 85 | isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 86 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 87 | return 0; |
| 88 | } |
| 89 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 90 | static int |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 91 | isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length) |
| 92 | { |
| 93 | struct interface *ifp; |
| 94 | struct stream *s; |
| 95 | |
| 96 | s = zclient->ibuf; |
| 97 | ifp = zebra_interface_state_read (s); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 98 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 99 | if (!ifp) |
| 100 | return 0; |
| 101 | |
hasso | b30c5e6 | 2004-12-29 20:06:41 +0000 | [diff] [blame] | 102 | if (if_is_operative (ifp)) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 103 | zlog_warn ("Zebra: got delete of %s, but interface is still up", |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 104 | ifp->name); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 105 | |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 106 | if (isis->debugs & DEBUG_ZEBRA) |
| 107 | zlog_debug ("Zebra I/F delete: %s index %d flags %ld metric %d mtu %d", |
Paul Jakma | 41b36e9 | 2006-12-08 01:09:50 +0000 | [diff] [blame] | 108 | ifp->name, ifp->ifindex, (long)ifp->flags, ifp->metric, ifp->mtu); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 109 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 110 | isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp); |
ajs | d2fc889 | 2005-04-02 18:38:43 +0000 | [diff] [blame] | 111 | |
| 112 | /* Cannot call if_delete because we should retain the pseudo interface |
| 113 | in case there is configuration info attached to it. */ |
| 114 | if_delete_retain(ifp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 115 | |
ajs | d2fc889 | 2005-04-02 18:38:43 +0000 | [diff] [blame] | 116 | ifp->ifindex = IFINDEX_INTERNAL; |
| 117 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 118 | return 0; |
| 119 | } |
| 120 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 121 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 122 | isis_zebra_if_state_up (int command, struct zclient *zclient, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 123 | zebra_size_t length) |
| 124 | { |
| 125 | struct interface *ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 126 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 127 | ifp = zebra_interface_state_read (zclient->ibuf); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 128 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 129 | if (ifp == NULL) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 130 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 131 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 132 | isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 133 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 134 | return 0; |
| 135 | } |
| 136 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 137 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 138 | isis_zebra_if_state_down (int command, struct zclient *zclient, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 139 | zebra_size_t length) |
| 140 | { |
| 141 | struct interface *ifp; |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 142 | struct isis_circuit *circuit; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 143 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 144 | ifp = zebra_interface_state_read (zclient->ibuf); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 145 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 146 | if (ifp == NULL) |
| 147 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 148 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 149 | circuit = isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), |
| 150 | ifp); |
| 151 | if (circuit) |
| 152 | SET_FLAG(circuit->flags, ISIS_CIRCUIT_FLAPPED_AFTER_SPF); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 153 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 154 | return 0; |
| 155 | } |
| 156 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 157 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 158 | isis_zebra_if_address_add (int command, struct zclient *zclient, |
| 159 | zebra_size_t length) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 160 | { |
| 161 | struct connected *c; |
| 162 | struct prefix *p; |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 163 | char buf[BUFSIZ]; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 164 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 165 | c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD, |
| 166 | zclient->ibuf); |
| 167 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 168 | if (c == NULL) |
| 169 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 170 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 171 | p = c->address; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 172 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 173 | prefix2str (p, buf, BUFSIZ); |
| 174 | #ifdef EXTREME_DEBUG |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 175 | if (p->family == AF_INET) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 176 | zlog_debug ("connected IP address %s", buf); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 177 | #ifdef HAVE_IPV6 |
| 178 | if (p->family == AF_INET6) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 179 | zlog_debug ("connected IPv6 address %s", buf); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 180 | #endif /* HAVE_IPV6 */ |
| 181 | #endif /* EXTREME_DEBUG */ |
hasso | b30c5e6 | 2004-12-29 20:06:41 +0000 | [diff] [blame] | 182 | if (if_is_operative (c->ifp)) |
| 183 | isis_circuit_add_addr (circuit_scan_by_ifp (c->ifp), c); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 184 | |
| 185 | return 0; |
| 186 | } |
| 187 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 188 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 189 | isis_zebra_if_address_del (int command, struct zclient *client, |
| 190 | zebra_size_t length) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 191 | { |
| 192 | struct connected *c; |
| 193 | struct interface *ifp; |
hasso | 1cd8084 | 2004-10-07 20:07:40 +0000 | [diff] [blame] | 194 | #ifdef EXTREME_DEBUG |
hasso | f891f44 | 2004-09-14 13:54:30 +0000 | [diff] [blame] | 195 | struct prefix *p; |
| 196 | u_char buf[BUFSIZ]; |
hasso | 1cd8084 | 2004-10-07 20:07:40 +0000 | [diff] [blame] | 197 | #endif /* EXTREME_DEBUG */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 198 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 199 | c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE, |
| 200 | zclient->ibuf); |
| 201 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 202 | if (c == NULL) |
| 203 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 204 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 205 | ifp = c->ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 206 | |
hasso | f891f44 | 2004-09-14 13:54:30 +0000 | [diff] [blame] | 207 | #ifdef EXTREME_DEBUG |
| 208 | p = c->address; |
| 209 | prefix2str (p, buf, BUFSIZ); |
| 210 | |
| 211 | if (p->family == AF_INET) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 212 | zlog_debug ("disconnected IP address %s", buf); |
hasso | f891f44 | 2004-09-14 13:54:30 +0000 | [diff] [blame] | 213 | #ifdef HAVE_IPV6 |
| 214 | if (p->family == AF_INET6) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 215 | zlog_debug ("disconnected IPv6 address %s", buf); |
hasso | f891f44 | 2004-09-14 13:54:30 +0000 | [diff] [blame] | 216 | #endif /* HAVE_IPV6 */ |
| 217 | #endif /* EXTREME_DEBUG */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 218 | |
hasso | b30c5e6 | 2004-12-29 20:06:41 +0000 | [diff] [blame] | 219 | if (if_is_operative (ifp)) |
| 220 | isis_circuit_del_addr (circuit_scan_by_ifp (ifp), c); |
hasso | f891f44 | 2004-09-14 13:54:30 +0000 | [diff] [blame] | 221 | connected_free (c); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 222 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 223 | return 0; |
| 224 | } |
| 225 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 226 | static void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 227 | isis_zebra_route_add_ipv4 (struct prefix *prefix, |
| 228 | struct isis_route_info *route_info) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 229 | { |
| 230 | u_char message, flags; |
| 231 | int psize; |
| 232 | struct stream *stream; |
| 233 | struct isis_nexthop *nexthop; |
| 234 | struct listnode *node; |
| 235 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 236 | if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED)) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 237 | return; |
| 238 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 239 | if (zclient->redist[ZEBRA_ROUTE_ISIS]) |
| 240 | { |
| 241 | message = 0; |
| 242 | flags = 0; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 243 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 244 | SET_FLAG (message, ZAPI_MESSAGE_NEXTHOP); |
| 245 | SET_FLAG (message, ZAPI_MESSAGE_METRIC); |
hasso | 2097cd8 | 2003-12-23 11:51:08 +0000 | [diff] [blame] | 246 | #if 0 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 247 | SET_FLAG (message, ZAPI_MESSAGE_DISTANCE); |
hasso | 2097cd8 | 2003-12-23 11:51:08 +0000 | [diff] [blame] | 248 | #endif |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 249 | |
| 250 | stream = zclient->obuf; |
| 251 | stream_reset (stream); |
paul | d3092e7 | 2006-01-17 17:33:46 +0000 | [diff] [blame] | 252 | zclient_create_header (stream, ZEBRA_IPV4_ROUTE_ADD); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 253 | /* type */ |
| 254 | stream_putc (stream, ZEBRA_ROUTE_ISIS); |
| 255 | /* flags */ |
| 256 | stream_putc (stream, flags); |
| 257 | /* message */ |
| 258 | stream_putc (stream, message); |
| 259 | /* prefix information */ |
| 260 | psize = PSIZE (prefix->prefixlen); |
| 261 | stream_putc (stream, prefix->prefixlen); |
| 262 | stream_write (stream, (u_char *) & prefix->u.prefix4, psize); |
| 263 | |
| 264 | stream_putc (stream, listcount (route_info->nexthops)); |
| 265 | |
| 266 | /* Nexthop, ifindex, distance and metric information */ |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 267 | for (ALL_LIST_ELEMENTS_RO (route_info->nexthops, node, nexthop)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 268 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 269 | /* FIXME: can it be ? */ |
| 270 | if (nexthop->ip.s_addr != INADDR_ANY) |
| 271 | { |
| 272 | stream_putc (stream, ZEBRA_NEXTHOP_IPV4); |
| 273 | stream_put_in_addr (stream, &nexthop->ip); |
| 274 | } |
| 275 | else |
| 276 | { |
| 277 | stream_putc (stream, ZEBRA_NEXTHOP_IFINDEX); |
| 278 | stream_putl (stream, nexthop->ifindex); |
| 279 | } |
| 280 | } |
| 281 | #if 0 |
| 282 | if (CHECK_FLAG (message, ZAPI_MESSAGE_DISTANCE)) |
| 283 | stream_putc (stream, route_info->depth); |
| 284 | #endif |
| 285 | if (CHECK_FLAG (message, ZAPI_MESSAGE_METRIC)) |
| 286 | stream_putl (stream, route_info->cost); |
| 287 | |
| 288 | stream_putw_at (stream, 0, stream_get_endp (stream)); |
ajs | 634f9ea | 2005-04-11 15:51:40 +0000 | [diff] [blame] | 289 | zclient_send_message(zclient); |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 290 | SET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED); |
| 291 | UNSET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_RESYNC); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 292 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 293 | } |
| 294 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 295 | static void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 296 | isis_zebra_route_del_ipv4 (struct prefix *prefix, |
| 297 | struct isis_route_info *route_info) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 298 | { |
| 299 | struct zapi_ipv4 api; |
| 300 | struct prefix_ipv4 prefix4; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 301 | |
| 302 | if (zclient->redist[ZEBRA_ROUTE_ISIS]) |
| 303 | { |
| 304 | api.type = ZEBRA_ROUTE_ISIS; |
| 305 | api.flags = 0; |
| 306 | api.message = 0; |
| 307 | prefix4.family = AF_INET; |
| 308 | prefix4.prefixlen = prefix->prefixlen; |
| 309 | prefix4.prefix = prefix->u.prefix4; |
| 310 | zapi_ipv4_route (ZEBRA_IPV4_ROUTE_DELETE, zclient, &prefix4, &api); |
| 311 | } |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 312 | UNSET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 313 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 314 | return; |
| 315 | } |
| 316 | |
| 317 | #ifdef HAVE_IPV6 |
| 318 | void |
| 319 | isis_zebra_route_add_ipv6 (struct prefix *prefix, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 320 | struct isis_route_info *route_info) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 321 | { |
| 322 | struct zapi_ipv6 api; |
| 323 | struct in6_addr **nexthop_list; |
| 324 | unsigned int *ifindex_list; |
| 325 | struct isis_nexthop6 *nexthop6; |
| 326 | int i, size; |
| 327 | struct listnode *node; |
| 328 | struct prefix_ipv6 prefix6; |
| 329 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 330 | if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED)) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 331 | return; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 332 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 333 | api.type = ZEBRA_ROUTE_ISIS; |
| 334 | api.flags = 0; |
| 335 | api.message = 0; |
| 336 | SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); |
| 337 | SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX); |
| 338 | SET_FLAG (api.message, ZAPI_MESSAGE_METRIC); |
| 339 | api.metric = route_info->cost; |
| 340 | #if 0 |
| 341 | SET_FLAG (api.message, ZAPI_MESSAGE_DISTANCE); |
| 342 | api.distance = route_info->depth; |
| 343 | #endif |
| 344 | api.nexthop_num = listcount (route_info->nexthops6); |
| 345 | api.ifindex_num = listcount (route_info->nexthops6); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 346 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 347 | /* allocate memory for nexthop_list */ |
| 348 | size = sizeof (struct isis_nexthop6 *) * listcount (route_info->nexthops6); |
| 349 | nexthop_list = (struct in6_addr **) XMALLOC (MTYPE_ISIS_TMP, size); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 350 | if (!nexthop_list) |
| 351 | { |
| 352 | zlog_err ("isis_zebra_add_route_ipv6: out of memory!"); |
| 353 | return; |
| 354 | } |
| 355 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 356 | /* allocate memory for ifindex_list */ |
| 357 | size = sizeof (unsigned int) * listcount (route_info->nexthops6); |
| 358 | ifindex_list = (unsigned int *) XMALLOC (MTYPE_ISIS_TMP, size); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 359 | if (!ifindex_list) |
| 360 | { |
| 361 | zlog_err ("isis_zebra_add_route_ipv6: out of memory!"); |
| 362 | XFREE (MTYPE_ISIS_TMP, nexthop_list); |
| 363 | return; |
| 364 | } |
| 365 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 366 | /* for each nexthop */ |
| 367 | i = 0; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 368 | for (ALL_LIST_ELEMENTS_RO (route_info->nexthops6, node, nexthop6)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 369 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 370 | if (!IN6_IS_ADDR_LINKLOCAL (&nexthop6->ip6) && |
| 371 | !IN6_IS_ADDR_UNSPECIFIED (&nexthop6->ip6)) |
| 372 | { |
| 373 | api.nexthop_num--; |
| 374 | api.ifindex_num--; |
| 375 | continue; |
| 376 | } |
| 377 | |
| 378 | nexthop_list[i] = &nexthop6->ip6; |
| 379 | ifindex_list[i] = nexthop6->ifindex; |
| 380 | i++; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 381 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 382 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 383 | api.nexthop = nexthop_list; |
| 384 | api.ifindex = ifindex_list; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 385 | |
| 386 | if (api.nexthop_num && api.ifindex_num) |
| 387 | { |
| 388 | prefix6.family = AF_INET6; |
| 389 | prefix6.prefixlen = prefix->prefixlen; |
| 390 | memcpy (&prefix6.prefix, &prefix->u.prefix6, sizeof (struct in6_addr)); |
| 391 | zapi_ipv6_route (ZEBRA_IPV6_ROUTE_ADD, zclient, &prefix6, &api); |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 392 | SET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED); |
| 393 | UNSET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_RESYNC); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 394 | } |
| 395 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 396 | XFREE (MTYPE_ISIS_TMP, nexthop_list); |
| 397 | XFREE (MTYPE_ISIS_TMP, ifindex_list); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 398 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 399 | return; |
| 400 | } |
| 401 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 402 | static void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 403 | isis_zebra_route_del_ipv6 (struct prefix *prefix, |
| 404 | struct isis_route_info *route_info) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 405 | { |
| 406 | struct zapi_ipv6 api; |
| 407 | struct in6_addr **nexthop_list; |
| 408 | unsigned int *ifindex_list; |
| 409 | struct isis_nexthop6 *nexthop6; |
| 410 | int i, size; |
| 411 | struct listnode *node; |
| 412 | struct prefix_ipv6 prefix6; |
| 413 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 414 | if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED)) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 415 | return; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 416 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 417 | api.type = ZEBRA_ROUTE_ISIS; |
| 418 | api.flags = 0; |
| 419 | api.message = 0; |
| 420 | SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); |
| 421 | SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX); |
| 422 | api.nexthop_num = listcount (route_info->nexthops6); |
| 423 | api.ifindex_num = listcount (route_info->nexthops6); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 424 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 425 | /* allocate memory for nexthop_list */ |
| 426 | size = sizeof (struct isis_nexthop6 *) * listcount (route_info->nexthops6); |
| 427 | nexthop_list = (struct in6_addr **) XMALLOC (MTYPE_ISIS_TMP, size); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 428 | if (!nexthop_list) |
| 429 | { |
| 430 | zlog_err ("isis_zebra_route_del_ipv6: out of memory!"); |
| 431 | return; |
| 432 | } |
| 433 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 434 | /* allocate memory for ifindex_list */ |
| 435 | size = sizeof (unsigned int) * listcount (route_info->nexthops6); |
| 436 | ifindex_list = (unsigned int *) XMALLOC (MTYPE_ISIS_TMP, size); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 437 | if (!ifindex_list) |
| 438 | { |
| 439 | zlog_err ("isis_zebra_route_del_ipv6: out of memory!"); |
| 440 | XFREE (MTYPE_ISIS_TMP, nexthop_list); |
| 441 | return; |
| 442 | } |
| 443 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 444 | /* for each nexthop */ |
| 445 | i = 0; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 446 | for (ALL_LIST_ELEMENTS_RO (route_info->nexthops6, node, nexthop6)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 447 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 448 | if (!IN6_IS_ADDR_LINKLOCAL (&nexthop6->ip6) && |
| 449 | !IN6_IS_ADDR_UNSPECIFIED (&nexthop6->ip6)) |
| 450 | { |
| 451 | api.nexthop_num--; |
| 452 | api.ifindex_num--; |
| 453 | continue; |
| 454 | } |
| 455 | |
| 456 | nexthop_list[i] = &nexthop6->ip6; |
| 457 | ifindex_list[i] = nexthop6->ifindex; |
| 458 | i++; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 459 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 460 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 461 | api.nexthop = nexthop_list; |
| 462 | api.ifindex = ifindex_list; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 463 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 464 | if (api.nexthop_num && api.ifindex_num) |
| 465 | { |
| 466 | prefix6.family = AF_INET6; |
| 467 | prefix6.prefixlen = prefix->prefixlen; |
| 468 | memcpy (&prefix6.prefix, &prefix->u.prefix6, sizeof (struct in6_addr)); |
| 469 | zapi_ipv6_route (ZEBRA_IPV6_ROUTE_DELETE, zclient, &prefix6, &api); |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame^] | 470 | UNSET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 471 | } |
| 472 | |
| 473 | XFREE (MTYPE_ISIS_TMP, nexthop_list); |
| 474 | XFREE (MTYPE_ISIS_TMP, ifindex_list); |
| 475 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 476 | |
| 477 | #endif /* HAVE_IPV6 */ |
| 478 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 479 | void |
| 480 | isis_zebra_route_update (struct prefix *prefix, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 481 | struct isis_route_info *route_info) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 482 | { |
| 483 | if (zclient->sock < 0) |
| 484 | return; |
| 485 | |
| 486 | if (!zclient->redist[ZEBRA_ROUTE_ISIS]) |
| 487 | return; |
| 488 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 489 | if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ACTIVE)) |
| 490 | { |
| 491 | if (prefix->family == AF_INET) |
| 492 | isis_zebra_route_add_ipv4 (prefix, route_info); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 493 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 494 | else if (prefix->family == AF_INET6) |
| 495 | isis_zebra_route_add_ipv6 (prefix, route_info); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 496 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 497 | } |
| 498 | else |
| 499 | { |
| 500 | if (prefix->family == AF_INET) |
| 501 | isis_zebra_route_del_ipv4 (prefix, route_info); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 502 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 503 | else if (prefix->family == AF_INET6) |
| 504 | isis_zebra_route_del_ipv6 (prefix, route_info); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 505 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 506 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 507 | return; |
| 508 | } |
| 509 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 510 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 511 | isis_zebra_read_ipv4 (int command, struct zclient *zclient, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 512 | zebra_size_t length) |
| 513 | { |
| 514 | struct stream *stream; |
| 515 | struct zapi_ipv4 api; |
| 516 | struct prefix_ipv4 p; |
| 517 | unsigned long ifindex; |
| 518 | struct in_addr nexthop; |
| 519 | |
| 520 | stream = zclient->ibuf; |
| 521 | memset (&p, 0, sizeof (struct prefix_ipv4)); |
| 522 | ifindex = 0; |
| 523 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 524 | api.type = stream_getc (stream); |
| 525 | api.flags = stream_getc (stream); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 526 | api.message = stream_getc (stream); |
| 527 | |
| 528 | p.family = AF_INET; |
| 529 | p.prefixlen = stream_getc (stream); |
| 530 | stream_get (&p.prefix, stream, PSIZE (p.prefixlen)); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 531 | |
| 532 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP)) |
| 533 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 534 | api.nexthop_num = stream_getc (stream); |
| 535 | nexthop.s_addr = stream_get_ipv4 (stream); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 536 | } |
| 537 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_IFINDEX)) |
| 538 | { |
| 539 | api.ifindex_num = stream_getc (stream); |
| 540 | ifindex = stream_getl (stream); |
| 541 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 542 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE)) |
| 543 | api.distance = stream_getc (stream); |
| 544 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_METRIC)) |
| 545 | api.metric = stream_getl (stream); |
| 546 | else |
| 547 | api.metric = 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 548 | |
| 549 | if (command == ZEBRA_IPV4_ROUTE_ADD) |
| 550 | { |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 551 | if (isis->debugs & DEBUG_ZEBRA) |
| 552 | zlog_debug ("IPv4 Route add from Z"); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 553 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 554 | |
| 555 | return 0; |
| 556 | } |
| 557 | |
Paul Jakma | 41b36e9 | 2006-12-08 01:09:50 +0000 | [diff] [blame] | 558 | #ifdef HAVE_IPV6 |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 559 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 560 | isis_zebra_read_ipv6 (int command, struct zclient *zclient, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 561 | zebra_size_t length) |
| 562 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 563 | return 0; |
| 564 | } |
Paul Jakma | 41b36e9 | 2006-12-08 01:09:50 +0000 | [diff] [blame] | 565 | #endif |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 566 | |
| 567 | #define ISIS_TYPE_IS_REDISTRIBUTED(T) \ |
| 568 | T == ZEBRA_ROUTE_MAX ? zclient->default_information : zclient->redist[type] |
| 569 | |
| 570 | int |
| 571 | isis_distribute_list_update (int routetype) |
| 572 | { |
| 573 | return 0; |
| 574 | } |
| 575 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 576 | #if 0 /* Not yet. */ |
| 577 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 578 | isis_redistribute_default_set (int routetype, int metric_type, |
| 579 | int metric_value) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 580 | { |
| 581 | return 0; |
| 582 | } |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 583 | #endif /* 0 */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 584 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 585 | void |
| 586 | isis_zebra_init () |
| 587 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 588 | zclient = zclient_new (); |
| 589 | zclient_init (zclient, ZEBRA_ROUTE_ISIS); |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 590 | zclient->router_id_update = isis_router_id_update_zebra; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 591 | zclient->interface_add = isis_zebra_if_add; |
| 592 | zclient->interface_delete = isis_zebra_if_del; |
| 593 | zclient->interface_up = isis_zebra_if_state_up; |
| 594 | zclient->interface_down = isis_zebra_if_state_down; |
| 595 | zclient->interface_address_add = isis_zebra_if_address_add; |
| 596 | zclient->interface_address_delete = isis_zebra_if_address_del; |
| 597 | zclient->ipv4_route_add = isis_zebra_read_ipv4; |
| 598 | zclient->ipv4_route_delete = isis_zebra_read_ipv4; |
| 599 | #ifdef HAVE_IPV6 |
| 600 | zclient->ipv6_route_add = isis_zebra_read_ipv6; |
| 601 | zclient->ipv6_route_delete = isis_zebra_read_ipv6; |
| 602 | #endif /* HAVE_IPV6 */ |
| 603 | |
| 604 | return; |
| 605 | } |