ports/156332: net/quagga - update to 0.99.18
Ingo Flaschberger
if at FreeBSD.org
Mon Apr 11 15:10:18 UTC 2011
>Number: 156332
>Category: ports
>Synopsis: net/quagga - update to 0.99.18
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Mon Apr 11 15:10:17 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Ingo Flaschberger
>Release:
>Organization:
crossip communications gmbh
>Environment:
>Description:
patchset for quagga 0.99.18 update:
needed:
patch-bgp_attr
patch-configure.ac
patch-git-1 - build fixes
patch-git-2 - build fixes
patch-git-3 - build fixes
patch-lib-sockopt.c
patch-ospf6d - resolve ospg6d segfault
patch-ospf6d-segfault - resolve ospg6d segfault
optional:
patch-blackhole - save blackhole/reject routes correctly
patch-ospf6d-log - log neighbour changes
patch-rtadv - cosmetic patch for ipv6 nd router-preference
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
diff -r -N -upwb ../quagga-0.99.17/Makefile ./Makefile
--- ../quagga-0.99.17/Makefile 2011-04-02 13:13:57.000000000 +0000
+++ ./Makefile 2011-04-02 13:14:33.000000000 +0000
@@ -6,8 +6,8 @@
#
PORTNAME= quagga
-PORTVERSION= 0.99.17
-PORTREVISION= 5
+PORTVERSION= 0.99.18
+PORTREVISION= 1
CATEGORIES= net ipv6
MASTER_SITES= http://quagga.net/download/ \
http://www.ru.quagga.net/download/ \
diff -r -N -upwb ../quagga-0.99.17/distinfo ./distinfo
--- ../quagga-0.99.17/distinfo 2011-04-02 13:13:57.000000000 +0000
+++ ./distinfo 2011-04-02 13:14:33.000000000 +0000
@@ -1,2 +1,2 @@
-SHA256 (quagga-0.99.17.tar.gz) = 1d77df121a334e9504b45e489ee7ce35bf478e27d33cd2793a23280b59d9efd4
-SIZE (quagga-0.99.17.tar.gz) = 2202151
+SHA256 (quagga-0.99.18.tar.gz) = 0cdbe4b90075f4997ca6ecc71ef683a07b4a8ca3c718080fe83f4bcadbcc4d93
+SIZE (quagga-0.99.18.tar.gz) = 2199014
diff -r -N -upwb ../quagga-0.99.17/files/patch-bgp_attr ./files/patch-bgp_attr
--- ../quagga-0.99.17/files/patch-bgp_attr 1970-01-01 00:00:00.000000000 +0000
+++ ./files/patch-bgp_attr 2011-04-02 13:14:06.000000000 +0000
@@ -0,0 +1,13 @@
+--- ../quagga-0.99.18_org/bgpd/bgp_attr.c 2011-03-21 15:32:49.000000000 +0100
++++ bgpd/bgp_attr.c 2011-03-31 19:19:41.000000000 +0200
+@@ -373,8 +373,8 @@
+
+ #ifdef HAVE_IPV6
+ MIX(attr->extra->mp_nexthop_len);
+- key = jhash2(attr->extra->mp_nexthop_global.s6_addr32, 4, key);
+- key = jhash2(attr->extra->mp_nexthop_local.s6_addr32, 4, key);
++ key = jhash2(attr->extra->mp_nexthop_global.s6_addr, 16, key);
++ key = jhash2(attr->extra->mp_nexthop_global.s6_addr, 16, key);
+ #endif /* HAVE_IPV6 */
+ }
+
diff -r -N -upwb ../quagga-0.99.17/files/patch-blackhole ./files/patch-blackhole
--- ../quagga-0.99.17/files/patch-blackhole 1970-01-01 00:00:00.000000000 +0000
+++ ./files/patch-blackhole 2011-04-02 13:14:06.000000000 +0000
@@ -0,0 +1,16 @@
+diff -u -r ../quagga-0.99.18_org/zebra/zebra_vty.c ./zebra/zebra_vty.c
+--- ../quagga-0.99.18_org/zebra/zebra_vty.c 2011-03-21 10:43:52.000000000 +0100
++++ ./zebra/zebra_vty.c 2011-03-31 17:39:10.000000000 +0200
+@@ -1169,7 +1169,11 @@
+ vty_out (vty, " %s", si->gate.ifname);
+ break;
+ case STATIC_IPV4_BLACKHOLE:
+- vty_out (vty, " Null0");
++ if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT)) {
++ vty_out (vty, " %s", "reject");
++ } else {
++ vty_out (vty, " Null0");
++ }
+ break;
+ }
+
diff -r -N -upwb ../quagga-0.99.17/files/patch-git-1 ./files/patch-git-1
--- ../quagga-0.99.17/files/patch-git-1 2011-04-02 13:13:57.000000000 +0000
+++ ./files/patch-git-1 2011-04-02 13:14:06.000000000 +0000
@@ -1,14 +1,99 @@
-diff --git bgpd/bgp_route.c bgpd/bgp_route.c
-index 2391f74..1cfc451 100644
---- bgpd/bgp_route.c
-+++ bgpd/bgp_route.c
-@@ -6145,7 +6145,8 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
- bgp_damp_info_vty (vty, binfo);
-
- /* Line 7 display Uptime */
-- vty_out (vty, " Last update: %s", ctime (&binfo->uptime));
-+ time_t tbuf = time(NULL) - (bgp_clock() - binfo->uptime);
-+ vty_out (vty, " Last update: %s", ctime(&tbuf));
+diff --git ospfd/ospf_lsa.h ospfd/ospf_lsa.h
+index fee3470..72e2f8a 100644
+--- ospfd/ospf_lsa.h
++++ ospfd/ospf_lsa.h
+@@ -114,6 +114,9 @@ struct ospf_lsa
+
+ /* Refreshement List or Queue */
+ int refresh_list;
++
++ /* For Type-9 Opaque-LSAs */
++ struct ospf_interface *oi;
+ };
+
+ /* OSPF LSA Link Type. */
+diff --git ospfd/ospf_nsm.c ospfd/ospf_nsm.c
+index 279d2a0..cbc3171 100644
+--- ospfd/ospf_nsm.c
++++ ospfd/ospf_nsm.c
+@@ -216,7 +216,7 @@ ospf_db_summary_add (struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
+ {
+ case OSPF_OPAQUE_LINK_LSA:
+ /* Exclude type-9 LSAs that does not have the same "oi" with "nbr". */
+- if (lsa->oi != nbr->oi)
++ if (nbr->oi && ospf_if_exists (lsa->oi) != nbr->oi)
+ return 0;
+ break;
+ case OSPF_OPAQUE_AREA_LSA:
+diff --git ospfd/ospf_opaque.c ospfd/ospf_opaque.c
+index 6e90011..aa126e1 100644
+--- ospfd/ospf_opaque.c
++++ ospfd/ospf_opaque.c
+@@ -251,7 +251,7 @@ struct ospf_opaque_functab
+ void (* config_write_debug )(struct vty *vty);
+ void (* show_opaque_info )(struct vty *vty, struct ospf_lsa *lsa);
+ int (* lsa_originator)(void *arg);
+- void (* lsa_refresher )(struct ospf_lsa *lsa);
++ struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa);
+ int (* new_lsa_hook)(struct ospf_lsa *lsa);
+ int (* del_lsa_hook)(struct ospf_lsa *lsa);
+ };
+@@ -354,7 +354,7 @@ ospf_register_opaque_functab (
+ void (* config_write_debug )(struct vty *vty),
+ void (* show_opaque_info )(struct vty *vty, struct ospf_lsa *lsa),
+ int (* lsa_originator)(void *arg),
+- void (* lsa_refresher )(struct ospf_lsa *lsa),
++ struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa),
+ int (* new_lsa_hook)(struct ospf_lsa *lsa),
+ int (* del_lsa_hook)(struct ospf_lsa *lsa))
+ {
+@@ -1608,12 +1608,13 @@ out:
+ return new;
+ }
+
+-void
++struct ospf_lsa *
+ ospf_opaque_lsa_refresh (struct ospf_lsa *lsa)
+ {
+ struct ospf *ospf;
+ struct ospf_opaque_functab *functab;
+-
++ struct ospf_lsa *new = NULL;
++
+ ospf = ospf_lookup ();
+
+ if ((functab = ospf_opaque_functab_lookup (lsa)) == NULL
+@@ -1633,9 +1634,9 @@ ospf_opaque_lsa_refresh (struct ospf_lsa *lsa)
+ ospf_lsa_flush (ospf, lsa);
}
- vty_out (vty, "%s", VTY_NEWLINE);
+ else
+- (* functab->lsa_refresher)(lsa);
++ new = (* functab->lsa_refresher)(lsa);
+
+- return;
++ return new;
}
+
+ /*------------------------------------------------------------------------*
+diff --git ospfd/ospf_opaque.h ospfd/ospf_opaque.h
+index f49fe46..2273064 100644
+--- ospfd/ospf_opaque.h
++++ ospfd/ospf_opaque.h
+@@ -120,7 +120,7 @@ ospf_register_opaque_functab (
+ void (* config_write_debug )(struct vty *vty),
+ void (* show_opaque_info )(struct vty *vty, struct ospf_lsa *lsa),
+ int (* lsa_originator)(void *arg),
+- void (* lsa_refresher )(struct ospf_lsa *lsa),
++ struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa),
+ int (* new_lsa_hook)(struct ospf_lsa *lsa),
+ int (* del_lsa_hook)(struct ospf_lsa *lsa)
+ );
+@@ -143,7 +143,7 @@ extern void ospf_opaque_lsa_originate_schedule (struct ospf_interface *oi,
+ int *init_delay);
+ extern struct ospf_lsa *ospf_opaque_lsa_install (struct ospf_lsa *,
+ int rt_recalc);
+-extern void ospf_opaque_lsa_refresh (struct ospf_lsa *lsa);
++extern struct ospf_lsa *ospf_opaque_lsa_refresh (struct ospf_lsa *lsa);
+
+ extern void ospf_opaque_lsa_reoriginate_schedule (void *lsa_type_dependent,
+ u_char lsa_type,
diff -r -N -upwb ../quagga-0.99.17/files/patch-git-2 ./files/patch-git-2
--- ../quagga-0.99.17/files/patch-git-2 2011-04-02 13:13:57.000000000 +0000
+++ ./files/patch-git-2 2011-04-02 13:14:06.000000000 +0000
@@ -1,20 +1,33 @@
-diff --git a/lib/zclient.c b/lib/zclient.c
-index d3d5322..52a3627 100644
---- lib/zclient.c
-+++ lib/zclient.c
-@@ -339,12 +339,12 @@ zclient_start (struct zclient *zclient)
- /* Create read thread. */
- zclient_event (ZCLIENT_READ, zclient);
+diff --git bgpd/bgp_route.c bgpd/bgp_route.c
+index 8c05ba6..5c516f0 100644
+--- bgpd/bgp_route.c
++++ bgpd/bgp_route.c
+@@ -4327,6 +4327,7 @@ ALIAS_DEPRECATED (no_bgp_network_mask_natural,
+ "Specify a BGP backdoor route\n"
+ "AS-Path hopcount limit attribute\n"
+ "AS-Pathlimit TTL, in number of AS-Path hops\n")
++#ifdef HAVE_IPV6
+ ALIAS_DEPRECATED (ipv6_bgp_network,
+ ipv6_bgp_network_ttl_cmd,
+ "network X:X::X:X/M pathlimit <0-255>",
+@@ -4342,6 +4343,7 @@ ALIAS_DEPRECATED (no_ipv6_bgp_network,
+ "IPv6 prefix <network>/<length>\n"
+ "AS-Path hopcount limit attribute\n"
+ "AS-Pathlimit TTL, in number of AS-Path hops\n")
++#endif /* HAVE_IPV6 */
-- /* We need interface information. */
-- zebra_message_send (zclient, ZEBRA_INTERFACE_ADD);
--
- /* We need router-id information. */
- zebra_message_send (zclient, ZEBRA_ROUTER_ID_ADD);
+ /* Aggreagete address:
-+ /* We need interface information. */
-+ zebra_message_send (zclient, ZEBRA_INTERFACE_ADD);
+@@ -12958,9 +12960,11 @@ bgp_route_init (void)
+ install_element (BGP_IPV4M_NODE, &no_bgp_network_backdoor_ttl_cmd);
+ install_element (BGP_IPV4M_NODE, &no_bgp_network_mask_backdoor_ttl_cmd);
+ install_element (BGP_IPV4M_NODE, &no_bgp_network_mask_natural_backdoor_ttl_cmd);
+-
+
- /* Flush all redistribute request. */
- for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
- if (i != zclient->redist_default && zclient->redist[i])
++#ifdef HAVE_IPV6
+ install_element (BGP_IPV6_NODE, &ipv6_bgp_network_ttl_cmd);
+ install_element (BGP_IPV6_NODE, &no_ipv6_bgp_network_ttl_cmd);
++#endif
+ }
+
+ void
diff -r -N -upwb ../quagga-0.99.17/files/patch-git-3 ./files/patch-git-3
--- ../quagga-0.99.17/files/patch-git-3 2011-04-02 13:13:57.000000000 +0000
+++ ./files/patch-git-3 2011-04-02 13:14:06.000000000 +0000
@@ -1,40 +1,26 @@
-diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
-index bfb6df2..04367f0 100644
---- ospf6d/ospf6_spf.c
-+++ ospf6d/ospf6_spf.c
-@@ -50,7 +50,9 @@ ospf6_vertex_cmp (void *a, void *b)
- struct ospf6_vertex *vb = (struct ospf6_vertex *) b;
+diff --git lib/command.c lib/command.c
+index 5a13f39..264e0f7 100644
+--- lib/command.c
++++ lib/command.c
+@@ -3056,7 +3056,7 @@ DEFUN (config_logmsg,
+ if ((level = level_match(argv[0])) == ZLOG_DISABLED)
+ return CMD_ERR_NO_MATCH;
- /* ascending order */
-- return (va->cost - vb->cost);
-+ if (va->cost != vb->cost)
-+ return (va->cost - vb->cost);
-+ return (va->hops - vb->hops);
+- zlog(NULL, level, ((message = argv_concat(argv, argc, 1)) ? message : ""));
++ zlog(NULL, level, "%s", ((message = argv_concat(argv, argc, 1)) ? message : ""));
+ if (message)
+ XFREE(MTYPE_TMP, message);
+ return CMD_SUCCESS;
+diff --git lib/if.c lib/if.c
+index b61bdbf..86f754b 100644
+--- lib/if.c
++++ lib/if.c
+@@ -664,7 +664,7 @@ connected_log (struct connected *connected, char *str)
+ strncat (logbuf, inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ),
+ BUFSIZ - strlen(logbuf));
}
-
- static int
-@@ -320,22 +322,8 @@ ospf6_spf_install (struct ospf6_vertex *v,
+- zlog (NULL, LOG_INFO, logbuf);
++ zlog (NULL, LOG_INFO, "%s", logbuf);
}
- prev = (struct ospf6_vertex *) route->route_option;
-- if (prev->hops > v->hops)
-- {
-- for (ALL_LIST_ELEMENTS (prev->child_list, node, nnode, w))
-- {
-- assert (w->parent == prev);
-- w->parent = v;
-- listnode_add_sort (v->child_list, w);
-- }
-- listnode_delete (prev->parent->child_list, prev);
-- listnode_add_sort (v->parent->child_list, v);
--
-- ospf6_vertex_delete (prev);
-- route->route_option = v;
-- }
-- else
-- ospf6_vertex_delete (v);
-+ assert (prev->hops <= v->hops);
-+ ospf6_vertex_delete (v);
-
- return -1;
- }
+ /* If two connected address has same prefix return 1. */
diff -r -N -upwb ../quagga-0.99.17/files/patch-git-4 ./files/patch-git-4
--- ../quagga-0.99.17/files/patch-git-4 2011-04-02 13:13:57.000000000 +0000
+++ ./files/patch-git-4 1970-01-01 00:00:00.000000000 +0000
@@ -1,17 +0,0 @@
-diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
-index a5f9552..9102add 100644
---- bgpd/bgp_packet.c
-+++ bgpd/bgp_packet.c
-@@ -1885,12 +1885,6 @@ bgp_notify_receive (struct peer *peer, bgp_size_t size)
- bgp_notify.subcode == BGP_NOTIFY_OPEN_UNSUP_PARAM )
- UNSET_FLAG (peer->sflags, PEER_STATUS_CAPABILITY_OPEN);
-
-- /* Also apply to Unsupported Capability until remote router support
-- capability. */
-- if (bgp_notify.code == BGP_NOTIFY_OPEN_ERR &&
-- bgp_notify.subcode == BGP_NOTIFY_OPEN_UNSUP_CAPBL)
-- UNSET_FLAG (peer->sflags, PEER_STATUS_CAPABILITY_OPEN);
--
- BGP_EVENT_ADD (peer, Receive_NOTIFICATION_message);
- }
-
diff -r -N -upwb ../quagga-0.99.17/files/patch-ospf6d ./files/patch-ospf6d
--- ../quagga-0.99.17/files/patch-ospf6d 1970-01-01 00:00:00.000000000 +0000
+++ ./files/patch-ospf6d 2011-04-02 13:14:06.000000000 +0000
@@ -0,0 +1,45 @@
+diff -u -r ../quagga-0.99.18_org/ospf6d/ospf6_message.c ./ospf6d/ospf6_message.c
+--- ../quagga-0.99.18_org/ospf6d/ospf6_message.c 2011-03-21 14:43:34.000000000 +0100
++++ ./ospf6d/ospf6_message.c 2011-03-31 17:12:04.000000000 +0200
+@@ -1396,6 +1396,13 @@
+ return 0;
+ }
+
++ if (iobuflen == 0)
++ {
++ zlog_debug ("Unable to send Hello on interface %s iobuflen is 0",
++ oi->interface->name);
++ return 0;
++ }
++
+ /* set next thread */
+ oi->thread_send_hello = thread_add_timer (master, ospf6_hello_send,
+ oi, oi->hello_interval);
+diff -u -r ../quagga-0.99.18_org/zebra/kernel_socket.c ./zebra/kernel_socket.c
+--- ../quagga-0.99.18_org/zebra/kernel_socket.c 2011-03-21 10:43:52.000000000 +0100
++++ ./zebra/kernel_socket.c 2011-03-31 17:38:05.000000000 +0200
+@@ -280,14 +280,19 @@
+ sizeof(ifan->ifan_name)));
+ ifp->ifindex = ifan->ifan_index;
+
++ if_get_flags (ifp);
++ if_get_mtu (ifp);
++ if_get_metric (ifp);
++
+ if_add_update (ifp);
+ }
+ else if (ifp != NULL && ifan->ifan_what == IFAN_DEPARTURE)
+- if_delete_update (ifp);
+-
+- if_get_flags (ifp);
+- if_get_mtu (ifp);
+- if_get_metric (ifp);
++ {
++ if_get_flags (ifp);
++ if_get_mtu (ifp);
++ if_get_metric (ifp);
++ if_delete_update (ifp);
++ }
+
+ if (IS_ZEBRA_DEBUG_KERNEL)
+ zlog_debug ("%s: interface %s index %d",
diff -r -N -upwb ../quagga-0.99.17/files/patch-ospf6d-log ./files/patch-ospf6d-log
--- ../quagga-0.99.17/files/patch-ospf6d-log 1970-01-01 00:00:00.000000000 +0000
+++ ./files/patch-ospf6d-log 2011-04-02 13:14:06.000000000 +0000
@@ -0,0 +1,302 @@
+diff -u -r ../quagga-0.99.18_org/ospf6d/ospf6_neighbor.c ./ospf6d/ospf6_neighbor.c
+--- ../quagga-0.99.18_org/ospf6d/ospf6_neighbor.c 2011-03-21 10:43:52.000000000 +0100
++++ ./ospf6d/ospf6_neighbor.c 2011-03-31 17:19:30.000000000 +0200
+@@ -141,12 +141,29 @@
+ THREAD_OFF (on->thread_send_lsack);
+
+ XFREE (MTYPE_OSPF6_NEIGHBOR, on);
++
+ }
++
++const char *ospf6_nsm_event_str[] =
++{
++ "NoEvent",
++ "HelloReceived",
++ "2-WayReceived",
++ "NegotiationDone",
++ "ExchangeDone",
++ "LoadingDone",
++ "AdjOK?",
++ "SeqNumberMismatch",
++ "BadLSReq",
++ "1-WayReceived",
++ "InactivityTimer"
++};
+
+ static void
+-ospf6_neighbor_state_change (u_char next_state, struct ospf6_neighbor *on)
++ospf6_neighbor_state_change (u_char next_state, struct ospf6_neighbor *on, int event)
+ {
+ u_char prev_state;
++ char router_id[16];
+
+ prev_state = on->state;
+ on->state = next_state;
+@@ -159,9 +176,25 @@
+ /* log */
+ if (IS_OSPF6_DEBUG_NEIGHBOR (STATE))
+ {
+- zlog_debug ("Neighbor state change %s: [%s]->[%s]", on->name,
+- ospf6_neighbor_state_str[prev_state],
+- ospf6_neighbor_state_str[next_state]);
++ inet_ntop (AF_INET, &on->router_id, router_id, sizeof (router_id));
++ zlog_debug ("Neighbor state change %s: [%s]->[%s] (%s)", router_id,
++ ospf6_neighbor_state_str[prev_state],
++ ospf6_neighbor_state_str[next_state],
++ ospf6_nsm_event_str [event]);
++ }
++
++ /* Optionally notify about adjacency changes */
++ if (CHECK_FLAG(on->ospf6_if->area->ospf6->flag, OSPF6_LOG_ADJACENCY_CHANGES) &&
++ (CHECK_FLAG(on->ospf6_if->area->ospf6->flag, OSPF6_LOG_ADJACENCY_DETAIL) ||
++ (next_state == OSPF6_NEIGHBOR_FULL) || (next_state < on->state)))
++ {
++ inet_ntop (AF_INET, &on->router_id, router_id, sizeof (router_id));
++ zlog_notice("AdjChg: Nbr %s on %s: %s -> %s (%s)",
++ router_id, on->ospf6_if->interface->name,
++ ospf6_neighbor_state_str[prev_state],
++ ospf6_neighbor_state_str[next_state],
++ ospf6_nsm_event_str [event]);
++
+ }
+
+ if (prev_state == OSPF6_NEIGHBOR_FULL || next_state == OSPF6_NEIGHBOR_FULL)
+@@ -215,7 +248,7 @@
+ on->ospf6_if->dead_interval);
+
+ if (on->state <= OSPF6_NEIGHBOR_DOWN)
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_INIT, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_INIT, on, OSPF6_EVENT_HELLO_RECV);
+
+ return 0;
+ }
+@@ -238,11 +271,11 @@
+
+ if (! need_adjacency (on))
+ {
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_TWOWAY, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_TWOWAY, on, OSPF6_EVENT_2WAY);
+ return 0;
+ }
+
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on, OSPF6_EVENT_2WAY);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT);
+@@ -319,7 +352,7 @@
+ }
+
+ UNSET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT);
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXCHANGE, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXCHANGE, on, OSPF6_EVENT_NEG_DONE);
+
+ return 0;
+ }
+@@ -347,9 +380,9 @@
+ */
+
+ if (on->request_list->count == 0)
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_FULL, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_FULL, on, OSPF6_EVENT_EXCH_DONE);
+ else
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_LOADING, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_LOADING, on, OSPF6_EVENT_EXCH_DONE);
+
+ return 0;
+ }
+@@ -370,7 +403,7 @@
+
+ assert (on->request_list->count == 0);
+
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_FULL, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_FULL, on, OSPF6_EVENT_LOAD_DONE);
+
+ return 0;
+ }
+@@ -389,7 +422,7 @@
+
+ if (on->state == OSPF6_NEIGHBOR_TWOWAY && need_adjacency (on))
+ {
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on, OSPF6_EVENT_ADJ_OK);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT);
+@@ -402,7 +435,7 @@
+ else if (on->state >= OSPF6_NEIGHBOR_EXSTART &&
+ ! need_adjacency (on))
+ {
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_TWOWAY, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_TWOWAY, on, OSPF6_EVENT_ADJ_OK);
+ ospf6_lsdb_remove_all (on->summary_list);
+ ospf6_lsdb_remove_all (on->request_list);
+ for (lsa = ospf6_lsdb_head (on->retrans_list); lsa;
+@@ -431,7 +464,7 @@
+ if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT))
+ zlog_debug ("Neighbor Event %s: *SeqNumberMismatch*", on->name);
+
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on, OSPF6_EVENT_SEQ_MISS);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT);
+@@ -467,7 +500,7 @@
+ if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT))
+ zlog_debug ("Neighbor Event %s: *BadLSReq*", on->name);
+
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on, OSPF6_EVENT_BAD_LSREQ);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT);
+ SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT);
+@@ -503,7 +536,7 @@
+ if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT))
+ zlog_debug ("Neighbor Event %s: *1Way-Received*", on->name);
+
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_INIT, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_INIT, on, OSPF6_EVENT_1WAY_RECV);
+ thread_add_event (master, neighbor_change, on->ospf6_if, 0);
+
+ ospf6_lsdb_remove_all (on->summary_list);
+@@ -538,7 +571,7 @@
+ on->drouter = on->prev_drouter = 0;
+ on->bdrouter = on->prev_bdrouter = 0;
+
+- ospf6_neighbor_state_change (OSPF6_NEIGHBOR_DOWN, on);
++ ospf6_neighbor_state_change (OSPF6_NEIGHBOR_DOWN, on, OSPF6_EVENT_INACT_T);
+ thread_add_event (master, neighbor_change, on->ospf6_if, 0);
+
+ listnode_delete (on->ospf6_if->neighbor_list, on);
+diff -u -r ../quagga-0.99.18_org/ospf6d/ospf6_neighbor.h ./ospf6d/ospf6_neighbor.h
+--- ../quagga-0.99.18_org/ospf6d/ospf6_neighbor.h 2011-03-21 10:43:52.000000000 +0100
++++ ./ospf6d/ospf6_neighbor.h 2011-03-31 17:20:15.000000000 +0200
+@@ -107,6 +107,20 @@
+
+ extern const char *ospf6_neighbor_state_str[];
+
++/* Neighbor event state */
++#define OSPF6_EVENT_HELLO_RECV 1
++#define OSPF6_EVENT_2WAY 2
++#define OSPF6_EVENT_NEG_DONE 3
++#define OSPF6_EVENT_EXCH_DONE 4
++#define OSPF6_EVENT_LOAD_DONE 5
++#define OSPF6_EVENT_ADJ_OK 6
++#define OSPF6_EVENT_SEQ_MISS 7
++#define OSPF6_EVENT_BAD_LSREQ 8
++#define OSPF6_EVENT_1WAY_RECV 9
++#define OSPF6_EVENT_INACT_T 10
++
++extern const char *ospf6_nsm_event_str[];
++
+
+ /* Function Prototypes */
+ int ospf6_neighbor_cmp (void *va, void *vb);
+diff -u -r ../quagga-0.99.18_org/ospf6d/ospf6_top.c ./ospf6d/ospf6_top.c
+--- ../quagga-0.99.18_org/ospf6d/ospf6_top.c 2011-03-21 14:43:34.000000000 +0100
++++ ./ospf6d/ospf6_top.c 2011-03-31 17:23:51.000000000 +0200
+@@ -312,6 +312,60 @@
+ return CMD_SUCCESS;
+ }
+
++DEFUN (ospf6_log_adjacency_changes,
++ ospf6_log_adjacency_changes_cmd,
++ "log-adjacency-changes",
++ "Log changes in adjacency state\n")
++{
++ struct ospf6 *o;
++ o = (struct ospf6 *) vty->index;
++
++ SET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_CHANGES);
++ return CMD_SUCCESS;
++}
++
++DEFUN (ospf6_log_adjacency_changes_detail,
++ ospf6_log_adjacency_changes_detail_cmd,
++ "log-adjacency-changes detail",
++ "Log changes in adjacency state\n"
++ "Log all state changes\n")
++{
++ struct ospf6 *o;
++ o = (struct ospf6 *) vty->index;
++
++ SET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_CHANGES);
++ SET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_DETAIL);
++ return CMD_SUCCESS;
++}
++
++DEFUN (no_ospf6_log_adjacency_changes,
++ no_ospf6_log_adjacency_changes_cmd,
++ "no log-adjacency-changes",
++ NO_STR
++ "Log changes in adjacency state\n")
++{
++ struct ospf6 *o;
++ o = (struct ospf6 *) vty->index;
++
++ UNSET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_DETAIL);
++ UNSET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_CHANGES);
++ return CMD_SUCCESS;
++}
++
++DEFUN (no_ospf6_log_adjacency_changes_detail,
++ no_ospf6_log_adjacency_changes_detail_cmd,
++ "no log-adjacency-changes detail",
++ NO_STR
++ "Log changes in adjacency state\n"
++ "Log all state changes\n")
++{
++ struct ospf6 *o;
++ o = (struct ospf6 *) vty->index;
++
++ UNSET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_DETAIL);
++ return CMD_SUCCESS;
++}
++
+ DEFUN (ospf6_interface_area,
+ ospf6_interface_area_cmd,
+ "interface IFNAME area A.B.C.D",
+@@ -648,6 +702,15 @@
+ if (ospf6->router_id_static != 0)
+ vty_out (vty, " router-id %s%s", router_id, VNL);
+
++ /* log-adjacency-changes flag print. */
++ if (CHECK_FLAG(ospf6->flag, OSPF6_LOG_ADJACENCY_CHANGES))
++ {
++ vty_out(vty, " log-adjacency-changes");
++ if (CHECK_FLAG(ospf6->flag, OSPF6_LOG_ADJACENCY_DETAIL))
++ vty_out(vty, " detail");
++ vty_out(vty, "%s", VTY_NEWLINE);
++ }
++
+ ospf6_redistribute_config_write (vty);
+ ospf6_area_config_write (vty);
+
+@@ -700,6 +763,13 @@
+
+ install_default (OSPF6_NODE);
+ install_element (OSPF6_NODE, &ospf6_router_id_cmd);
++
++ /* "ospf log-adjacency-changes" commands. */
++ install_element (OSPF6_NODE, &ospf6_log_adjacency_changes_cmd);
++ install_element (OSPF6_NODE, &ospf6_log_adjacency_changes_detail_cmd);
++ install_element (OSPF6_NODE, &no_ospf6_log_adjacency_changes_cmd);
++ install_element (OSPF6_NODE, &no_ospf6_log_adjacency_changes_detail_cmd);
++
+ install_element (OSPF6_NODE, &ospf6_interface_area_cmd);
+ install_element (OSPF6_NODE, &no_ospf6_interface_area_cmd);
+ }
+diff -u -r ../quagga-0.99.18_org/ospf6d/ospf6_top.h ./ospf6d/ospf6_top.h
+--- ../quagga-0.99.18_org/ospf6d/ospf6_top.h 2011-03-21 14:43:34.000000000 +0100
++++ ./ospf6d/ospf6_top.h 2011-03-31 17:24:33.000000000 +0200
+@@ -62,7 +62,9 @@
+ struct thread *maxage_remover;
+ };
+
+-#define OSPF6_DISABLED 0x01
++#define OSPF6_DISABLED 0x01
++#define OSPF6_LOG_ADJACENCY_CHANGES 0x02
++#define OSPF6_LOG_ADJACENCY_DETAIL 0x04
+
+ /* global pointer for OSPF top data structure */
+ extern struct ospf6 *ospf6;
diff -r -N -upwb ../quagga-0.99.17/files/patch-ospf6d-segfault ./files/patch-ospf6d-segfault
--- ../quagga-0.99.17/files/patch-ospf6d-segfault 1970-01-01 00:00:00.000000000 +0000
+++ ./files/patch-ospf6d-segfault 2011-04-02 13:14:06.000000000 +0000
@@ -0,0 +1,12 @@
+--- ../quagga-0.99.18_org/ospf6d/ospf6_zebra.c 2011-03-21 10:43:52.000000000 +0100
++++ ospf6d/ospf6_zebra.c 2011-04-02 00:24:49.000000000 +0200
+@@ -132,6 +132,9 @@
+ struct interface *ifp;
+
+ ifp = zebra_interface_state_read (zclient->ibuf);
++ if (ifp == NULL)
++ return 0;
++
+ if (IS_OSPF6_DEBUG_ZEBRA (RECV))
+ zlog_debug ("Zebra Interface state change: "
+ "%s index %d flags %llx metric %d mtu %d",
diff -r -N -upwb ../quagga-0.99.17/files/patch-rtadv ./files/patch-rtadv
--- ../quagga-0.99.17/files/patch-rtadv 1970-01-01 00:00:00.000000000 +0000
+++ ./files/patch-rtadv 2011-04-11 11:02:18.000000000 +0000
@@ -0,0 +1,13 @@
+--- ../quagga-0.99.18_org/zebra/rtadv.c 2011-04-02 13:22:09.000000000 +0000
++++ zebra/rtadv.c 2011-04-11 11:01:34.000000000 +0000
+@@ -1388,8 +1388,8 @@
+ "Neighbor discovery\n"
+ "Default router preference\n"
+ "High default router preference\n"
+- "Low default router preference\n"
+- "Medium default router preference (default)\n")
++ "Medium default router preference (default)\n"
++ "Low default router preference\n")
+ {
+ struct interface *ifp;
+ struct zebra_if *zif;
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list