Merge branch 'stable/2.0'

This commit is contained in:
David Lamparter 2016-12-01 17:24:03 +01:00
commit 0577b824e1
14 changed files with 116 additions and 75 deletions

View File

@ -1,10 +1,14 @@
# Developing for PROJECT (DRAFT) # Developing for PROJECT (DRAFT)
[TOC]
## Git Structure ## Git Structure
The master Git for PROJECT resides on Github at The master Git for PROJECT resides on Github at
https://github.com/PROJECT/XXX [https://github.com/PROJECT/XXX](https://github.com/PROJECT/XXX)
![git branches continually merging to the left from 3 lanes; float-right](doc/git_branches.svg
"git branch mechanics")
There are 3 main branches for development and a release branch for each There are 3 main branches for development and a release branch for each
major release. major release.
@ -39,8 +43,8 @@ preference on Markdown.
## Before Submitting your changes ## Before Submitting your changes
* Format code (see Code Styling requirements) * Format code (see [Code Styling requirements](#code-styling-requirements))
* Verify and acknowledge license (see License for contributions) * Verify and acknowledge license (see [License for contributions](#license-for-contributions))
* Test building with various configurations: * Test building with various configurations:
* `buildtest.sh` * `buildtest.sh`
* Verify building source distribution: * Verify building source distribution:
@ -118,7 +122,7 @@ website](http://www.linuxfoundation.org/content/how-participate-linux-community-
to be a helpful resource. to be a helpful resource.
#### Code submission - Github Pull Request (Strongly Preferred) ### Code submission - Github Pull Request (Strongly Preferred)
Preferred submission of code is by using a Github Pull Request against the Preferred submission of code is by using a Github Pull Request against the
Develop branch. Code submitted by Pull Request will have an email generated to Develop branch. Code submitted by Pull Request will have an email generated to
@ -133,7 +137,7 @@ Further (manual) code review and discussion happens after the merge into the
develop branch. develop branch.
#### Code submission - Mailing Patch to PROJECT-Devel list ### Code submission - Mailing Patch to PROJECT-Devel list
As an alternative submission, a patch can be mailed to the PROJECT-Devel As an alternative submission, a patch can be mailed to the PROJECT-Devel
mailing list. Preferred way to send the patch is using git send-mail. Patches mailing list. Preferred way to send the patch is using git send-mail. Patches
@ -144,7 +148,7 @@ the patch is then merged into the develop branch.
Further (manual) code review and discussion happens after the merge into the Further (manual) code review and discussion happens after the merge into the
develop branch. develop branch.
Sending patch to mailing list #### Sending patch to mailing list
The recommended way to send the patch (or series of NN patches) to the list is The recommended way to send the patch (or series of NN patches) to the list is
by using git send-email as follows (assuming they are the most recent NN by using git send-email as follows (assuming they are the most recent NN
@ -172,8 +176,9 @@ and will allow your changes to merge faster
* You should automatically receive an email with the test results within * You should automatically receive an email with the test results within
less than 2 hrs of the submission. If you dont get the email, then check less than 2 hrs of the submission. If you dont get the email, then check
status on the github pull request (if submitted by pull request) or on status on the github pull request (if submitted by pull request) or on
Patchwork at https://patchwork.PROJECT.org (if submitted as patch to Patchwork at
mailing list). [https://patchwork.PROJECT.org](https://patchwork.PROJECT.org) (if
submitted as patch to mailing list).
* Please notify PROJECT-Devel mailing list if you think something doesnt * Please notify PROJECT-Devel mailing list if you think something doesnt
work work
* If the tests failed: * If the tests failed:
@ -202,8 +207,9 @@ and will allow your changes to merge faster
### File header required for new files added ### File header required for new files added
New files need to have a Copyright header (see License for contributions above) New files need to have a Copyright header (see [License for
added to the file. Preferred form of the header is as follows: contributions](#license-for-contributions) above) added to the file. Preferred
form of the header is as follows:
``` ```
/* /*
@ -225,6 +231,8 @@ added to the file. Preferred form of the header is as follows:
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA MA 02110-1301 USA
*/ */
#include <zebra.h>
``` ```
### Adding Copyright claims to already existing file ### Adding Copyright claims to already existing file

View File

@ -1018,8 +1018,6 @@ peer_free (struct peer *peer)
{ {
assert (peer->status == Deleted); assert (peer->status == Deleted);
bgp_unlock(peer->bgp);
/* this /ought/ to have been done already through bgp_stop earlier, /* this /ought/ to have been done already through bgp_stop earlier,
* but just to be sure.. * but just to be sure..
*/ */
@ -1085,6 +1083,8 @@ peer_free (struct peer *peer)
bfd_info_free(&(peer->bfd_info)); bfd_info_free(&(peer->bfd_info));
bgp_unlock(peer->bgp);
memset (peer, 0, sizeof (struct peer)); memset (peer, 0, sizeof (struct peer));
XFREE (MTYPE_BGP_PEER, peer); XFREE (MTYPE_BGP_PEER, peer);

View File

@ -4414,7 +4414,8 @@ rfapiProcessPeerDown (struct peer *peer)
*/ */
bgp = bgp_get_default (); /* assume 1 instance for now */ bgp = bgp_get_default (); /* assume 1 instance for now */
assert (bgp); if (!bgp)
return;
h = bgp->rfapi; h = bgp->rfapi;
assert (h); assert (h);

View File

@ -208,12 +208,17 @@ prefix_bag_free (void *pb)
static void static void
print_rhn_list (const char *tag1, const char *tag2) print_rhn_list (const char *tag1, const char *tag2)
{ {
struct bgp *bgp = bgp_get_default (); struct bgp *bgp;
struct skiplist *sl = bgp->rfapi->resolve_nve_nexthop; struct skiplist *sl;
struct skiplistnode *p; struct skiplistnode *p;
struct prefix_bag *pb; struct prefix_bag *pb;
int count = 0; int count = 0;
bgp = bgp_get_default ();
if (!bgp)
return;
sl = bgp->frapi->resolve_nve_nexthop;
if (!sl) if (!sl)
{ {
zlog_debug ("%s: %s: RHN List is empty", (tag1 ? tag1 : ""), zlog_debug ("%s: %s: RHN List is empty", (tag1 ? tag1 : ""),
@ -251,6 +256,8 @@ vnc_rhnck (char *tag)
struct skiplistnode *p; struct skiplistnode *p;
bgp = bgp_get_default (); bgp = bgp_get_default ();
if (!bgp)
return;
sl = bgp->rfapi->resolve_nve_nexthop; sl = bgp->rfapi->resolve_nve_nexthop;
if (!sl) if (!sl)
@ -1798,6 +1805,9 @@ vnc_import_bgp_exterior_add_route_it (
struct bgp *bgp_default = bgp_get_default (); struct bgp *bgp_default = bgp_get_default ();
afi_t afi = family2afi (prefix->family); afi_t afi = family2afi (prefix->family);
if (!bgp_default)
return;
h = bgp_default->rfapi; h = bgp_default->rfapi;
hc = bgp_default->rfapi_cfg; hc = bgp_default->rfapi_cfg;
@ -1992,6 +2002,9 @@ vnc_import_bgp_exterior_del_route (
afi_t afi = family2afi (prefix->family); afi_t afi = family2afi (prefix->family);
struct bgp *bgp_default = bgp_get_default (); struct bgp *bgp_default = bgp_get_default ();
if (!bgp_default)
return;
memset (&pfx_orig_nexthop, 0, sizeof (struct prefix)); /* keep valgrind happy */ memset (&pfx_orig_nexthop, 0, sizeof (struct prefix)); /* keep valgrind happy */
h = bgp_default->rfapi; h = bgp_default->rfapi;

3
doc/git_branches.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,23 +1,17 @@
/* /*
* Copyright (c) 2015-16 David Lamparter, for NetDEF, Inc. * Copyright (c) 2015-16 David Lamparter, for NetDEF, Inc.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission to use, copy, modify, and distribute this software for any
* copy of this software and associated documentation files (the "Software"), * purpose with or without fee is hereby granted, provided that the above
* to deal in the Software without restriction, including without limitation * copyright notice and this permission notice appear in all copies.
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* all copies or substantial portions of the Software. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/ */
#include <zebra.h> #include <zebra.h>

View File

@ -1,23 +1,17 @@
/* /*
* Copyright (c) 2015-16 David Lamparter, for NetDEF, Inc. * Copyright (c) 2015-16 David Lamparter, for NetDEF, Inc.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission to use, copy, modify, and distribute this software for any
* copy of this software and associated documentation files (the "Software"), * purpose with or without fee is hereby granted, provided that the above
* to deal in the Software without restriction, including without limitation * copyright notice and this permission notice appear in all copies.
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* all copies or substantial portions of the Software. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/ */
#ifndef _QUAGGA_MEMORY_H #ifndef _QUAGGA_MEMORY_H

View File

@ -1,23 +1,17 @@
/* /*
* Copyright (c) 2015-16 David Lamparter, for NetDEF, Inc. * Copyright (c) 2015-16 David Lamparter, for NetDEF, Inc.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission to use, copy, modify, and distribute this software for any
* copy of this software and associated documentation files (the "Software"), * purpose with or without fee is hereby granted, provided that the above
* to deal in the Software without restriction, including without limitation * copyright notice and this permission notice appear in all copies.
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* all copies or substantial portions of the Software. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/ */
#ifndef _QOBJ_H #ifndef _QOBJ_H

View File

@ -369,8 +369,14 @@ DEFUN (ip_ospf_bfd,
"Enables BFD support\n") "Enables BFD support\n")
{ {
struct interface *ifp = (struct interface *) vty->index; struct interface *ifp = (struct interface *) vty->index;
struct ospf_if_params *params;
struct bfd_info *bfd_info;
assert (ifp); assert (ifp);
params = IF_DEF_PARAMS (ifp);
bfd_info = params->bfd_info;
if (!bfd_info || ! CHECK_FLAG(bfd_info->flags, BFD_FLAG_PARAM_CFG))
ospf_bfd_if_param_set (ifp, BFD_DEF_MIN_RX, BFD_DEF_MIN_TX, ospf_bfd_if_param_set (ifp, BFD_DEF_MIN_RX, BFD_DEF_MIN_TX,
BFD_DEF_DETECT_MULT, 1); BFD_DEF_DETECT_MULT, 1);

View File

@ -3097,8 +3097,10 @@ show_ip_ospf_common (struct vty *vty, struct ospf *ospf, u_char use_json)
json_object *json_areas = NULL; json_object *json_areas = NULL;
if (use_json) if (use_json)
{
json = json_object_new_object(); json = json_object_new_object();
json_areas = json_object_new_object(); json_areas = json_object_new_object();
}
if (ospf->instance) if (ospf->instance)
{ {

View File

@ -148,7 +148,7 @@ int pim_interface_config_write(struct vty *vty)
/* IF ip pim drpriority */ /* IF ip pim drpriority */
if (pim_ifp->pim_dr_priority != PIM_DEFAULT_DR_PRIORITY) { if (pim_ifp->pim_dr_priority != PIM_DEFAULT_DR_PRIORITY) {
vty_out(vty, " ip pim drpriority %d%s", pim_ifp->pim_dr_priority, vty_out(vty, " ip pim drpriority %u%s", pim_ifp->pim_dr_priority,
VTY_NEWLINE); VTY_NEWLINE);
++writes; ++writes;
} }

View File

@ -489,7 +489,7 @@ rm -rf %{buildroot}
%doc */*.sample* AUTHORS COPYING %doc */*.sample* AUTHORS COPYING
%doc doc/quagga.html %doc doc/quagga.html
%doc doc/mpls %doc doc/mpls
%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES
%if 0%{?quagga_user:1} %if 0%{?quagga_user:1}
%dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir} %dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
%dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga %dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga

25
render_md.py Normal file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env python
# written 2016 by David Lamparter, placed in Public Domain.
import sys, markdown
template = '''<html><head><meta charset="UTF-8"><style type="text/css">
body { max-width: 45em; margin: auto; margin-top: 2em; margin-bottom: 2em;
font-family:Fira Sans,sans-serif; text-align: justify; }
pre, code { font-family:Fira Mono,monospace; }
pre > code { display: block; padding:0.5em; border:1px solid black;
background-color:#eee; color:#000; }
h2 { clear: both; margin-top: 3em; text-decoration: underline; }
h3 { clear: both; margin-top: 2em; font-weight: normal; font-style: italic; }
h4 { font-weight: normal; font-style: italic; }
img[alt~="float-right"] { float:right; margin-left:2em; margin-bottom:2em; }
</style></head><body>
%s
</body></html>
'''
md = markdown.Markdown(extensions=['extra', 'toc'])
for fn in sys.argv[1:]:
with open(fn, 'r') as ifd:
with open('%s.html' % (fn), 'w') as ofd:
ofd.write((template % (md.convert(ifd.read().decode('UTF-8')))).encode('UTF-8'))

View File

@ -512,9 +512,10 @@ if_install_connected (struct interface *ifp)
{ {
for (ALL_LIST_ELEMENTS (ifp->connected, node, next, ifc)) for (ALL_LIST_ELEMENTS (ifp->connected, node, next, ifc))
{ {
p = ifc->address; if (CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL))
zebra_interface_address_add_update (ifp, ifc); zebra_interface_address_add_update (ifp, ifc);
p = ifc->address;
if (p->family == AF_INET) if (p->family == AF_INET)
connected_up_ipv4 (ifp, ifc); connected_up_ipv4 (ifp, ifc);
else if (p->family == AF_INET6) else if (p->family == AF_INET6)