Commit Graph

9190 Commits

Author SHA1 Message Date
Vincent JARDIN
b42d80dd9a bgpd: fix aspath parsing
clang provides a notice about it that this p++ is useless,
because ++ would be done after the return.

From code review, I understand that p shall be incremented
for each token that is parsed from the buf. So let's keep
this intent.

Note that this commit is changing the behaviour of the source
code since from now p++ will be returned instead of p.
However, it does not hurt since the only consumer
just free() the aspath if it is parsed as as_token_unknown.
Let's be safe with a proper execution flow from now.

PS:
C reminders:

int f7(void) {
  int j = 7;

  return ++j; // return 8
}

int f8(void) {
  int j = 7;

  return j++; // return 7
}

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-09 09:48:53 +02:00
Vincent JARDIN
e4002056b8 bgpd: fix clang warning
stlv_last is initialized with the loops. No need to reset it.
Its scope is local to the use with the loops.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-09 01:22:02 +02:00
Donald Sharp
40aa03ebde Merge pull request #1307 from vjardin6WIND/clean
Fix many clang warning
2017-10-08 19:07:09 -04:00
Vincent JARDIN
85bbc95dc3 eigrpd: fix clang warning
ei shall never be NULL once we do the lookup. If it is NULL
bad things could happen.
For instance ei->t_distribute may not be a valid reference.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-09 00:12:01 +02:00
Vincent JARDIN
6c86ed54c2 eigrpd: fix clang warning
nbr cannot be NULL. Doing such test does confuse clang since
we do not have execution case if nbr == NULL.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-09 00:06:08 +02:00
Vincent JARDIN
e991f75cb8 bgpd: fix clang warning
Same fix than c31a793, alwas get the string so clang does not complain that
it can be NULL.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:50:54 +02:00
Vincent JARDIN
47402c0f91 vtysh: fix clang warning
cmd->line shall never be null for these sections.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:48:55 +02:00
Vincent JARDIN
792fa92ec1 zebra: fix clang warning
Set to 0 to avoid "Branch condition evaluates to a garbage value".

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:47:43 +02:00
Vincent JARDIN
649579afb3 lib: fix clang warning
Properly initialize to avoid "Branch condition evaluates to a garbage value"
warning.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:46:24 +02:00
Vincent JARDIN
49b6be9bd4 bgpd: fix clang warning
Remove stored value to llen that is never used.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:45:10 +02:00
Vincent JARDIN
8881d722da rfapi: fix clang warning
When DEBUG_L2_EXTRA is not set, clang emits a warning because rc is not
used.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:43:59 +02:00
Vincent JARDIN
443e99e767 eirgpd: fix clang warning
opcode is not used.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:42:55 +02:00
Vincent JARDIN
51f7fe8459 ripngd: fix clang warning
this value len is not used for this vty_out() case.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:40:36 +02:00
Vincent JARDIN
f38b7f6dd3 ospfd: fix clang warning
us is clearly not used, but let's keep it to have a readable logic.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:39:34 +02:00
Vincent JARDIN
e3df3ba6d4 ldpd: fix clang warning
size is not used for further parsing. Keep it updated but tell
to the compiler that we know it is not used just in case one
needs to extend the parsing somedays.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:39:34 +02:00
Vincent JARDIN
9c5e2b4f61 isisd: fix clang warning
tlvs is not used after extracting the last TLV. So,
let's tell to the compiler that it is expected.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:39:21 +02:00
Vincent JARDIN
7295876ada ospfd: fix clang warning
Value stored to 'nbraddr' during its initialization is never read

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:19:38 +02:00
Vincent JARDIN
6e38a9ece0 ospf6d: fix clang warning
troute and tinfo needs to be 0'd

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:19:34 +02:00
Vincent JARDIN
3981b5c7f3 ospf6d: fix clang warning, NULL() calls
Avoid show() methods from being a NULL function when it is called.
Meanwhile, I did const'ify the handlers so only its debug field can be changed.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 23:06:57 +02:00
Vincent JARDIN
21cf6b211b rfapi: avoid calling NULL() function.
Keep the execution flow, bug log errors.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08 17:56:23 +02:00
Donald Sharp
75fc729f05 Merge pull request #1303 from opensourcerouting/ldpd-scan-build
ldpd: sprinkle in some asserts to make scan-build happy
2017-10-06 17:50:18 -04:00
Renato Westphal
11bf8e13f2 ldpd: sprinkle in some asserts to make scan-build happy
While here, fix the other SA warnings.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-06 17:50:19 -03:00
Lou Berger
3782fb37b1 Merge pull request #1295 from donaldsharp/more_1270
More 1270
2017-10-06 09:31:30 -04:00
Donald Sharp
bdef880d9c Merge pull request #1299 from opensourcerouting/small_fixes
Small fixes
2017-10-06 09:12:09 -04:00
Renato Westphal
8526b84200 zebra: fix display of negative route metrics and tags
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-05 22:55:58 -03:00
Renato Westphal
8034beff9f *: use argv[]->text instead of argv[]->arg when appropriate
Incomplete commands like "debug ospf6 route mem" were being ignored. The
changes in ripd and ripngd are intended to make the code easier to read,
no bugs were fixed in these two daemons.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-05 22:54:42 -03:00
Renato Westphal
993bab898d lib, ldpd: fix "argument cannot be negative" coverity warnings
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-05 22:51:23 -03:00
Lou Berger
76ae8092db Merge pull request #1264 from donaldsharp/linklist
Linklist api cleanup
2017-10-05 14:57:05 -04:00
Renato Westphal
9772d72979 Merge pull request #1293 from donaldsharp/pim_boundary_oil
Pim boundary oil
2017-10-05 13:20:00 -03:00
Donald Sharp
acdf5e2510 *: Convert list_free usage to list_delete
list_free is occassionally being used to delete the
list and accidently not deleting all the nodes.
We keep running across this usage pattern.  Let's
remove the temptation and only allow list_delete
to handle list deletion.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:53:17 -04:00
Donald Sharp
affe9e9983 *: Convert list_delete(struct list *) to ** to allow nulling
Convert the list_delete(struct list *) function to use
struct list **.  This is to allow the list pointer to be nulled.

