View | Details | Raw Unified | Return to bug 156332 | Differences between
and this patch

Collapse All | Expand All

(-)./Makefile (-2 / +2 lines)
Lines 6-13 Link Here
6
#
6
#
7
7
8
PORTNAME=	quagga
8
PORTNAME=	quagga
9
PORTVERSION=	0.99.17
9
PORTVERSION=	0.99.18
10
PORTREVISION=	5
10
PORTREVISION=	1
11
CATEGORIES=	net ipv6
11
CATEGORIES=	net ipv6
12
MASTER_SITES=	http://quagga.net/download/ \
12
MASTER_SITES=	http://quagga.net/download/ \
13
		http://www.ru.quagga.net/download/ \
13
		http://www.ru.quagga.net/download/ \
(-)./distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (quagga-0.99.17.tar.gz) = 1d77df121a334e9504b45e489ee7ce35bf478e27d33cd2793a23280b59d9efd4
1
SHA256 (quagga-0.99.18.tar.gz) = 0cdbe4b90075f4997ca6ecc71ef683a07b4a8ca3c718080fe83f4bcadbcc4d93
2
SIZE (quagga-0.99.17.tar.gz) = 2202151
2
SIZE (quagga-0.99.18.tar.gz) = 2199014
(-)./files/patch-bgp_attr (+13 lines)
Line 0 Link Here
1
--- ../quagga-0.99.18_org/bgpd/bgp_attr.c	2011-03-21 15:32:49.000000000 +0100
2
+++ bgpd/bgp_attr.c	2011-03-31 19:19:41.000000000 +0200
3
@@ -373,8 +373,8 @@
4
 
5
 #ifdef HAVE_IPV6
6
       MIX(attr->extra->mp_nexthop_len);
7
-      key = jhash2(attr->extra->mp_nexthop_global.s6_addr32, 4, key);
8
-      key = jhash2(attr->extra->mp_nexthop_local.s6_addr32, 4, key);
9
+      key = jhash2(attr->extra->mp_nexthop_global.s6_addr, 16, key);
10
+      key = jhash2(attr->extra->mp_nexthop_global.s6_addr, 16, key);
11
 #endif /* HAVE_IPV6 */
12
     }
13
 
(-)./files/patch-blackhole (+16 lines)
Line 0 Link Here
1
diff -u -r ../quagga-0.99.18_org/zebra/zebra_vty.c ./zebra/zebra_vty.c
2
--- ../quagga-0.99.18_org/zebra/zebra_vty.c	2011-03-21 10:43:52.000000000 +0100
3
+++ ./zebra/zebra_vty.c	2011-03-31 17:39:10.000000000 +0200
4
@@ -1169,7 +1169,11 @@
5
               vty_out (vty, " %s", si->gate.ifname);
6
               break;
7
             case STATIC_IPV4_BLACKHOLE:
8
-              vty_out (vty, " Null0");
9
+              if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT)) {
10
+                vty_out (vty, " %s", "reject");
11
+              } else {
12
+                vty_out (vty, " Null0");
13
+              }
14
               break;
15
           }
16
         
(-)./files/patch-git-1 (-12 / +97 lines)
Lines 1-14 Link Here
1
diff --git bgpd/bgp_route.c bgpd/bgp_route.c
1
diff --git ospfd/ospf_lsa.h ospfd/ospf_lsa.h
2
index 2391f74..1cfc451 100644
2
index fee3470..72e2f8a 100644
3
--- bgpd/bgp_route.c
3
--- ospfd/ospf_lsa.h
4
+++ bgpd/bgp_route.c
4
+++ ospfd/ospf_lsa.h
5
@@ -6145,7 +6145,8 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
5
@@ -114,6 +114,9 @@ struct ospf_lsa
6
 	bgp_damp_info_vty (vty, binfo);
6
 
7
 
7
   /* Refreshement List or Queue */
8
       /* Line 7 display Uptime */
8
   int refresh_list;
9
-      vty_out (vty, "      Last update: %s", ctime (&binfo->uptime));
9
+  
10
+      time_t tbuf = time(NULL) - (bgp_clock() - binfo->uptime);
10
+  /* For Type-9 Opaque-LSAs */
11
+      vty_out (vty, "      Last update: %s", ctime(&tbuf));
11
+  struct ospf_interface *oi;
12
 };
13
 
