mirror_frr/zebra
Paul Jakma 1f9a9fffc1 Fix most compiler warnings in default GCC build.
Fix lots of warnings. Some const and type-pun breaks strict-aliasing
warnings left but much reduced.

* bgp_advertise.h: (struct bgp_advertise_fifo) is functionally identical to
  (struct fifo), so just use that.  Makes it clearer the beginning of
  (struct bgp_advertise) is compatible with with (struct fifo), which seems
  to be enough for gcc.
  Add a BGP_ADV_FIFO_HEAD macro to contain the right cast to try shut up
  type-punning breaks strict aliasing warnings.
* bgp_packet.c: Use BGP_ADV_FIFO_HEAD.
  (bgp_route_refresh_receive) fix an interesting logic error in
  (!ok || (ret != BLAH)) where ret is only well-defined if ok.
* bgp_vty.c: Peer commands should use bgp_vty_return to set their return.
* jhash.{c,h}: Can take const on * args without adding issues & fix warnings.
* libospf.h: LSA sequence numbers use the unsigned range of values, and
  constants need to be set to unsigned, or it causes warnings in ospf6d.
* md5.h: signedness of caddr_t is implementation specific, change to an
  explicit (uint_8 *), fix sign/unsigned comparison warnings.
* vty.c: (vty_log_fixed) const on level is well-intentioned, but not going
  to fly given iov_base.
* workqueue.c: ALL_LIST_ELEMENTS_RO tests for null pointer, which is always
  true for address of static variable.  Correct but pointless warning in
  this case, but use a 2nd pointer to shut it up.
* ospf6_route.h: Add a comment about the use of (struct prefix) to stuff 2
  different 32 bit IDs into in (struct ospf6_route), and the resulting
  type-pun strict-alias breakage warnings this causes.  Need to use 2
  different fields to fix that warning?

general:

* remove unused variables, other than a few cases where they serve a
  sufficiently useful documentary purpose (e.g.  for code that needs
  fixing), or they're required dummies.  In those cases, try mark them as
  unused.
* Remove dead code that can't be reached.
* Quite a few 'no ...' forms of vty commands take arguments, but do not
  check the argument matches the command being negated.  E.g., should
  'distance X <prefix>' succeed if previously 'distance Y <prefix>' was set?
  Or should it be required that the distance match the previously configured
  distance for the prefix?
  Ultimately, probably better to be strict about this.  However, changing
  from slack to strict might expose problems in command aliases and tools.
* Fix uninitialised use of variables.
* Fix sign/unsigned comparison warnings by making signedness of types consistent.
* Mark functions as static where their use is restricted to the same compilation
  unit.
* Add required headers
* Move constants defined in headers into code.
* remove dead, unused functions that have no debug purpose.

(cherry picked from commit 7aa9dcef80b2ce50ecaa77653d87c8b84e009c49)

Conflicts:
	bgpd/bgp_advertise.h
	bgpd/bgp_mplsvpn.c
	bgpd/bgp_nexthop.c
	bgpd/bgp_packet.c
	bgpd/bgp_route.c
	bgpd/bgp_routemap.c
	bgpd/bgp_vty.c
	lib/command.c
	lib/if.c
	lib/jhash.c
	lib/workqueue.c
	ospf6d/ospf6_lsa.c
	ospf6d/ospf6_neighbor.h
	ospf6d/ospf6_spf.c
	ospf6d/ospf6_top.c
	ospfd/ospf_api.c
	zebra/router-id.c
	zebra/rt_netlink.c
	zebra/rt_netlink.h
