| Age | Commit message (Collapse) | Author | 
 | 
ospfclient.c includes .c files directly from ospfd.  Let's separate
these out a bit.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 253113bcb80b7b489eb848988a90459403f870de)
 | 
 | 
- also add ability of the apibin to process commands on stdin
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 6efa8fd5c1653372cea1b25a9fa764269960bb91)
 | 
 | 
- dont delete the callback on opaque data delete
- require explicit registration
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 703d2c0a3e30c18acd2426b50f97ea8c91c479f9)
 | 
 | 
default behavior is unchanged, i.e., to not zero
Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 2f30cb25747dc9657046c59ca1f378203192de26)
 | 
 | 
Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 08172828f6dc0950431e57e43b0aa2dc674cb6fe)
 | 
 | 
Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 20d26a9e08aa2e104bef1e4dd0cb347c9a2ab912)
 | 
 | 
stack
Even though OSPF_MAX_LSA_SIZE is quite large and holds the upper bound
on what can be written into a lsa, let's add a small check to ensure
it is not possible to do a bad thing.
This wins one of the long standing bug awards.  2003!
Fixes: #11602
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit d2aeac38708d93fb028d6a53e6eea317f0c06d1b)
 | 
 | 
Its better to check the length and then the type of the LSA
Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
 | 
 | 
stack
Even though OSPF_MAX_LSA_SIZE is quite large and holds the upper bound
on what can be written into a lsa, let's add a small check to ensure
it is not possible to do a bad thing.
This wins one of the long standing bug awards.  2003!
Fixes: #11602
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
 | 
 | 
Signed-off-by: Christian Hopps <chopps@labn.net>
 | 
 | 
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
 | 
 | 
Signed-off-by: Christian Hopps <chopps@labn.net>
 | 
 | 
Wrong: memset(&a, 0, sizeof(struct ...));
    Good:  memset(&a, 0, sizeof(a));
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
 | 
 | 
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
 | 
 | 
The int return value is never used.  Modify the code
base to just return a void instead.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
 | 
 | 
like the other automake variables, setting `xyz_LDFLAGS` causes
`AM_LDFLAGS` to be ignored for `xyz`.  For some reason I had in my mind
that automake doesn't do this for LDFLAGS, but... it does.  (Which is
consistent with `_CFLAGS` and co.)
So, all the libraries and modules have been ignoring `AM_LDFLAGS` (which
includes `SAN_FLAGS` too).  Set up new `LIB_LDFLAGS` and
`MODULE_LDFLAGS` to handle all of this correctly (and move these bits to
a central location.)
Fixes: #9034
Fixes: 0c4285d77eb ("build: properly split CFLAGS from AC_CFLAGS")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
... again ...
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Back when I put this together in 2015, ISO C11 was still reasonably new
and we couldn't require it just yet.  Without ISO C11, there is no
"good" way (only bad hacks) to require a semicolon after a macro that
ends with a function definition.  And if you added one anyway, you'd get
"spurious semicolon" warnings on some compilers...
With C11, `_Static_assert()` at the end of a macro will make it so that
the semicolon is properly required, consumed, and not warned about.
Consistently requiring semicolons after "file-level" macros matches
Linux kernel coding style and helps some editors against mis-syntax'ing
these macros.
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Our "true" libraries (i.e. not modules) don't invoke neither
FRR_DAEMON_INFO nor FRR_MODULE_SETUP, hence XREF_SETUP isn't invoked
either.  Invoke it directly to get things working.
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Replace all use of inet_ntoa; use pI4 (and printfrr).
Signed-off-by: Mark Stapp <mjs@voltanet.io>
 | 
 | 
Fix some SA warnings in ospf GR and ospfclient code.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
 | 
 | 
Coverity rightly points out that blindly trusting the lsalen
from received data may not be the smartest thing to do.  Add
a bit of code to prevent us from blindly malloc'ing
too much memory.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
 | 
 | 
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
 | 
 | 
