diff options
author | David Lamparter <equinox@diac24.net> | 2017-05-17 11:14:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-17 11:14:48 +0200 |
commit | 56b6674bc0f774168ea5e8330a7d8c3cb382d0e0 (patch) | |
tree | 2317632c34e3dabe21b1cb13e86f3302f25858d7 | |
parent | Merge pull request #492 from dwalton76/stable/2.0 (diff) | |
parent | bgpd: Fix vrf crash (diff) | |
download | frr-56b6674bc0f774168ea5e8330a7d8c3cb382d0e0.tar.xz frr-56b6674bc0f774168ea5e8330a7d8c3cb382d0e0.zip |
Merge pull request #553 from donaldsharp/missed_2.0
Missed 2.0
-rw-r--r-- | bgpd/bgp_fsm.c | 19 | ||||
-rw-r--r-- | bgpd/bgp_vty.c | 14 | ||||
-rw-r--r-- | bgpd/bgpd.c | 2 | ||||
-rw-r--r-- | ospf6d/ospf6_lsa.c | 47 | ||||
-rw-r--r-- | ospfd/ospf_vty.c | 7 |
5 files changed, 69 insertions, 20 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index e669b4f9b..2f37f39ff 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1021,8 +1021,14 @@ bgp_stop (struct peer *peer) /* bgp log-neighbor-changes of neighbor Down */ if (bgp_flag_check (peer->bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES)) - zlog_info ("%%ADJCHANGE: neighbor %s Down %s", peer->host, - peer_down_str [(int) peer->last_reset]); + { + struct vrf *vrf = vrf_lookup_by_id (peer->bgp->vrf_id); + zlog_info ("%%ADJCHANGE: neighbor %s(%s) in vrf %s Down %s", + peer->host, + (peer->hostname) ? peer->hostname : "Unknown", + (vrf->vrf_id != VRF_DEFAULT) ? vrf->name : "Default", + peer_down_str [(int) peer->last_reset]); + } /* graceful restart */ if (peer->t_gr_stale) @@ -1459,8 +1465,13 @@ bgp_establish (struct peer *peer) /* bgp log-neighbor-changes of neighbor Up */ if (bgp_flag_check (peer->bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES)) - zlog_info ("%%ADJCHANGE: neighbor %s Up", peer->host); - + { + struct vrf *vrf = vrf_lookup_by_id (peer->bgp->vrf_id); + zlog_info ("%%ADJCHANGE: neighbor %s(%s) in vrf %s Up", + peer->host, + (peer->hostname) ? peer->hostname : "Unknown", + vrf ? ((vrf->vrf_id != VRF_DEFAULT ) ? vrf->name : "Default") : ""); + } /* assign update-group/subgroup */ update_group_adjust_peer_afs(peer); diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 347d026af..418765424 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -2882,7 +2882,10 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, peer = peer_create (NULL, conf_if, bgp, bgp->as, as, as_type, afi, safi, NULL); - if (peer && v6only) + if (!peer) + return CMD_WARNING; + + if (v6only) SET_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY); /* Request zebra to initiate IPv6 RAs on this interface. We do this @@ -2891,10 +2894,7 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, * gets deleted later etc.) */ if (peer->ifp) - { - bgp_zebra_initiate_radv (bgp, peer); - } - peer_flag_set (peer, PEER_FLAG_CAPABILITY_ENHE); + bgp_zebra_initiate_radv (bgp, peer); } else if ((v6only && !CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY)) || (!v6only && CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY))) @@ -2915,8 +2915,8 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, bgp_session_reset(peer); } - if (!peer) - return CMD_WARNING; + if (!CHECK_FLAG (peer->flags, PEER_FLAG_CAPABILITY_ENHE)) + peer_flag_set (peer, PEER_FLAG_CAPABILITY_ENHE); if (peer_group_name) { diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 86133cd76..c6997a9b8 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -2652,7 +2652,7 @@ peer_group_bind (struct bgp *bgp, union sockunion *su, struct peer *peer, * Capability extended-nexthop is enabled for an interface neighbor by * default. So, fix that up here. */ - if (peer->ifp && cap_enhe_preset) + if (peer->conf_if && cap_enhe_preset) peer_flag_set (peer, PEER_FLAG_CAPABILITY_ENHE); for (afi = AFI_IP; afi < AFI_MAX; afi++) diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 35e5a9154..867dc3d9d 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -77,8 +77,7 @@ struct ospf6_lsa_handler unknown_handler = "Unknown", "Unk", ospf6_unknown_lsa_show, - NULL, - OSPF6_LSA_DEBUG, + NULL }; void @@ -822,7 +821,14 @@ DEFUN (debug_ospf6_lsa_type, DEBUG_STR OSPF6_STR "Debug Link State Advertisements (LSAs)\n" - "Specify LS type as Hexadecimal\n" + "Router LSA's\n" + "Network LSA's\n" + "Inter-Prefix LSA's\n" + "Inter-Router LSA's\n" + "AS-External LSA's\n" + "Link LSA's\n" + "Intra-Prefix LSA's\n" + "Unknown LSA's\n" ) { unsigned int i; @@ -866,7 +872,17 @@ ALIAS (debug_ospf6_lsa_type, DEBUG_STR OSPF6_STR "Debug Link State Advertisements (LSAs)\n" - "Specify LS type as Hexadecimal\n" + "Router LSA's\n" + "Network LSA's\n" + "Inter-Prefix LSA's\n" + "Inter-Router LSA's\n" + "AS-External LSA's\n" + "Link LSA's\n" + "Intra-Prefix LSA's\n" + "Unknown LSA's\n" + "Originate\n" + "Examine\n" + "Flooding\n" ) DEFUN (no_debug_ospf6_lsa_type, @@ -876,7 +892,14 @@ DEFUN (no_debug_ospf6_lsa_type, DEBUG_STR OSPF6_STR "Debug Link State Advertisements (LSAs)\n" - "Specify LS type as Hexadecimal\n" + "Router LSA's\n" + "Network LSA's\n" + "Inter-Prefix LSA's\n" + "Inter-Router LSA's\n" + "AS-External LSA's\n" + "Link LSA's\n" + "Intra-Prefix LSA's\n" + "Unknown LSA's\n" ) { u_int i; @@ -915,12 +938,22 @@ DEFUN (no_debug_ospf6_lsa_type, ALIAS (no_debug_ospf6_lsa_type, no_debug_ospf6_lsa_hex_detail_cmd, - "no debug ospf6 lsa (router|network|inter-prefix|inter-router|as-external|link|intra-prefix) (originate|examine|flooding)", + "no debug ospf6 lsa (router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown) (originate|examine|flooding)", NO_STR DEBUG_STR OSPF6_STR "Debug Link State Advertisements (LSAs)\n" - "Specify LS type as Hexadecimal\n" + "Router LSA's\n" + "Network LSA's\n" + "Inter-Prefix LSA's\n" + "Inter-Router LSA's\n" + "AS-External LSA's\n" + "Link LSA's\n" + "Intra-Prefix LSA's\n" + "Unknown LSA's\n" + "Originate\n" + "Examine\n" + "Flooding\n" ) void diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 2724df98a..b13c28d0c 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -3967,9 +3967,14 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc, { show_ip_ospf_interface_sub (vty, ospf, ifp, json_interface_sub, use_json); if (use_json) - json_object_object_add(json, ifp->name, json_interface_sub); + { + json_object_object_add(json, ifp->name, json_interface_sub); + json_interface_sub = json_object_new_object (); + } } } + if (use_json) + json_object_free (json_interface_sub); } else { |