14
 /* OSPF LSA Link Type. */
15
diff --git ospfd/ospf_nsm.c ospfd/ospf_nsm.c
16
index 279d2a0..cbc3171 100644
17
--- ospfd/ospf_nsm.c
18
+++ ospfd/ospf_nsm.c
19
@@ -216,7 +216,7 @@ ospf_db_summary_add (struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
20
     {
21
     case OSPF_OPAQUE_LINK_LSA:
22
       /* Exclude type-9 LSAs that does not have the same "oi" with "nbr". */
23
-      if (lsa->oi != nbr->oi)
24
+      if (nbr->oi && ospf_if_exists (lsa->oi) != nbr->oi)
25
           return 0;
26
       break;
27
     case OSPF_OPAQUE_AREA_LSA:
28
diff --git ospfd/ospf_opaque.c ospfd/ospf_opaque.c
29
index 6e90011..aa126e1 100644
30
--- ospfd/ospf_opaque.c
31
+++ ospfd/ospf_opaque.c
32
@@ -251,7 +251,7 @@ struct ospf_opaque_functab
33
   void (* config_write_debug )(struct vty *vty);
34
   void (* show_opaque_info   )(struct vty *vty, struct ospf_lsa *lsa);
35
   int  (* lsa_originator)(void *arg);
36
-  void (* lsa_refresher )(struct ospf_lsa *lsa);
37
+  struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa);
38
   int (* new_lsa_hook)(struct ospf_lsa *lsa);
39
   int (* del_lsa_hook)(struct ospf_lsa *lsa);
40
 };
41
@@ -354,7 +354,7 @@ ospf_register_opaque_functab (
42
   void (* config_write_debug )(struct vty *vty),
43
   void (* show_opaque_info   )(struct vty *vty, struct ospf_lsa *lsa),
44
   int  (* lsa_originator)(void *arg),
45
-  void (* lsa_refresher )(struct ospf_lsa *lsa),
46
+  struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa),
47
   int (* new_lsa_hook)(struct ospf_lsa *lsa),
48
   int (* del_lsa_hook)(struct ospf_lsa *lsa))
49
 {
50
@@ -1608,12 +1608,13 @@ out:
51
   return new;
52
 }
53
 
54
-void
55
+struct ospf_lsa *
56
 ospf_opaque_lsa_refresh (struct ospf_lsa *lsa)
57
 {
58
   struct ospf *ospf;
59
   struct ospf_opaque_functab *functab;
60
-
61
+  struct ospf_lsa *new = NULL;
62
+  
63
   ospf = ospf_lookup ();
64
 
65
   if ((functab = ospf_opaque_functab_lookup (lsa)) == NULL
66
@@ -1633,9 +1634,9 @@ ospf_opaque_lsa_refresh (struct ospf_lsa *lsa)
67
       ospf_lsa_flush (ospf, lsa);
12
     }
68
     }
13
   vty_out (vty, "%s", VTY_NEWLINE);
69
   else
70
-    (* functab->lsa_refresher)(lsa);
71
+    new = (* functab->lsa_refresher)(lsa);
72
 
73
-  return;
74
+  return new;
14
 }  
75
 }  
76
 
77
 /*------------------------------------------------------------------------*
78
diff --git ospfd/ospf_opaque.h ospfd/ospf_opaque.h
79
index f49fe46..2273064 100644
80
--- ospfd/ospf_opaque.h
81
+++ ospfd/ospf_opaque.h
82
@@ -120,7 +120,7 @@ ospf_register_opaque_functab (
83
   void (* config_write_debug )(struct vty *vty),
84
   void (* show_opaque_info   )(struct vty *vty, struct ospf_lsa *lsa),
85
   int  (* lsa_originator)(void *arg),
86
-  void (* lsa_refresher )(struct ospf_lsa *lsa),
87
+  struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa),
88
   int (* new_lsa_hook)(struct ospf_lsa *lsa),
89
   int (* del_lsa_hook)(struct ospf_lsa *lsa)
90
 );
91
@@ -143,7 +143,7 @@ extern void ospf_opaque_lsa_originate_schedule (struct ospf_interface *oi,
92
 						int *init_delay);
93
 extern struct ospf_lsa *ospf_opaque_lsa_install (struct ospf_lsa *,
94
 						 int rt_recalc);
95
-extern void ospf_opaque_lsa_refresh (struct ospf_lsa *lsa);
96
+extern struct ospf_lsa *ospf_opaque_lsa_refresh (struct ospf_lsa *lsa);
97
 
98
 extern void ospf_opaque_lsa_reoriginate_schedule (void *lsa_type_dependent,
99
 						  u_char lsa_type,
(-)./files/patch-git-2 (-17 / +30 lines)
Lines 1-20 Link Here
1
diff --git a/lib/zclient.c b/lib/zclient.c
1
diff --git bgpd/bgp_route.c bgpd/bgp_route.c
2
index d3d5322..52a3627 100644
2
index 8c05ba6..5c516f0 100644
3
--- lib/zclient.c
3
--- bgpd/bgp_route.c
4
+++ lib/zclient.c
4
+++ bgpd/bgp_route.c
5
@@ -339,12 +339,12 @@ zclient_start (struct zclient *zclient)
5
@@ -4327,6 +4327,7 @@ ALIAS_DEPRECATED (no_bgp_network_mask_natural,
6
   /* Create read thread. */