... we're not installing ospfclient (it's a demo/example program), so
installing the man page is quite useless.
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
The vrrpd one conflicts with the standalone vrrpd package; also we're
installing daemons to /usr/lib/frr on some systems so they're not on
PATH.
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
- some target_CFLAGS that needed to include AM_CFLAGS didn't do so
- libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all
- consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@
- 2 dependencies were missing for clippy
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Both of these are testing/demo-style tools that don't make sense as part
of a normal installation.  So don't install them.
NB: this is only the executables, libospfclient and the RFP code are not
affected.
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
This option can be used to get statically linked binaries.
Note: libfrr.la is removed from modules' library dependency list.  This
is intentional and explained in a comment in lib/subdir.am.
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Can't build manpages without sphinx-build, oops...
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
Since we're now building through one large Makefile, we can easily put
things with their daemons and crossreference nicely.
Signed-off-by: David Lamparter <equinox@diac24.net>
 | 
 | 
The ospf_external_route_lookup function was not
being used so let's just remove it.
Unfortunately the removal was not quite so simple as
that ospf_asbr.h was being used to generate a reference
for the `struct ospf_route` data structure, so we
need to fix up the compile by fixing up header
inclusions so that ospf_route.h is actually included
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
 | 
 | 
There is no need to check for failure of a ALLOC call
as that any failure to do so will result in a assert
happening.  So we can safely remove all of this code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
 | 
 | 
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t
Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
more non-recursive build, fix cross-compile, & doc build mangling
 | 
 | 
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
This splits off privs_preinit(), which does the lookups for user and
group IDs.  This is so the init code can create state directories while
still running as root.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
Add support for naming pthreads. Also, note that we don't have any
records yet if that's the case.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
log.c provides functionality for associating a constant (typically a
protocol constant) with a string and finding the string given the
constant. However this is highly delicate code that is extremely prone
to stack overflows and off-by-one's due to requiring the developer to
always remember to update the array size constant and to do so correctly
which, as shown by example, is never a good idea.b
The original goal of this code was to try to implement lookups in O(1)
time without a linear search through the message array. Since this code
is used 99% of the time for debugs, it's worth the 5-6 additional cmp's
worst case if it means we avoid explitable bugs due to oversights...
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
 | 
 | 
In the few places where we were not checking the return code
for inet_aton, do so.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
 | 
 | 
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header.  (The style with * at the beginning won out with
580 to 141 in existing files.)
Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
The way thread.c is written, a caller who wishes to be able to cancel a
thread or avoid scheduling it twice must keep a reference to the thread.
Typically this is done with a long lived pointer whose value is checked
for null in order to know if the thread is currently scheduled.  The
check-and-schedule idiom is so common that several wrapper macros in
thread.h existed solely to provide it.
This patch removes those macros and adds a new parameter to all
thread_add_* functions which is a pointer to the struct thread * to
store the result of a scheduling call. If the value passed is non-null,
the thread will only be scheduled if the value is null. This helps with
consistency.
A Coccinelle spatch has been used to transform code of the form:
  if (t == NULL)
    t = thread_add_* (...)
to the form
  thread_add_* (..., &t)
The THREAD_ON macros have also been transformed to the underlying
thread.c calls.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
 | 
 | 
the "static const" inside DECLARE_MTYPE still causes issues on gcc -O0
(re. gcc bug 69981).  Work around by disabling MTYPE declarations for
ospfclient.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
Pulling in source files from another directory breaks automake's
distclean target, and there seems to be no good fix for this...
(particularly since we need -fPIC build for a DSO here, while ospfd
compiles for an executable...)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
The OSPF API-client library doesn't really use anything from libospf
except some small dumping tools.  Isolate these into a separate file
and detangle the ospfapiclient library.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
Convert the libospfapiclient -> libfrrospfapiclient
and libospf -> libfrrospf to prevent namespace
collision with Quagga.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
 | 
 | 
The library libzebra that is installed with FRR will
conflict with Quagga.  So let's rename it to libfrr.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
 | 
 | 
Move over to the new allocation counting added in the previous commit.
(This commit is mostly mechanical.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
 |