@@ -325,53 +325,47 @@ static int bgp_interface_address_add(ZAPI_CALLBACK_ARGS)
325
325
if (!bgp )
326
326
return 0 ;
327
327
328
- if (if_is_operative (ifc -> ifp )) {
329
- bgp_connected_add ( bgp , ifc ) ;
328
+ if (! if_is_operative (ifc -> ifp ))
329
+ return 0 ;
330
330
331
- /* If we have learnt of any neighbors on this interface,
332
- * check to kick off any BGP interface-based neighbors,
333
- * but only if this is a link-local address.
334
- */
335
- if (IN6_IS_ADDR_LINKLOCAL (& ifc -> address -> u .prefix6 )
336
- && !list_isempty (ifc -> ifp -> nbr_connected ))
337
- bgp_start_interface_nbrs (bgp , ifc -> ifp );
338
- else if (ifc -> address -> family == AF_INET6 &&
339
- !IN6_IS_ADDR_LINKLOCAL (& ifc -> address -> u .prefix6 )) {
340
- addr = ifc -> address ;
341
-
342
- for (ALL_LIST_ELEMENTS (bgp -> peer , node , nnode , peer )) {
343
- /*
344
- * If the Peer's interface name matches the
345
- * interface name for which BGP received the
346
- * update and if the received interface address
347
- * is a globalV6 and if the peer is currently
348
- * using a v4-mapped-v6 addr or a link local
349
- * address, then copy the Rxed global v6 addr
350
- * into peer's v6_global and send updates out
351
- * with new nexthop addr.
352
- */
353
- if ((peer -> conf_if &&
354
- (strcmp (peer -> conf_if , ifc -> ifp -> name ) ==
355
- 0 )) &&
356
- ((IS_MAPPED_IPV6 (
357
- & peer -> nexthop .v6_global )) ||
358
- IN6_IS_ADDR_LINKLOCAL (
359
- & peer -> nexthop .v6_global ))) {
360
-
361
- if (bgp_debug_zebra (ifc -> address )) {
362
- zlog_debug (
363
- "Update peer %pBP's current intf addr %pI6 and send updates" ,
364
- peer ,
365
- & peer -> nexthop
366
- .v6_global );
367
- }
368
- memcpy (& peer -> nexthop .v6_global ,
369
- & addr -> u .prefix6 ,
370
- IPV6_MAX_BYTELEN );
371
- FOREACH_AFI_SAFI (afi , safi )
372
- bgp_announce_route (peer , afi ,
373
- safi , true);
331
+ bgp_connected_add (bgp , ifc );
332
+
333
+ /* If we have learnt of any neighbors on this interface,
334
+ * check to kick off any BGP interface-based neighbors,
335
+ * but only if this is a link-local address.
336
+ */
337
+ if (IN6_IS_ADDR_LINKLOCAL (& ifc -> address -> u .prefix6 ) &&
338
+ !list_isempty (ifc -> ifp -> nbr_connected ))
339
+ bgp_start_interface_nbrs (bgp , ifc -> ifp );
340
+ else if (ifc -> address -> family == AF_INET6 &&
341
+ !IN6_IS_ADDR_LINKLOCAL (& ifc -> address -> u .prefix6 )) {
342
+ addr = ifc -> address ;
343
+
344
+ for (ALL_LIST_ELEMENTS (bgp -> peer , node , nnode , peer )) {
345
+ /*
346
+ * If the Peer's interface name matches the
347
+ * interface name for which BGP received the
348
+ * update and if the received interface address
349
+ * is a globalV6 and if the peer is currently
350
+ * using a v4-mapped-v6 addr or a link local
351
+ * address, then copy the Rxed global v6 addr
352
+ * into peer's v6_global and send updates out
353
+ * with new nexthop addr.
354
+ */
355
+ if ((peer -> conf_if &&
356
+ (strcmp (peer -> conf_if , ifc -> ifp -> name ) == 0 )) &&
357
+ ((IS_MAPPED_IPV6 (& peer -> nexthop .v6_global )) ||
358
+ IN6_IS_ADDR_LINKLOCAL (& peer -> nexthop .v6_global ))) {
359
+ if (bgp_debug_zebra (ifc -> address )) {
360
+ zlog_debug ("Update peer %pBP's current intf addr %pI6 and send updates" ,
361
+ peer ,
362
+ & peer -> nexthop .v6_global );
374
363
}
364
+ memcpy (& peer -> nexthop .v6_global ,
365
+ & addr -> u .prefix6 , IPV6_MAX_BYTELEN );
366
+ FOREACH_AFI_SAFI (afi , safi )
367
+ bgp_announce_route (peer , afi , safi ,
368
+ true);
375
369
}
376
370
}
377
371
}
0 commit comments