6
        "Specify a BGP backdoor route\n"
7
   zclient_event (ZCLIENT_READ, zclient);
7
        "AS-Path hopcount limit attribute\n"
8
        "AS-Pathlimit TTL, in number of AS-Path hops\n")
9
+#ifdef HAVE_IPV6
10
 ALIAS_DEPRECATED (ipv6_bgp_network,
11
        ipv6_bgp_network_ttl_cmd,
12
        "network X:X::X:X/M pathlimit <0-255>",
13
@@ -4342,6 +4343,7 @@ ALIAS_DEPRECATED (no_ipv6_bgp_network,
14
        "IPv6 prefix <network>/<length>\n"
15
        "AS-Path hopcount limit attribute\n"
16
        "AS-Pathlimit TTL, in number of AS-Path hops\n")
17
+#endif /* HAVE_IPV6 */
8
 
18
 
9
-  /* We need interface information. */
19
 /* Aggreagete address:
10
-  zebra_message_send (zclient, ZEBRA_INTERFACE_ADD);
11
-
12
   /* We need router-id information. */
13
   zebra_message_send (zclient, ZEBRA_ROUTER_ID_ADD);
14
 
20
 
15
+  /* We need interface information. */
21
@@ -12958,9 +12960,11 @@ bgp_route_init (void)
16
+  zebra_message_send (zclient, ZEBRA_INTERFACE_ADD);
22
   install_element (BGP_IPV4M_NODE, &no_bgp_network_backdoor_ttl_cmd);
23
   install_element (BGP_IPV4M_NODE, &no_bgp_network_mask_backdoor_ttl_cmd);
24
   install_element (BGP_IPV4M_NODE, &no_bgp_network_mask_natural_backdoor_ttl_cmd);
25
-  
17
+
26
+
18
   /* Flush all redistribute request. */
27
+#ifdef HAVE_IPV6
19
   for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
28
   install_element (BGP_IPV6_NODE, &ipv6_bgp_network_ttl_cmd);
20
     if (i != zclient->redist_default && zclient->redist[i])
29
   install_element (BGP_IPV6_NODE, &no_ipv6_bgp_network_ttl_cmd);
30
+#endif
31
 }
32
 
33
 void
(-)./files/patch-git-3 (-36 / +22 lines)
Lines 1-40 Link Here
1
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
1
diff --git lib/command.c lib/command.c
2
index bfb6df2..04367f0 100644
2
index 5a13f39..264e0f7 100644
3
--- ospf6d/ospf6_spf.c
3
--- lib/command.c
4
+++ ospf6d/ospf6_spf.c
4
+++ lib/command.c
5
@@ -50,7 +50,9 @@ ospf6_vertex_cmp (void *a, void *b)
5
@@ -3056,7 +3056,7 @@ DEFUN (config_logmsg,
6
   struct ospf6_vertex *vb = (struct ospf6_vertex *) b;
6
   if ((level = level_match(argv[0])) == ZLOG_DISABLED)
7
     return CMD_ERR_NO_MATCH;
7
 
8
 
8
   /* ascending order */
9
-  zlog(NULL, level, ((message = argv_concat(argv, argc, 1)) ? message : ""));
9
-  return (va->cost - vb->cost);
10
+  zlog(NULL, level, "%s", ((message = argv_concat(argv, argc, 1)) ? message : ""));
10
+  if (va->cost != vb->cost)
11
   if (message)
11
+    return (va->cost - vb->cost);
12
     XFREE(MTYPE_TMP, message);
12
+  return (va->hops - vb->hops);
13
   return CMD_SUCCESS;
14
diff --git lib/if.c lib/if.c
15
index b61bdbf..86f754b 100644
16
--- lib/if.c
17
+++ lib/if.c
18
@@ -664,7 +664,7 @@ connected_log (struct connected *connected, char *str)
19
       strncat (logbuf, inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ),
20
 	       BUFSIZ - strlen(logbuf));