I keep running into uses of this list_delete function where we
forget to set the returned pointer to NULL and attempt to use
it and then experience a crash, usually after the developer
has long since left the building.

Let's make the api explicit in it setting the list pointer
to null.

Cynical Prediction:  This code will expose a attempt
to use the NULL'ed list pointer in some obscure bit
of code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:53:13 -04:00
Donald Sharp
a3c1db5e1d vtysh: Fix ordering of multicast boundary command
The multicast boundary command must be shown after
the `ip pim sm` command.  So add a new config_add_line_end
and make it the last one.

Signed-off-by: Donald Sharp <sharp@cumulusnetworks.com>
2017-10-05 10:33:42 -04:00
Donald Sharp
513c846203 pimd: Fix multicast boundary command
1) Fix missing newlines
2) Write the correct cli out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:31:59 -04:00
Donald Sharp
445c24803d bgpd: Fixup json with RouteDistinguishers
The json option for displaying a bgp table
with route Distinguishers in it was not properly
working.  This code cleans this issue up.

Additionally attempt to make the code a bit
easier to read and handle.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:12:00 -04:00
Donald Sharp
98ce9a06b4 bgpd: Cleanup bgp_show_table to be easier on the eyes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:11:49 -04:00
Lou Berger
af8528faa0 bgpd: fix 'show bgp ipvX vpn rd' command
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-05 10:11:49 -04:00
Lou Berger
3d7c4cd734 bgpd: fix show bgp ipvX vpn all rd
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-05 10:11:49 -04:00
Lou Berger
24345e82e8 bgpd: remove old/broken vpnv4 from of show bgp
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-05 10:11:49 -04:00
Lou Berger
1ae44dfcba bgpd: unify 'show bgp' with RD with normal unicast bgp show
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-05 10:11:49 -04:00
Renato Westphal
ad183f047c Merge pull request #1244 from donaldsharp/flush_routes
tools: Fix route flush
2017-10-05 11:05:43 -03:00
Renato Westphal
bb7b7c0054 Merge pull request #1280 from donaldsharp/eigrp_interface
Eigrp interface cleanup
2017-10-05 11:03:54 -03:00
Renato Westphal
b7801b99c4 Merge pull request #1292 from chiragshah6/mdev
ospf6d: add debug ospf6 route memory to config
2017-10-05 10:43:35 -03:00
Donald Sharp
6977eb91c6 *: Add some documentation about how to handle new daemons
Add some breadcrumbs for when we add a new routing daemon
so things `just work`.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 08:54:03 -04:00
Donald Sharp
92bd13d762 tools: Add NHRP to route flushing
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 08:27:31 -04:00
Donald Sharp
91effb395a tools: Fix babel RT_PROT #
We had mistakenly created another RT_PROT # for babel.
This is incorrect.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 08:23:27 -04:00
Donald Sharp
a6487ff6b5 tools: Fix route flush
This commit does two things:

1) Flush by proto number not string
   This is useful because not all systems might have the proto
   values installed, or a version of iproute2 that they might
   be installed with.
2) Flush missing routes that might have been installed( eigrp
   and nhrp )

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 08:12:44 -04:00
Donald Sharp
c1c41b0458 Merge pull request #1286 from opensourcerouting/isis-lsp-queue-improv
isisd: optimize per interface lsp send-queue creation
2017-10-05 08:06:57 -04:00
Donald Sharp
7be1117a28 Merge pull request #1291 from sebageek/debian-pkg-add-iproute2-alternative
Add iproute2 as dependency alternative in Debian package
2017-10-04 18:38:41 -04:00
Donald Sharp
b3c84c1db1 Merge pull request #1288 from donaldsharp/1287
doc: Added python-ipaddr dependancy
2017-10-04 18:37:11 -04:00
Chirag Shah
6f7af48c12 ospf6d: add debug ospf6 route memory to config
vty config write to display 'debug ospf6 route memory'.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-10-04 14:35:54 -07:00