This is a living document describing the processes and guidelines for working on Quagga. You must read Section “REQUIRED READING”, before contributing to Quagga. Suggestions for updates, via the quagga-dev list, are welcome.


The objectives of the Quagga project are to develop and implement high quality routing protocols and related software, maximising:

See also the Section on CODE OF CONDUCT.


Quagga is a Sociocracy, as it has been since its earliest days.

Quagga was forked from GNU Zebra by Paul Jakma, who holds the domain name. Governance was soon devolved to a collective group, the maintainers, consisting of those who regularly contributed and reviewed code. The details can easily be changed.

You are free to use reason to persuade others to adopt some alternative. If, after that, you truly can not abide by what is mutually agreeable, you are asked to do the honourable thing: take your copy of the code, make your apologies, and be on your way with good grace.

Those who repeatedly violate the Code of Conduct will be asked to leave.

Holding of project assets

One or more mature, independent trustees, with technical and free software experience, will be appointed as the executor(s) for key assets of the project to ensure continuity, such as the domain name.

Should a corporate vehicle ever be created to hold such assets it must:

It not clear at this time that the overheads and potential liabilities of such a vehicle would be appropriate for this project. These principles should though still be applied, where possible, to any non-corporate body formed around the project.


Participants will treat each other with respect and integrity. Participants will build and treasure the trust that is required for parties to successfully collaborate together on free software. Particularly when those parties may have competing interests. The following principles and guidelines should be followed to foster that trust:


Note well: By proposing a change to Quagga, by whatever means, you are implicitly agreeing:

Before contributing to Quagga, you must also read Section COMMIT MESSAGES.

You should ideally read the entire document, as it contains useful information on the community norms and how to implement them.

Please note that authorship and any relevant other rights information should be explicitly stated with the contribution. A “Signed-off-by” line is not sufficient. The “Signed-off-by” line is not used by the Quagga project.

You may document applicable copyright claims to files being modified or added by your contribution. For new files, the standard way is to add a string in the following format near the beginning of the file:

Copyright (C) <Year> <name of person/entity>[, optional contact details]

When adding copyright claims for modifications to an existing file, please preface the claim with “Portions:” on a line before it and indent the “Copyright …” string. If such a case already exists, add your indented claim immediately after. E.g.:

  Copyright (C) <Year> <Entity A> ....
  Copyright (C) <Year> <Your details> [optional brief change description]


GNU coding standards apply. Indentation follows the result of invoking GNU indent (as of 2.2.8a) with the -–nut argument.

Originally, tabs were used instead of spaces, with tabs are every 8 columns. However, tab’s interoperability issues mean space characters are now preferred for new changes. We generally only clean up whitespace when code is unmaintainable due to whitespace issues, to minimise merging conflicts.

Be particularly careful not to break platforms/protocols that you cannot test.

Parsers or packet-writers of data from untrusted parties, particularly remote ones, MUST use the lib/stream bounded-buffer abstraction, and use its checked getters and putters. Twiddling of pointers based on contents of untrusted data is strongly discouraged - any such code is not acceptable, unless there are very good reasons (e.g. compatibility with external or old code that is not easily rewritten).

New code should have good comments, which explain why the code is correct. Changes to existing code should in many cases upgrade the comments when necessary for a reviewer to conclude that the change has no unintended consequences.

Each file in the Git repository should have a git format-placeholder (like an RCS Id keyword), somewhere very near the top, commented out appropriately for the file type. The placeholder used for Quagga (replacing <dollar> with $) is:

$QuaggaId: <dollar>Format:%an, %ai, %h<dollar> $

See line 2 of HACKING.tex, the source for this document, for an example.

This placeholder string will be expanded out by the ‘git archive’ commands, which is used to generate the tar archives for snapshots and releases.

Please document fully the proper use of a new function in the header file in which it is declared. And please consult existing headers for documentation on how to use existing functions. In particular, please consult these header files:

lib/log.h logging levels and usage guidance

[more to be added]

If changing an exported interface, please try to deprecate the interface in an orderly manner. If at all possible, try to retain the old deprecated interface as is, or functionally equivalent. Make a note of when the interface was deprecated and guard the deprecated interface definitions in the header file, i.e.:

/* Deprecated: 20050406 */
#warning "Using deprecated <libname> (interface(s)|function(s))"

This is to ensure that the core Quagga sources do not use the deprecated interfaces (you should update Quagga sources to use new interfaces, if applicable), while allowing external sources to continue to build. Deprecated interfaces should be excised in the next unstable cycle.

Note: If you wish, you can test for GCC and use a function marked with the ’deprecated’ attribute. However, you must provide the warning for other compilers.

If changing or removing a command definition, ensure that you properly deprecate it - use the _DEPRECATED form of the appropriate DEFUN macro. This is critical. Even if the command can no longer function, you MUST still implement it as a do-nothing stub.

Failure to follow this causes grief for systems administrators, as an upgrade may cause daemons to fail to start because of unrecognised commands. Deprecated commands should be excised in the next unstable cycle. A list of deprecated commands should be collated for each release.