13
 }
21
 }
14
 
22
-  zlog (NULL, LOG_INFO, logbuf);
15
 static int
23
+  zlog (NULL, LOG_INFO, "%s", logbuf);
16
@@ -320,22 +322,8 @@ ospf6_spf_install (struct ospf6_vertex *v,
17
         }
24
         }
18
 
25
 
19
       prev = (struct ospf6_vertex *) route->route_option;
26
 /* If two connected address has same prefix return 1. */
20
-      if (prev->hops > v->hops)
21
-        {
22
-          for (ALL_LIST_ELEMENTS (prev->child_list, node, nnode, w))
23
-            {
24
-              assert (w->parent == prev);
25
-              w->parent = v;
26
-              listnode_add_sort (v->child_list, w);
27
-            }
28
-          listnode_delete (prev->parent->child_list, prev);
29
-          listnode_add_sort (v->parent->child_list, v);
30
-
31
-          ospf6_vertex_delete (prev);
32
-          route->route_option = v;
33
-        }
34
-      else
35
-        ospf6_vertex_delete (v);
36
+      assert (prev->hops <= v->hops);
37
+      ospf6_vertex_delete (v);
38
 
39
       return -1;
40
     }
(-)./files/patch-git-4 (-17 lines)
Lines 1-17 Link Here
1
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
2
index a5f9552..9102add 100644
3
--- bgpd/bgp_packet.c
4
+++ bgpd/bgp_packet.c
5
@@ -1885,12 +1885,6 @@ bgp_notify_receive (struct peer *peer, bgp_size_t size)
6
       bgp_notify.subcode == BGP_NOTIFY_OPEN_UNSUP_PARAM )
7
     UNSET_FLAG (peer->sflags, PEER_STATUS_CAPABILITY_OPEN);
8
 
9
-  /* Also apply to Unsupported Capability until remote router support
10
-     capability. */
11
-  if (bgp_notify.code == BGP_NOTIFY_OPEN_ERR &&
12
-      bgp_notify.subcode == BGP_NOTIFY_OPEN_UNSUP_CAPBL)
13
-    UNSET_FLAG (peer->sflags, PEER_STATUS_CAPABILITY_OPEN);
14
-
15
   BGP_EVENT_ADD (peer, Receive_NOTIFICATION_message);
16
 }
17
 
(-)./files/patch-ospf6d (+45 lines)
Line 0 Link Here
1
diff -u -r ../quagga-0.99.18_org/ospf6d/ospf6_message.c ./ospf6d/ospf6_message.c
2
--- ../quagga-0.99.18_org/ospf6d/ospf6_message.c	2011-03-21 14:43:34.000000000 +0100
3
+++ ./ospf6d/ospf6_message.c	2011-03-31 17:12:04.000000000 +0200
4
@@ -1396,6 +1396,13 @@
5
       return 0;
6
     }
7
 
8
+  if (iobuflen == 0)
9
+    {
10
+      zlog_debug ("Unable to send Hello on interface %s iobuflen is 0",
11
+                   oi->interface->name);
12
+      return 0;
13
+    }
14
+
15
   /* set next thread */
16
   oi->thread_send_hello = thread_add_timer (master, ospf6_hello_send,
17
                                             oi, oi->hello_interval);
18
diff -u -r ../quagga-0.99.18_org/zebra/kernel_socket.c ./zebra/kernel_socket.c
19
--- ../quagga-0.99.18_org/zebra/kernel_socket.c	2011-03-21 10:43:52.000000000 +0100
20
+++ ./zebra/kernel_socket.c	2011-03-31 17:38:05.000000000 +0200
21
@@ -280,14 +280,19 @@
22
 				       sizeof(ifan->ifan_name)));
