Commit Graph

6554 Commits

Author SHA1 Message Date
David Lamparter
a95c3a4917 tests: fix out-of-tree build
Fix pytest with $(top_srcdir) != "."

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-11 01:03:57 +01:00
David Lamparter
cd2726408a vtysh: make -c useful with -C (dryrun)
-c was previously ignored when -C (dryrun/config-check) was present.
Change so that -C -c creates an useful dry-run mode.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 17:22:53 +01:00
David Lamparter
37f9f36ec9 grammar_sandbox: count ambiguous commands
... and make the return value useful (for vtysh)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 17:14:50 +01:00
Donald Sharp
c19cf154ef Merge pull request #194 from opensourcerouting/coverity-lib-2
more lib/ coverity fixes
2017-02-10 11:06:37 -05:00
David Lamparter
dab8cd005f *: fix ambiguous commands
Some "show [ip] bgp ipv4 encap ..." commands remaining ambiguous.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 16:57:20 +01:00
David Lamparter
0a22b97922 grammar_sandbox: add ambiguous-command finder
Best run in vtysh.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 16:44:28 +01:00
David Lamparter
db85c8b384 lib: track name of command in cmd_element
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 16:44:28 +01:00
David Lamparter
fdc3d1ab83 tests: add uninstall_element in testcli
Test uninstall_element().  The commandline-specified counter allows
isolating memleaks more closely, differentiating one-off vs. repeated
leaks.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 15:40:38 +01:00
David Lamparter
de8f7a3983 lib: parser: rewrite token deduplication
Merge the parsed graph into the existing one as a separate step.  This
makes it possible to merge identical subgraphs, which is used e.g. in
bgpd for <A.B.C.D|X:X::X:X|WORD> neighbor names.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 15:39:04 +01:00
David Lamparter
6de469061b lib: rework vty_use_backup_config()
Like config_write(), this should use rename(), even though atomicity is
not a real issue here.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 15:04:40 +01:00
David Lamparter
148781210f lib: fix remaining coverity issues
Reported-by: Coverity
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 15:04:06 +01:00
David Lamparter
6432969db9 lib: parser: remove previous deduplication code
Rewritten in next commit.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 13:38:04 +01:00
David Lamparter
01024b5235 Merge pull request #192 from donaldsharp/snmp1
debian: Fix to not auto-install snmp MIB
2017-02-10 13:12:45 +01:00
Martin Winter
9cbad1d7c4 ospfd: CID 1399387 (#1 of 2): Destination buffer too small (STRING_OVERFLOW)
Coverity: string_overflow: You might overrun the 100-character destination string vty_path by writing 4096 characters from vty_sock_path.
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2017-02-10 16:53:18 +07:00
Martin Winter
b3411578b0 lib: CID 1399296: Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)
Needs to be a comparison, not assignment

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2017-02-10 16:52:54 +07:00
Martin Winter
4fdeb6b0af zebra: Fix CID 1399335 (#1 of 1): Wrong sizeof argument (SIZEOF_MISMATCH)
Needs to be size of correct structure (prefix instead of prefix_ipv4)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2017-02-10 16:52:34 +07:00
Martin Winter
fa389c272f vtysh: Fix Coverity Warning CID 1399479 (#1 of 1): Destination buffer too small (BUFFER_SIZE)
Coverity: buffer_size: You might overrun the 108 byte destination string addr.sun_path by writing the maximum 4095 bytes from path.
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2017-02-10 16:51:57 +07:00
Martin Winter
67e5d67651 ospfd: Fix Coverity Warning CID 1399480 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)
Coverity: buffer_size_warning: Calling strncpy with a maximum size argument of 100 bytes on destination array pid_file of size 100 bytes might leave the destination string unterminated.
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2017-02-10 16:50:23 +07:00
Donald Sharp
8df6a2a80a Merge remote-tracking branch 'origin/stable/2.0' 2017-02-09 12:13:49 -05:00
Donald Sharp
3cf5e24624 Merge pull request #191 from opensourcerouting/ospfclient-incl
[stable] ospfclient: #include sources
2017-02-09 12:12:17 -05:00
Donald Sharp
3d85ffa58e debian: Fix to not auto-install snmp MIB
Only install the snmp MIB for zebra if we
are building the debian package with SNMP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-09 11:52:48 -05:00
David Lamparter
bd9db8f46e ospfclient: #include sources
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>
2017-02-09 17:08:09 +01:00
Donald Sharp
305e9740ff Merge remote-tracking branch 'origin/stable/2.0' 2017-02-09 09:53:46 -05:00
Donald Sharp
b9aa3abbbe Merge pull request #189 from opensourcerouting/config-write-sync
lib: use fsync() for config writes, plug fd leak
2017-02-09 09:52:58 -05:00
Donald Sharp
9c3a235e8a Merge pull request #164 from opensourcerouting/pytest2
Rework test runners to use pytest
2017-02-09 09:38:37 -05:00
Donald Sharp
b7671f356a Merge pull request #190 from opensourcerouting/config-write-sync-stable
[stable] lib: use fsync() for config writes, plug fd leak
2017-02-09 09:26:58 -05:00
David Lamparter
1520d0aca9 lib: use fsync() for config writes, plug fd leak
sync() has a HUGE impact on systems that perform actual I/O, i.e. real
servers...

Also, we were leaking a fd on each config write ever since
c5e69a0 "lib/vty: add separate output fd support to VTYs"
(by myself :( ...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-09 14:25:55 +01:00
David Lamparter
bae44e4b76 Merge branch 'frr/pull/186' (pimd register length)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-09 13:46:44 +01:00
David Lamparter
056cfe496e lib: use fsync() for config writes, plug fd leak
sync() has a HUGE impact on systems that perform actual I/O, i.e. real
servers...

Also, we were leaking a fd on each config write ever since
c5e69a0 "lib/vty: add separate output fd support to VTYs"
(by myself :( ...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-09 12:54:25 +01:00
Philippe Guibert
1b5fd9813d bgpd: change str2mac call api
With the changed API, some adaptations are done in rfapi code.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-02-09 09:02:58 +01:00
Philippe Guibert
3d5fc15be2 lib: simplify str2mac and use struct ethaddr structure
This commit simplified the string to mac conversion, since it uses
sscanf, instead of depicting each incoming character one by one, and
doing self analysis. Also,this commit changes the internal usage of the
mac address representation in mac handling function.

Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-02-09 09:02:41 +01:00
Donald Sharp
10c7cd3920 Merge pull request #185 from opensourcerouting/coverity-lib-1
Coverity foo
2017-02-08 13:44:53 -05:00
Christian Franke
a4b74d05fc tests: add pytest testrunners
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-02-08 19:10:10 +01:00
Christian Franke
ca49a76b02 tests: reorganize tests hierarchically
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-02-08 19:09:35 +01:00
Christian Franke
0b4191c147 tests: remove dejagnu
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-02-08 19:08:25 +01:00
David Lamparter
8ac885457f lib: csv: plug memleaks
Reported-by: Coverity Scan
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-08 16:35:02 +01:00
David Lamparter
a31ff449a0 lib: fix some coverity NULL check warnings
Reported-by: Coverity Scan
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-08 16:34:59 +01:00
David Lamparter
dbb5a5552a lib: remove unused str2in6_addr()
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-08 16:33:47 +01:00
David Lamparter
caeb0a4f65 lib: remove unused cmd_concat_strvec()
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-08 16:33:25 +01:00
Donald Sharp
e6b737294a Merge pull request #182 from opensourcerouting/ldpd-coverity-scan
ldpd: fix issues reported by coverity scan
2017-02-08 10:25:27 -05:00
Donald Sharp
66ec5f3244 Merge pull request #181 from opensourcerouting/zebra-static-uninstall-mpls
zebra: fix uninstallation of LDP labeled static routes
2017-02-08 10:25:11 -05:00
David Lamparter
93f6b7dbfe Merge branch 'frr/pull/183' ("Coverity")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-08 16:23:57 +01:00
Donald Sharp
6431763d95 pimd: Send proper length register packets
PIM Register packets are 20 bytes too long.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-08 09:46:43 -05:00
Donald Sharp
ce45c9cc64 Merge branch 'master' of https://github.com/freerangerouting/frr into coverity 2017-02-08 09:35:57 -05:00
Donald Sharp
74ef167228 bgpd: Fix miss-indented code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-08 09:35:33 -05:00
David Lamparter
e84aba82ab Merge branch 'frr/pull/180' ("Warnings")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-08 15:31:24 +01:00
Donald Sharp
95c54276f7 zebra: Don't leak socket with failure condition
Don't leak a socket when we are unable to set it
as non-blocking and warn the user as appropriate.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-08 08:26:07 -05:00
Renato Westphal
f82a542855 ldpd: fix issues reported by coverity scan
Fix two small memleaks in the CLI code and check the return values of
getsockname() and getpeername().

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-02-08 11:21:13 -02:00
Renato Westphal
9c934a1843 zebra: fix uninstallation of LDP labeled static routes
Problem:
1 - Add a static route: "ip route 10.0.0.0/24 172.16.1.1";
2 - Receive an LDP mapping for 10.0.0.0/24 from 172.16.1.1;
3 - Remove the static route: "no ip route 10.0.0.0/24 172.16.1.1".
4 - Static route is removed but not uninstalled from the kernel.

What happens is that, on static_uninstall_route(), we can't find the
route we want to uninstall because it has an LDP label where the original
static route doesn't have any MPLS label.

To fix this, we can just stop calling static_nexthop_label_same() and
remove this function. It's impossible to have two routes for the same
prefix with the same distance and same nexthop address. This means that
we can lookup the correct route to uninstall without having to check
its labels.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-02-08 10:50:03 -02:00
Lou Berger
cf80f28161 Merge pull request #179 from donaldsharp/more_quagga_fixups
*: Found some instances of Quagga.conf
2017-02-07 20:46:44 -05:00