Routing protocols can be very complex sometimes. Then, working with an Opensource community can be complex too, but usually friendly with anyone who is ready to be willing to do it properly.


Get your cloned trie:

  git clone

Apply some ack’t patches:

  pwclient git-am 1046
    Applying patch #1046 using 'git am'
    Description: [quagga-dev,11595] zebra: route_unlock_node is missing in "show ip[v6] route <prefix>" commands
    Applying: zebra: route_unlock_node is missing in "show ip[v6] route <prefix>" commands

Run a quick review. If the ack’t was not done properly, you know who you have to blame.

Push the patches:

  git push

Set the patch to accepted on patchwork

  pwclient update -s Accepted 1046


Please think very carefully before making code conditional at compile time, as it increases maintenance burdens and user confusion. In particular, please avoid gratuitous -–enable-… switches to the configure script - typically code should be good enough to be in Quagga, or it shouldn’t be there at all.

When code must be compile-time conditional, try have the compiler make it conditional rather than the C pre-processor - so that it will still be checked by the compiler, even if disabled. I.e. this:

    if (SOME_SYMBOL)

rather than:

  #ifdef SOME_SYMBOL
  frobnicate ();
  #endif /* SOME_SYMBOL */

Note that the former approach requires ensuring that SOME_SYMBOL will be defined (watch your AC_DEFINEs).


The commit message requirements are:

The one-line summary must be limited to 54 characters, and all other lines to 72 characters.

Commit message bodies in the Quagga project have typically taken the following form:

Contributors are strongly encouraged to follow this form.

This itemised commit messages allows reviewers to have confidence that the author has self-reviewed every line of the patch, as well as providing reviewers a clear index of which changes are intended, and descriptions for them (C-to-english descriptions are not desirable - some discretion is useful). For short patches, a per-function/file break-down may be redundant. For longer patches, such a break-down may be essential. A contrived example (where the general discussion is obviously somewhat redundant, given the one-line summary):

zebra: Enhance frob FSM to detect loss of frob

Add a new DOWN state to the frob state machine to allow the barinator to
detect loss of frob.

* frob.h: (struct frob) Add DOWN state flag.
* frob.c: (frob_change) set/clear DOWN appropriately on state change.
* bar.c: (barinate) Check frob for DOWN state.

Please have a look at the git commit logs to get a feel for what the norms are.

Note that the commit message format follows git norms, so that “git log –oneline” will have useful output.


If you change or add to the build system (, any, etc.), please heck that the following things still work:

This can be achieved by running ‘make distcheck’

The site relies on make dist to work to generate snapshots. It must work. Common problems are to forget to have some additional file included in the dist, or to have a make rule refer to a source file without using the srcdir variable.


To make a release:

The ‘’ script should then be used. It should be run with 2 arguments, the release tag for the release to be carried, and the tag of the previous release, e.g.: quagga-1.1.1 quagga-1.1.0

The ‘’ will carry out these steps for you:

The ‘’ script, if finishes successfully, will print out instructions on the files it has created and the details on remaining steps to be carried out to complete the release. Which roughly are:

If any errors occur, move tags as needed and start over again with the script. Do not try to append stuff to tarballs, as this has produced non-standards-conforming tarballs in the past.

[TODO: collation of a list of deprecated commands. Possibly can be scripted to extract from vtysh/vtysh_cmd.c]


Require versions of support tools are listed in INSTALL.quagga.txt. Required versions should only be done with due deliberation, as it can cause environments to no longer be able to compile quagga.


[this section is at the moment just gdt’s opinion]

Quagga builds several shared libaries (lib/libzebra, ospfd/libospf, ospfclient/libsopfapiclient). These may be used by external programs, e.g. a new routing protocol that works with the zebra daemon, or ospfapi clients. The libtool info pages (node Versioning) explain when major and minor version numbers should be changed. These values are set in near the definition of the library. If you make a change that requires changing the shared library version, please update

libospf exports far more than it should, and is needed by ospfapi clients. Only bump libospf for changes to functions for which it is reasonable for a user of ospfapi to call, and please err on the side of not bumping.

There is no support intended for installing part of zebra. The core library libzebra and the included daemons should always be built and installed together.


The preferred method for submitting changes is to provide git commits via a publicly-accessible git repository, which the maintainers can easily pull.

The commits should be in a branch based off the master - a “feature branch”. Ideally there should be no commits to this branch other than those in master, and those intended to be submitted. However, merge commits to this branch from the Quagga master are permitted, though strongly discouraged - use another (potentially local and throw-away) branch to test merge with the latest Quagga master.

Recommended practice is to keep different logical sets of changes on separate branches - “topic” or “feature” branches. This allows you to still merge them together to one branch (potentially local and/or “throw-away”) for testing or use, while retaining smaller, independent branches that are easier to merge.

All content guidelines in Section PATCH SUBMISSION apply.




The list of platforms that should be tested follow. This is a list derived from what quagga is thought to run on and for which maintainers can test or there are people on quagga-dev who are able and willing to verify that -current does or does not work correctly.

The list of daemons that are thought to be stable and that should be tested are:

Daemons which are in a testing phase are



The buildbot client can be used to test changes before committing, with “buildbot try”.