23
       ifp->ifindex = ifan->ifan_index;
24
 
25
+      if_get_flags (ifp);
26
+      if_get_mtu (ifp);
27
+      if_get_metric (ifp);
28
+
29
       if_add_update (ifp);
30
     }
31
   else if (ifp != NULL && ifan->ifan_what == IFAN_DEPARTURE)
32
-    if_delete_update (ifp);
33
-
34
-  if_get_flags (ifp);
35
-  if_get_mtu (ifp);
36
-  if_get_metric (ifp);
37
+    {
38
+      if_get_flags (ifp);
39
+      if_get_mtu (ifp);
40
+      if_get_metric (ifp);
41
+      if_delete_update (ifp);
42
+    }
43
 
44
   if (IS_ZEBRA_DEBUG_KERNEL)
45
     zlog_debug ("%s: interface %s index %d", 
(-)./files/patch-ospf6d-log (+302 lines)
Line 0 Link Here
1
diff -u -r ../quagga-0.99.18_org/ospf6d/ospf6_neighbor.c ./ospf6d/ospf6_neighbor.c
2
--- ../quagga-0.99.18_org/ospf6d/ospf6_neighbor.c	2011-03-21 10:43:52.000000000 +0100
3
+++ ./ospf6d/ospf6_neighbor.c	2011-03-31 17:19:30.000000000 +0200
4
@@ -141,12 +141,29 @@
5
   THREAD_OFF (on->thread_send_lsack);
6
 
7
   XFREE (MTYPE_OSPF6_NEIGHBOR, on);
8
+
9
 }
10
+  
11
+const char *ospf6_nsm_event_str[] =
12
+{
13
+  "NoEvent",
14
+  "HelloReceived",
15
+  "2-WayReceived",
16
+  "NegotiationDone",
17
+  "ExchangeDone",
18
+  "LoadingDone",
19
+  "AdjOK?",
20
+  "SeqNumberMismatch",
21
+  "BadLSReq",
22
+  "1-WayReceived",
23
+  "InactivityTimer"
24
+};
25
 
26
 static void
27
-ospf6_neighbor_state_change (u_char next_state, struct ospf6_neighbor *on)
28
+ospf6_neighbor_state_change (u_char next_state, struct ospf6_neighbor *on, int event)
29
 {
30
   u_char prev_state;
31
+  char router_id[16];
32
 
33
   prev_state = on->state;
34
   on->state = next_state;
35
@@ -159,9 +176,25 @@
36
   /* log */
37
   if (IS_OSPF6_DEBUG_NEIGHBOR (STATE))
38
     {
39
-      zlog_debug ("Neighbor state change %s: [%s]->[%s]", on->name,
40
-		  ospf6_neighbor_state_str[prev_state],
41
-		  ospf6_neighbor_state_str[next_state]);
42
+      inet_ntop (AF_INET, &on->router_id, router_id, sizeof (router_id));
43
+      zlog_debug ("Neighbor state change %s: [%s]->[%s] (%s)", router_id,
44
+                  ospf6_neighbor_state_str[prev_state],
45
+                  ospf6_neighbor_state_str[next_state],
46
+                  ospf6_nsm_event_str [event]);
47
+    }
48
+
49
+    /* Optionally notify about adjacency changes */
50
+  if (CHECK_FLAG(on->ospf6_if->area->ospf6->flag, OSPF6_LOG_ADJACENCY_CHANGES) &&
51
+      (CHECK_FLAG(on->ospf6_if->area->ospf6->flag, OSPF6_LOG_ADJACENCY_DETAIL) ||
52
+       (next_state == OSPF6_NEIGHBOR_FULL) || (next_state < on->state)))
53
+    {
54
+      inet_ntop (AF_INET, &on->router_id, router_id, sizeof (router_id));
55
+      zlog_notice("AdjChg: Nbr %s on %s: %s -> %s (%s)",
56
+                  router_id, on->ospf6_if->interface->name,
57
+                  ospf6_neighbor_state_str[prev_state],
58
+                  ospf6_neighbor_state_str[next_state],
59
+                  ospf6_nsm_event_str [event]);
60
+    
61
     }
62
 
63
   if (prev_state == OSPF6_NEIGHBOR_FULL || next_state == OSPF6_NEIGHBOR_FULL)
64
@@ -215,7 +248,7 @@
65
                                            on->ospf6_if->dead_interval);
