Skip to content

Commit

Permalink
*: Remove solaris from FRR
Browse files Browse the repository at this point in the history
The Solaris code has gone through a deprecation cycle.  No-one
has said anything to us and worse of all we don't have any test
systems running Solaris to know if we are making changes that
are breaking on Solaris.  Remove it from the system so
we can clean up a bit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
  • Loading branch information
donaldsharp committed Sep 21, 2020
1 parent 1f79037 commit cae8bc9
Show file tree
Hide file tree
Showing 51 changed files with 24 additions and 3,514 deletions.
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ include qpb/subdir.am
include fpm/subdir.am
include grpc/subdir.am
include tools/subdir.am
include solaris/subdir.am

include bgpd/subdir.am
include bgpd/rfp-example/librfp/subdir.am
Expand Down
4 changes: 0 additions & 4 deletions bgpd/rfapi/rfapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@

/* probably ought to have a field-specific define in config.h */
#ifndef s6_addr32 /* for solaris/bsd */
#ifdef SOLARIS_IPV6
# define s6_addr32 _S6_un._S6_u32
#else
# define s6_addr32 __u6_addr.__u6_addr32
#endif
#endif

#define RFAPI_V4_ADDR 0x04
#define RFAPI_V6_ADDR 0x06
Expand Down
32 changes: 2 additions & 30 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1124,17 +1124,7 @@ is_linux=false
AC_MSG_CHECKING([which operating system interface to use])
case "$host_os" in
sunos* | solaris2*)
AC_MSG_RESULT([Solaris])

AC_DEFINE([SUNOS_5], [1], [SunOS 5])
AC_DEFINE([SOLARIS_IPV6], [1], Solaris IPv6)
AC_DEFINE([_POSIX_C_SOURCE], [200809L], [enable POSIX.1-2008 and XPG7/SUSv4])

AC_CHECK_LIB([socket], [main])
AC_CHECK_LIB([nsl], [main])
AC_CHECK_LIB([umem], [main])
SOLARIS="solaris"
AC_MSG_WARN([--Solaris support is being considered for deprecation, please let us know if you are still using this--])
AC_MSG_FAILURE([Solaris support has been removed please see versions prior to 7.5])
;;
linux*)
AC_MSG_RESULT([Linux])
Expand Down Expand Up @@ -1167,7 +1157,6 @@ case "$host_os" in
AC_DEFINE([BSD_V6_SYSCTL], [1], [BSD v6 sysctl to turn on and off forwarding])
;;
esac
AM_CONDITIONAL([SOLARIS], [test "$SOLARIS" = "solaris"])
AM_CONDITIONAL([LINUX], [${is_linux}])

AC_SYS_LARGEFILE
Expand Down Expand Up @@ -1391,10 +1380,6 @@ case "$host_os" in
AC_MSG_RESULT([pfpacket])
ISIS_METHOD_MACRO="ISIS_METHOD_PFPACKET"
;;
solaris* | sunos*)
AC_MSG_RESULT([DLPI])
ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
;;
*)
if test "$ac_cv_header_net_bpf_h" = "no"; then
if test "$ac_cv_header_sys_dlpi_h" = "no"; then
Expand Down Expand Up @@ -1512,7 +1497,6 @@ if test "$ac_cv_have_decl_TCP_MD5SIG" = "no"; then
AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)])
fi

AC_SUBST([SOLARIS])
AC_CHECK_LIB([crypt], [crypt], [],
[AC_CHECK_LIB([crypto], [DES_crypt])])
AC_CHECK_LIB([resolv], [res_init])
Expand Down Expand Up @@ -2143,17 +2127,6 @@ if test "$enable_capabilities" != "no"; then
LIBCAP="-lcap"
frr_ac_lcaps="yes"]
)
else
AC_CHECK_HEADERS([priv.h],
[AC_MSG_CHECKING([Solaris style privileges are available])
AC_TRY_COMPILE([#include <priv.h>], [getpflags(PRIV_AWARE);],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_SOLARIS_CAPABILITIES], [1], [getpflags])
frr_ac_scaps="yes"],
AC_MSG_RESULT(no)
)
]
)
fi
if test "$frr_ac_scaps" = "yes" \
-o "$frr_ac_lcaps" = "yes"; then
Expand Down Expand Up @@ -2219,7 +2192,7 @@ dnl check for malloc mallinfo struct and call
dnl this must try and link using LIBS, in
dnl order to check no alternative allocator
dnl has been specified, which might not provide
dnl mallinfo, e.g. such as Umem on Solaris.
dnl mallinfo
dnl -----------------------------------------
AC_CHECK_HEADERS([malloc.h malloc_np.h malloc/malloc.h],,, [FRR_INCLUDES])

