summaryrefslogtreecommitdiffstats
path: root/lib/csv.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-16/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: Avoid using assignments within checksDonatas Abraitis2021-06-291-1/+2
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* *: use appropriate buffer sizes, specifiersQuentin Young2020-04-211-1/+1
| | | | | | | | - Fix 1 byte overflow when showing GR info in bgpd - Use PATH_MAX for path buffers - Use unsigned specifiers for uint16_t's in zebra pbr Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: sprintf -> snprintfQuentin Young2020-04-211-5/+5
| | | | | | | | | | | | | Replace sprintf with snprintf where straightforward to do so. - sprintf's into local scope buffers of known size are replaced with the equivalent snprintf call - snprintf's into local scope buffers of known size that use the buffer size expression now use sizeof(buffer) - sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp buffer followed by strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: don't use strcpyQuentin Young2020-04-181-2/+4
| | | | | | >:( Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: Remove parenthesis on return for constantsDonatas Abraitis2020-02-091-9/+9
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* Merge pull request #2965 from opensourcerouting/buildfoo-20180904Donald Sharp2018-09-091-0/+5
|\ | | | | more build fixes & warning-free build
| * *: fix config.h/zebra.h include orderDavid Lamparter2018-09-081-0/+5
| | | | | | | | | | | | | | | | config.h (or, transitively, zebra.h) must be the first include file listed for autoconf things like _GNU_SOURCE and _POSIX_C_SOURCE to work correctly. Signed-off-by: David Lamparter <equinox@diac24.net>
* | *: fix clang-6 SA warningsDavid Lamparter2018-09-081-0/+2
|/ | | | | | | I don't see these in CI, but my local clang-6 does emit warnings for these. Signed-off-by: David Lamparter <equinox@diac24.net>
* babeld, lib, ospfd, tests: fmt fixes (cppcheck)paco2018-06-181-4/+4
| | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* lib: Fix gcc 7 warning 'error: ‘fld’ may be used uninitialized in this ↵Martin Winter2017-12-051-1/+1
| | | | | | | | function' Warning breaks Debian Package build with gcc 7 which uses -Werror=maybe-uninitialized Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
* lib: Fix missing va_endDonald Sharp2017-10-101-1/+4
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1310 from vjardin6WIND/null_referencesDonald Sharp2017-10-091-0/+2
|\ | | | | lib: linklist avoid access NULL->data
| * lib: fix NULL->field_len accessVincent JARDIN2017-10-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currenlty, this function is used only by: - unit test of csv.c (see its main() section) - ptm_lib.c In case of ptm, it is safe to return NULL because: csv_encode_record() -> return NULL _ptm_lib_encode_header() -> return NULL the only consumer of the return value is: ptm_lib_init_msg() that checks the NULL return. Warning: Access to field 'field_len' results in a dereference of a null pointer (loaded from variable 'fld') Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
* | lib: csv unit testsVincent JARDIN2017-10-091-11/+8
|/ | | | | | | | | | Fix csv unit tests. To be run using, gcc -o csv csv.c -DTEST_CSV ./csv Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-590/+565
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | 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>
* lib: fix remaining coverity issuesDavid Lamparter2017-02-101-1/+5
| | | | | Reported-by: Coverity Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: csv: plug memleaksDavid Lamparter2017-02-081-3/+15
| | | | | Reported-by: Coverity Scan Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Fix up licensing to be rightDonald Sharp2016-11-181-0/+20
| | | | | | | | These files were submitted by Cumulus but did not properly setup the licensing of them. This fixes that issue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib: Compiler warning fixDonald Sharp2016-05-201-1/+1
| | | | | | | | There exists a code path where fld would be used uninitialized. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
* This patch changes BGP from only listening mode for BFD status updates to ↵Donald Sharp2015-06-121-0/+684
interactive mode of dynamically registering/deregistering BFD enabled peers with PTM/BFD through zebra. Peer is registered with BFD when it goes into established state and de-registers when it goes out of establish state. This patch also adds BFD multihop support for BGP. Whether a peer is multi-hop or single hop is determined internally. All IGP peers are considered as multi-hop peers. EBGP peers are considered as single hop unless configured as multi-hop. BGP BFD command enhancement to configure BFD parameters (detect multiplier, min rx and min tx). router bgp <as-number> neighbor <name/ip-address> bfd <detect mult> <min rx> <min tx> Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com> Reviewed-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Kanna Rajagopal <kanna@cumulusnetworks.com>