66
 
67
   if (on->state <= OSPF6_NEIGHBOR_DOWN)
68
-    ospf6_neighbor_state_change (OSPF6_NEIGHBOR_INIT, on);
69
+    ospf6_neighbor_state_change (OSPF6_NEIGHBOR_INIT, on, OSPF6_EVENT_HELLO_RECV);
70
 
71
   return 0;
72
 }
73
@@ -238,11 +271,11 @@
74
 
75
   if (! need_adjacency (on))
76
     {
77
-      ospf6_neighbor_state_change (OSPF6_NEIGHBOR_TWOWAY, on);
78
+      ospf6_neighbor_state_change (OSPF6_NEIGHBOR_TWOWAY, on, OSPF6_EVENT_2WAY);
79
       return 0;
80
     }
81
 
82
-  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on);
83
+  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on, OSPF6_EVENT_2WAY);
84
   SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT);
85
   SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT);
86
   SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT);
87
@@ -319,7 +352,7 @@
88
     }
89
 
90
   UNSET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT);
91
-  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXCHANGE, on);
92
+  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXCHANGE, on, OSPF6_EVENT_NEG_DONE);
93
 
94
   return 0;
95
 }
96
@@ -347,9 +380,9 @@
97
 */
98
 
99
   if (on->request_list->count == 0)
100
-    ospf6_neighbor_state_change (OSPF6_NEIGHBOR_FULL, on);
101
+    ospf6_neighbor_state_change (OSPF6_NEIGHBOR_FULL, on, OSPF6_EVENT_EXCH_DONE);
102
   else
103
-    ospf6_neighbor_state_change (OSPF6_NEIGHBOR_LOADING, on);
104
+    ospf6_neighbor_state_change (OSPF6_NEIGHBOR_LOADING, on, OSPF6_EVENT_EXCH_DONE);
105
 
106
   return 0;
107
 }
108
@@ -370,7 +403,7 @@
109
 
110
   assert (on->request_list->count == 0);
111
 
112
-  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_FULL, on);
113
+  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_FULL, on, OSPF6_EVENT_LOAD_DONE);
114
 
115
   return 0;
116
 }
117
@@ -389,7 +422,7 @@
118
 
119
   if (on->state == OSPF6_NEIGHBOR_TWOWAY && need_adjacency (on))
120
     {
121
-      ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on);
122
+      ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on, OSPF6_EVENT_ADJ_OK);
123
       SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT);
124
       SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT);
125
       SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT);
126
@@ -402,7 +435,7 @@
127
   else if (on->state >= OSPF6_NEIGHBOR_EXSTART &&
128
            ! need_adjacency (on))
129
     {
130
-      ospf6_neighbor_state_change (OSPF6_NEIGHBOR_TWOWAY, on);
131
+      ospf6_neighbor_state_change (OSPF6_NEIGHBOR_TWOWAY, on, OSPF6_EVENT_ADJ_OK);
132
       ospf6_lsdb_remove_all (on->summary_list);
133
       ospf6_lsdb_remove_all (on->request_list);
134
       for (lsa = ospf6_lsdb_head (on->retrans_list); lsa;
135
@@ -431,7 +464,7 @@
136
   if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT))
137
     zlog_debug ("Neighbor Event %s: *SeqNumberMismatch*", on->name);
138
 
139
-  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on);
140
+  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on, OSPF6_EVENT_SEQ_MISS);
141
   SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT);
142
   SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT);
143
   SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT);
144
@@ -467,7 +500,7 @@
145
   if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT))
146
     zlog_debug ("Neighbor Event %s: *BadLSReq*", on->name);
147
 
148
-  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on);
149
+  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_EXSTART, on, OSPF6_EVENT_BAD_LSREQ);
150
   SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MSBIT);
151
   SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_MBIT);
152
   SET_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT);
153
@@ -503,7 +536,7 @@
154
   if (IS_OSPF6_DEBUG_NEIGHBOR (EVENT))
155
     zlog_debug ("Neighbor Event %s: *1Way-Received*", on->name);
156
 
157
-  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_INIT, on);
158
+  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_INIT, on, OSPF6_EVENT_1WAY_RECV);
159
   thread_add_event (master, neighbor_change, on->ospf6_if, 0);
160
 
161
   ospf6_lsdb_remove_all (on->summary_list);