Expand Down Expand Up @@ -2413,7 +2386,6 @@ AC_CONFIG_FILES([
config.version
changelog-auto
redhat/frr.spec
solaris/Makefile
alpine/APKBUILD
snapcraft/snapcraft.yaml
lib/version.h
Expand Down
42 changes: 0 additions & 42 deletions lib/if.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,44 +802,6 @@ void if_dump_all(void)
if_dump(ifp);
}

#ifdef SUNOS_5
/* Need to handle upgrade from SUNWzebra to Quagga. SUNWzebra created
* a seperate struct interface for each logical interface, so config
* file may be full of 'interface fooX:Y'. Solaris however does not
* expose logical interfaces via PF_ROUTE, so trying to track logical
* interfaces can be fruitless, for that reason Quagga only tracks
* the primary IP interface.
*
* We try accomodate SUNWzebra by:
* - looking up the interface name, to see whether it exists, if so
* its useable
* - for protocol daemons, this could only because zebra told us of
* the interface
* - for zebra, only because it learnt from kernel
* - if not:
* - search the name to see if it contains a sub-ipif / logical interface
* seperator, the ':' char. If it does:
* - text up to that char must be the primary name - get that name.
* if not:
* - no idea, just get the name in its entirety.
*/
static struct interface *if_sunwzebra_get(const char *name, vrf_id_t vrf_id)
{
struct interface *ifp;
char *cp;

if ((ifp = if_lookup_by_name(name, vrf_id)) != NULL)
return ifp;

/* hunt the primary interface name... */
cp = strchr(name, ':');
if (cp)
*cp = '\0';

return if_get_by_name(name, vrf_id);
}
#endif /* SUNOS_5 */

#if 0
/* For debug purpose. */
DEFUN (show_address,
Expand Down Expand Up @@ -1554,11 +1516,7 @@ static int lib_interface_create(struct nb_cb_create_args *args)
case NB_EV_APPLY:
vrf = vrf_lookup_by_name(vrfname);
assert(vrf);
#ifdef SUNOS_5
ifp = if_sunwzebra_get(ifname, vrf->vrf_id);
#else
ifp = if_get_by_name(ifname, vrf->vrf_id);
#endif /* SUNOS_5 */

ifp->configured = true;
nb_running_set_entry(args->dnode, ifp);
Expand Down
4 changes: 2 additions & 2 deletions lib/netns_other.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/


#if !defined(GNU_LINUX) && (defined(SUNOS_5) || defined(OPEN_BSD))
/* SUNOS_5 or OPEN_BSD */
#if !defined(GNU_LINUX) && defined(OPEN_BSD)
/* OPEN_BSD */

#include <zebra.h>
#include "ns.h"
Expand Down
9 changes: 0 additions & 9 deletions lib/prefix.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,11 @@
#ifndef _ZEBRA_PREFIX_H
#define _ZEBRA_PREFIX_H

#ifdef SUNOS_5
#include <sys/ethernet.h>
#else
#ifdef GNU_LINUX
#include <net/ethernet.h>
#else
#include <netinet/if_ether.h>
#endif
#endif
#include "sockunion.h"
#include "ipaddr.h"
#include "compiler.h"
Expand Down Expand Up @@ -411,12 +407,7 @@ static inline void ipv4_addr_copy(struct in_addr *dst,

/* glibc defines s6_addr32 to __in6_u.__u6_addr32 if __USE_{MISC || GNU} */
#ifndef s6_addr32
#if defined(SUNOS_5)
/* Some SunOS define s6_addr32 only to kernel */
#define s6_addr32 _S6_un._S6_u32
#else
#define s6_addr32 __u6_addr.__u6_addr32
#endif /* SUNOS_5 */
#endif /*s6_addr32*/

/* Prototypes. */
Expand Down
Loading

0 comments on commit cae8bc9

Please sign in to comment.