2016-05-26 18:57:39 +00:00
..
.gitignore [administrivia] Update gitignore files 2008-08-22 20:02:08 +01:00
client_main.c lib, vtysh: Return actual problem further up 2016-04-06 20:07:27 -04:00
connected.c BGP: Trigger IPv6 router advertisements upon config of unnumbered neighbor 2016-05-02 13:53:38 -07:00
connected.h Zebra: Remove reliance on NEXTHOP_TYPE_IPV4_ONLINK 2015-11-16 12:48:07 -08:00
debug.c zebra: wire up "debug zebra packet detail" 2016-05-26 15:33:33 +00:00
debug.h Zebra: Cleanup RIB debugs 2015-11-20 08:48:32 -08:00
GNOME-PRODUCT-ZEBRA-MIB Initial revision 2002-12-13 20:15:29 +00:00
GNOME-SMI Initial revision 2002-12-13 20:15:29 +00:00
if_ioctl_solaris.c zebra/if_ioctl_solaris: Make foo static 2016-05-26 15:33:33 +00:00
if_ioctl.c lib, zebra: The Bulk of the conversion over to NS and VRF 2016-02-01 10:55:42 -08:00
if_netlink.c lib, zebra: The Bulk of the conversion over to NS and VRF 2016-02-01 10:55:42 -08:00
if_null.c lib, zebra: Rework zebra_ns to be a bit more modular 2016-04-14 20:56:57 -04:00
if_proc.c zebra: zebra-warnings.patch 2015-05-19 18:04:26 -07:00
if_sysctl.c lib, zebra: The Bulk of the conversion over to NS and VRF 2016-02-01 10:55:42 -08:00
interface.c Fixed if_add_update possible null dereference 2016-05-26 15:33:32 +00:00
interface.h BGP: Trigger IPv6 router advertisements upon config of unnumbered neighbor 2016-05-02 13:53:38 -07:00
ioctl_null.c Add missing GPL headers, and copyright claims that certainly apply. 2016-05-26 01:06:59 +00:00
ioctl_solaris.c zebra/solaris: fix uninitialised vars 2016-05-26 15:33:32 +00:00
ioctl.c lib, zebra: The Bulk of the conversion over to NS and VRF 2016-02-01 10:55:42 -08:00
ioctl.h [zebra/solaris] Interface state fixups for Solaris. 2006-01-25 04:31:40 +00:00
ipforward_aix.c Initial revision 2002-12-13 20:15:29 +00:00
ipforward_ews.c Initial revision 2002-12-13 20:15:29 +00:00
ipforward_proc.c zebra: fix warnings in forward proc 2011-12-07 01:24:09 +04:00
ipforward_solaris.c 2005-06-28 Paul Jakma <paul.jakma@sun.com> 2005-06-28 17:17:12 +00:00
ipforward_sysctl.c 2005-06-28 Paul Jakma <paul.jakma@sun.com> 2005-06-28 17:17:12 +00:00
ipforward.h 2005-06-28 Paul Jakma <paul.jakma@sun.com> 2005-06-28 17:17:12 +00:00
irdp_interface.c zebra: Refactor struct zebra_t 2016-04-14 20:56:45 -04:00
irdp_main.c zebra: Refactor struct zebra_t 2016-04-14 20:56:45 -04:00
irdp_packet.c zebra: Refactor struct zebra_t 2016-04-14 20:56:45 -04:00
irdp.h zebra: deal with irdp compile warnings 2009-12-10 14:22:44 +03:00
kernel_netlink.c Initial revision 2002-12-13 20:15:29 +00:00
kernel_null.c zebra: remove kernel_delete_ipv6_old() 2016-05-26 15:25:13 +00:00
kernel_socket.c zebra: make RTF_LLINFO optional to fix FreeBSD 2016-05-26 15:33:33 +00:00
kernel_socket.h [lib] mes_lookup string lookup table argument should be marked const 2008-08-22 19:52:58 +01:00
main.c quagga: Fixup startup to allow consistency between sysV and systemd 2016-04-27 16:04:48 -04:00
Makefile.am zebra: Build the test client, can be useful, and add IPv6 to testrib.conf 2016-05-26 01:13:58 +00:00
misc_null.c Add missing GPL headers, and copyright claims that certainly apply. 2016-05-26 01:06:59 +00:00
mtu_kvm.c 2004-05-09 Paul Jakma <paul@dishone.st> 2004-05-09 11:00:23 +00:00
redistribute_null.c Add missing GPL headers, and copyright claims that certainly apply. 2016-05-26 01:06:59 +00:00
redistribute.c zebra: Add route-map support to ip import-table 2016-05-12 20:22:53 -04:00
redistribute.h zebra: Add route-map support to ip import-table 2016-05-12 20:22:53 -04:00
rib.h zebra: make MRIB lookup behaviour switchable 2016-05-25 20:38:31 -04:00
router-id.c Fix most compiler warnings in default GCC build. 2016-05-26 18:57:39 +00:00
router-id.h zebra: maintain the router-id per VRF 2015-10-30 00:19:15 -07:00
rt_ioctl.c zebra: remove kernel_delete_ipv6_old() 2016-05-26 15:25:13 +00:00
rt_netlink.c zebra: fix rtnh_len in the rt_netlink messages for multipath case 2016-05-26 17:13:49 +00:00
rt_netlink.h lib, zebra: The Bulk of the conversion over to NS and VRF 2016-02-01 10:55:42 -08:00
rt_socket.c zebra/rt_socket: Fix warnings 2016-05-26 15:33:33 +00:00
rt.h zebra: remove kernel_delete_ipv6_old() 2016-05-26 15:25:13 +00:00
rtadv_null.c BGP: Trigger IPv6 router advertisements upon config of unnumbered neighbor 2016-05-02 13:53:38 -07:00
rtadv.c zebra: Fix leaked sockets in rtadv.c 2016-05-26 15:33:32 +00:00
rtadv.h BGP: Trigger IPv6 router advertisements upon config of unnumbered neighbor 2016-05-02 13:53:38 -07:00
rtread_getmsg.c zebra/rtread_getmsg: fix sign warnings 2016-05-26 15:33:33 +00:00
rtread_netlink.c lib, zebra: The Bulk of the conversion over to NS and VRF 2016-02-01 10:55:42 -08:00
rtread_proc.c Multi-Instance OSPF Summary 2015-05-19 18:03:42 -07:00
rtread_sysctl.c lib, zebra: The Bulk of the conversion over to NS and VRF 2016-02-01 10:55:42 -08:00
test_main.c zebra: Refactor zebra_vrf 2016-04-14 20:57:04 -04:00
testrib.conf zebra: Build the test client, can be useful, and add IPv6 to testrib.conf 2016-05-26 01:13:58 +00:00
zebra_fpm_netlink.c zebra: Refactor zebra_vrf 2016-04-14 20:57:04 -04:00
zebra_fpm_private.h zebra: add module to communicate routes to FPM 2012-11-30 21:41:17 +01:00
zebra_fpm.c zebra: Refactor zebra_vrf 2016-04-14 20:57:04 -04:00
zebra_fpm.h zebra: add module to communicate routes to FPM 2012-11-30 21:41:17 +01:00
zebra_ns.c zebra: Refactor zebra_vrf 2016-04-14 20:57:04 -04:00
zebra_ns.h lib, zebra: Rework zebra_ns to be a bit more modular 2016-04-14 20:56:57 -04:00
zebra_ptm_null.c Zebra and bgpd: VRF support for BFD 2016-03-08 05:10:56 -08:00
zebra_ptm_redistribute.c zebra: Refactor struct zebra_t 2016-04-14 20:56:45 -04:00
zebra_ptm_redistribute.h Zebra and bgpd: VRF support for BFD 2016-03-08 05:10:56 -08:00
zebra_ptm.c zebra - BFD client de-registration support 2016-05-08 20:11:18 -07:00
zebra_ptm.h zebra - BFD client de-registration support 2016-05-08 20:11:18 -07:00
zebra_rib.c zebra: make MRIB lookup behaviour switchable 2016-05-25 20:38:31 -04:00
zebra_rnh_null.c Zebra: Fix static NHT to work properly in a VRF 2016-02-26 19:13:34 +00:00
zebra_rnh.c zebra: Add route-map support to ip import-table 2016-05-12 20:22:53 -04:00
zebra_rnh.h Zebra: Fix static NHT to work properly in a VRF 2016-02-26 19:51:34 +00:00
zebra_routemap.c zebra: Add route-map support to ip import-table 2016-05-12 20:22:53 -04:00
zebra_routemap.h zebra: Add route-map support to ip import-table 2016-05-12 20:22:53 -04:00
zebra_snmp.c zebra: Refactor struct zebra_t 2016-04-14 20:56:45 -04:00
zebra_vrf.c zebra: Fix interface based static routes 2016-05-10 15:07:04 -04:00
zebra_vrf.h zebra: Fix show vrf and show run to use the zvrf_list 2016-05-06 10:41:30 -04:00
zebra_vty.c zebra: don't print uninitialized string (3b02fe8) 2016-05-25 20:38:34 -04:00
zebra.conf.sample Initial revision 2002-12-13 20:15:29 +00:00
zserv_null.c zebra: Refactor zebra_vrf 2016-04-14 20:57:04 -04:00
zserv.c zebra: fix addr sent in ZEBRA_IPV6_NEXTHOP_LOOKUP 2016-05-26 15:33:31 +00:00
zserv.h zebra: Accept and process RAs with lifetime of zero 2016-05-13 10:17:37 -07:00