162
@@ -538,7 +571,7 @@
163
   on->drouter = on->prev_drouter = 0;
164
   on->bdrouter = on->prev_bdrouter = 0;
165
 
166
-  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_DOWN, on);
167
+  ospf6_neighbor_state_change (OSPF6_NEIGHBOR_DOWN, on, OSPF6_EVENT_INACT_T);
168
   thread_add_event (master, neighbor_change, on->ospf6_if, 0);
169
 
170
   listnode_delete (on->ospf6_if->neighbor_list, on);
171
diff -u -r ../quagga-0.99.18_org/ospf6d/ospf6_neighbor.h ./ospf6d/ospf6_neighbor.h
172
--- ../quagga-0.99.18_org/ospf6d/ospf6_neighbor.h	2011-03-21 10:43:52.000000000 +0100
173
+++ ./ospf6d/ospf6_neighbor.h	2011-03-31 17:20:15.000000000 +0200
174
@@ -107,6 +107,20 @@
175
 
176
 extern const char *ospf6_neighbor_state_str[];
177
 
178
+/* Neighbor event state */
179
+#define OSPF6_EVENT_HELLO_RECV  1
180
+#define OSPF6_EVENT_2WAY        2
181
+#define OSPF6_EVENT_NEG_DONE    3
182
+#define OSPF6_EVENT_EXCH_DONE   4
183
+#define OSPF6_EVENT_LOAD_DONE   5
184
+#define OSPF6_EVENT_ADJ_OK      6
185
+#define OSPF6_EVENT_SEQ_MISS    7
186
+#define OSPF6_EVENT_BAD_LSREQ   8
187
+#define OSPF6_EVENT_1WAY_RECV   9
188
+#define OSPF6_EVENT_INACT_T     10
189
+
190
+extern const char *ospf6_nsm_event_str[];
191
+
192
 
193
 /* Function Prototypes */
194
 int ospf6_neighbor_cmp (void *va, void *vb);
195
diff -u -r ../quagga-0.99.18_org/ospf6d/ospf6_top.c ./ospf6d/ospf6_top.c
196
--- ../quagga-0.99.18_org/ospf6d/ospf6_top.c	2011-03-21 14:43:34.000000000 +0100
197
+++ ./ospf6d/ospf6_top.c	2011-03-31 17:23:51.000000000 +0200
198
@@ -312,6 +312,60 @@
199
   return CMD_SUCCESS;
200
 }
201
 
202
+DEFUN (ospf6_log_adjacency_changes,
203
+       ospf6_log_adjacency_changes_cmd,
204
+       "log-adjacency-changes",
205
+       "Log changes in adjacency state\n")
206
+{
207
+  struct ospf6 *o;
208
+  o = (struct ospf6 *) vty->index;
209
+
210
+  SET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_CHANGES);
211
+  return CMD_SUCCESS;
212
+}
213
+
214
+DEFUN (ospf6_log_adjacency_changes_detail,
215
+       ospf6_log_adjacency_changes_detail_cmd,
216
+       "log-adjacency-changes detail",
217
+       "Log changes in adjacency state\n"
218
+       "Log all state changes\n")
219
+{
220
+  struct ospf6 *o;
221
+  o = (struct ospf6 *) vty->index;
222
+
223
+  SET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_CHANGES);
224
+  SET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_DETAIL);
225
+  return CMD_SUCCESS;
226
+}
227
+
228
+DEFUN (no_ospf6_log_adjacency_changes,
229
+       no_ospf6_log_adjacency_changes_cmd,
230
+       "no log-adjacency-changes",
231
+       NO_STR 
232
+       "Log changes in adjacency state\n")
233
+{
234
+  struct ospf6 *o;
235
+  o = (struct ospf6 *) vty->index;
236
+
237
+  UNSET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_DETAIL);
238
+  UNSET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_CHANGES);
239
+  return CMD_SUCCESS;
240
+}
241
+
242
+DEFUN (no_ospf6_log_adjacency_changes_detail,
243
+       no_ospf6_log_adjacency_changes_detail_cmd,
244
+       "no log-adjacency-changes detail",
245
+       NO_STR
246
+       "Log changes in adjacency state\n"
247
+       "Log all state changes\n")
248
+{
249
+  struct ospf6 *o;
250
+  o = (struct ospf6 *) vty->index;
251
+
252
+  UNSET_FLAG(o->flag, OSPF6_LOG_ADJACENCY_DETAIL);
253
+  return CMD_SUCCESS;
254
+}
255
+
256
 DEFUN (ospf6_interface_area,
257
        ospf6_interface_area_cmd,
258
        "interface IFNAME area A.B.C.D",
259
@@ -648,6 +702,15 @@
260
   if (ospf6->router_id_static != 0)
261
     vty_out (vty, " router-id %s%s", router_id, VNL);
262
 
263
+  /* log-adjacency-changes flag print. */
264
+  if (CHECK_FLAG(ospf6->flag, OSPF6_LOG_ADJACENCY_CHANGES))
265
+    {
266
+      vty_out(vty, " log-adjacency-changes");
267
+      if (CHECK_FLAG(ospf6->flag, OSPF6_LOG_ADJACENCY_DETAIL))
268
+        vty_out(vty, " detail");
269
+      vty_out(vty, "%s", VTY_NEWLINE);
270
+    }
271
+
272
   ospf6_redistribute_config_write (vty);
273
   ospf6_area_config_write (vty);
274
 
275
@@ -700,6 +763,13 @@
276
 
277
   install_default (OSPF6_NODE);
278
   install_element (OSPF6_NODE, &ospf6_router_id_cmd);
279
+
280
+  /* "ospf log-adjacency-changes" commands. */
281
+  install_element (OSPF6_NODE, &ospf6_log_adjacency_changes_cmd);
282
+  install_element (OSPF6_NODE, &ospf6_log_adjacency_changes_detail_cmd);
283
+  install_element (OSPF6_NODE, &no_ospf6_log_adjacency_changes_cmd);
284
+  install_element (OSPF6_NODE, &no_ospf6_log_adjacency_changes_detail_cmd);
285
+
286
   install_element (OSPF6_NODE, &ospf6_interface_area_cmd);
287
   install_element (OSPF6_NODE, &no_ospf6_interface_area_cmd);
288
 }
289
diff -u -r ../quagga-0.99.18_org/ospf6d/ospf6_top.h ./ospf6d/ospf6_top.h
290
--- ../quagga-0.99.18_org/ospf6d/ospf6_top.h	2011-03-21 14:43:34.000000000 +0100
291
+++ ./ospf6d/ospf6_top.h	2011-03-31 17:24:33.000000000 +0200
292
@@ -62,7 +62,9 @@
293
   struct thread *maxage_remover;
294
 };
295
 
296
-#define OSPF6_DISABLED    0x01
297
+#define OSPF6_DISABLED                 0x01
298
+#define OSPF6_LOG_ADJACENCY_CHANGES    0x02
299
+#define OSPF6_LOG_ADJACENCY_DETAIL     0x04
300
 
301
 /* global pointer for OSPF top data structure */
302
 extern struct ospf6 *ospf6;
(-)./files/patch-ospf6d-segfault (+12 lines)
Line 0 Link Here
1
--- ../quagga-0.99.18_org/ospf6d/ospf6_zebra.c	2011-03-21 10:43:52.000000000 +0100
2
+++ ospf6d/ospf6_zebra.c	2011-04-02 00:24:49.000000000 +0200
3
@@ -132,6 +132,9 @@
4
   struct interface *ifp;
5
 
6
   ifp = zebra_interface_state_read (zclient->ibuf);
7
+  if (ifp == NULL)
8
+    return 0;
9
+  
10
   if (IS_OSPF6_DEBUG_ZEBRA (RECV))
11
     zlog_debug ("Zebra Interface state change: "
12
                 "%s index %d flags %llx metric %d mtu %d",
(-)./files/patch-rtadv (+13 lines)
Line 0 Link Here
1
--- ../quagga-0.99.18_org/zebra/rtadv.c	2011-04-02 13:22:09.000000000 +0000
2
+++ zebra/rtadv.c	2011-04-11 11:01:34.000000000 +0000
3
@@ -1388,8 +1388,8 @@
4
        "Neighbor discovery\n"
5
        "Default router preference\n"
6
        "High default router preference\n"
7
-       "Low default router preference\n"
8
-       "Medium default router preference (default)\n")
9
+       "Medium default router preference (default)\n"
10
+       "Low default router preference\n")
11
 {
12
   struct interface *ifp;
13
   struct zebra_if *zif;

Return to bug 156332