diff options
author | Chris Hall <GMCH@hestia.halldom.com> | 2010-04-17 16:50:23 +0100 |
---|---|---|
committer | Chris Hall <GMCH@hestia.halldom.com> | 2010-04-17 16:50:23 +0100 |
commit | 31d9b6c31d949bf0e884d8a6e02939345b9816e1 (patch) | |
tree | 7a6588c12a16f99b512232b77e86118837c646c4 | |
parent | 825f338d44433fc2d351c08d41272f52a15329db (diff) | |
download | quagga-31d9b6c31d949bf0e884d8a6e02939345b9816e1.tar.bz2 quagga-31d9b6c31d949bf0e884d8a6e02939345b9816e1.tar.xz |
Bring up to date with 0.99.16 release
This brings this branch up to date with 0.99.16, EXCEPT for the
change to bgpd to use monotonic clock for timing updates.
There are places where bgpd expects to find the actual time that
things happened... so this change is not though to be complete.
Further tidying in zebra, for FreeBSD.
-rw-r--r-- | isisd/isis_dlpi.c | 6 | ||||
-rw-r--r-- | isisd/isis_pdu.c | 2 | ||||
-rw-r--r-- | lib/command.c | 10 | ||||
-rw-r--r-- | lib/memory.h | 7 | ||||
-rw-r--r-- | lib/prefix.c | 4 | ||||
-rw-r--r-- | ospfd/ospf_lsdb.c | 1 | ||||
-rw-r--r-- | ospfd/ospf_packet.c | 5 | ||||
-rw-r--r-- | zebra/if_sysctl.c | 10 | ||||
-rw-r--r-- | zebra/interface.h | 8 | ||||
-rw-r--r-- | zebra/ioctl.c | 2 | ||||
-rw-r--r-- | zebra/ioctl.h | 2 | ||||
-rw-r--r-- | zebra/ioctl_solaris.c | 5 |
12 files changed, 38 insertions, 24 deletions
diff --git a/isisd/isis_dlpi.c b/isisd/isis_dlpi.c index 3cbe0b4f..f4378464 100644 --- a/isisd/isis_dlpi.c +++ b/isisd/isis_dlpi.c @@ -26,10 +26,10 @@ #include <sys/types.h> #include <unistd.h> #include <fcntl.h> -#include <stropts.h> +//#include <stropts.h> #include <poll.h> -#include <sys/dlpi.h> -#include <sys/pfmod.h> +//#include <sys/dlpi.h> +//#include <sys/pfmod.h> #include "log.h" #include "stream.h" diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index 4311a905..a2ab0649 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -64,7 +64,7 @@ extern struct isis *isis; #endif /* PNBBY */ /* Utility mask array. */ -static u_char maskbit[] = { +static const u_char maskbit[] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff }; diff --git a/lib/command.c b/lib/command.c index 6fe54d13..a78ac05c 100644 --- a/lib/command.c +++ b/lib/command.c @@ -86,7 +86,7 @@ static struct cmd_node config_node = }; /* Default motd string. */ -const char *default_motd = +static const char *default_motd = "\r\n\ Hello, this is " QUAGGA_PROGNAME " (version " QUAGGA_VERSION ").\r\n\ " QUAGGA_COPYRIGHT "\r\n\ @@ -98,7 +98,7 @@ const char *debug_banner = __DATE__ " " __TIME__; #endif -static struct facility_map { +static const struct facility_map { int facility; const char *name; size_t match; @@ -131,7 +131,7 @@ static struct facility_map { static const char * facility_name(int facility) { - struct facility_map *fm; + const struct facility_map *fm; for (fm = syslog_facilities; fm->name; fm++) if (fm->facility == facility) @@ -142,7 +142,7 @@ facility_name(int facility) static int facility_match(const char *str) { - struct facility_map *fm; + const struct facility_map *fm; for (fm = syslog_facilities; fm->name; fm++) if (!strncmp(str,fm->name,fm->match)) @@ -665,7 +665,7 @@ install_element (enum node_type ntype, struct cmd_element *cmd) cmd->cmdsize = cmd_cmdsize (cmd->strvec); } -static unsigned char itoa64[] = +static const unsigned char itoa64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static void diff --git a/lib/memory.h b/lib/memory.h index 5fa5c5ac..d67e865b 100644 --- a/lib/memory.h +++ b/lib/memory.h @@ -48,7 +48,10 @@ extern struct mlist mlists[]; #define XREALLOC(mtype, ptr, size) \ mtype_zrealloc (__FILE__, __LINE__, (mtype), (ptr), (size)) #define XFREE(mtype, ptr) \ - mtype_zfree (__FILE__, __LINE__, (mtype), (ptr)) + do { \ + mtype_zfree (__FILE__, __LINE__, (mtype), (ptr)); \ + ptr = NULL; } \ + while (0) #define XSTRDUP(mtype, str) \ mtype_zstrdup (__FILE__, __LINE__, (mtype), (str)) #else @@ -92,7 +95,7 @@ extern void *mtype_zmalloc (const char *file, int line, enum MTYPE type, size_t size); extern void *mtype_zcalloc (const char *file, int line, enum MTYPE type, - size_t num, size_t size); + size_t size); extern void *mtype_zrealloc (const char *file, int line, enum MTYPE type, void *ptr, size_t size); diff --git a/lib/prefix.c b/lib/prefix.c index 7755d4e7..9b5c9a7a 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -29,8 +29,8 @@ #include "log.h" /* Maskbit. */ -static u_char maskbit[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0, - 0xf8, 0xfc, 0xfe, 0xff}; +static const u_char maskbit[] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, + 0xf8, 0xfc, 0xfe, 0xff }; /* Number of bits in prefix type. */ #ifndef PNBBY diff --git a/ospfd/ospf_lsdb.c b/ospfd/ospf_lsdb.c index 2e1bdedf..c906f052 100644 --- a/ospfd/ospf_lsdb.c +++ b/ospfd/ospf_lsdb.c @@ -75,7 +75,6 @@ ospf_lsdb_cleanup (struct ospf_lsdb *lsdb) static void lsdb_prefix_set (struct prefix_ls *lp, struct ospf_lsa *lsa) { - memset (lp, 0, sizeof (struct prefix_ls)); lp->family = 0; lp->prefixlen = 64; lp->id = lsa->data->id; diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index d8ff41d4..8045c659 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -1723,17 +1723,17 @@ ospf_ls_upd (struct ip *iph, struct ospf_header *ospfh, /* Reject from STUB or NSSA */ if (nbr->oi->area->external_routing != OSPF_AREA_DEFAULT) { - DISCARD_LSA (lsa, 1); if (IS_DEBUG_OSPF_NSSA) zlog_debug("Incoming External LSA Discarded: We are NSSA/STUB Area"); + DISCARD_LSA (lsa, 1); } if (lsa->data->type == OSPF_AS_NSSA_LSA) if (nbr->oi->area->external_routing != OSPF_AREA_NSSA) { - DISCARD_LSA (lsa,2); if (IS_DEBUG_OSPF_NSSA) zlog_debug("Incoming NSSA LSA Discarded: Not NSSA Area"); + DISCARD_LSA (lsa,2); } /* Find the LSA in the current database. */ @@ -1952,6 +1952,7 @@ ospf_ls_upd (struct ip *iph, struct ospf_header *ospfh, } } } +#undef DISCARD_LSA assert (listcount (lsas) == 0); list_delete (lsas); diff --git a/zebra/if_sysctl.c b/zebra/if_sysctl.c index 8c78daa6..c7fecb77 100644 --- a/zebra/if_sysctl.c +++ b/zebra/if_sysctl.c @@ -35,6 +35,16 @@ #include "zebra/rt.h" #include "zebra/kernel_socket.h" +#include "zebra/interface.h" + +/* zebra/interface.h declares some extern functions for if_sysctl.c + * + * The following are not declared if HAVE_NET_RT_IFLIST is not defined. + * So declare them here if required, in order to suppress warnings. + */ +#ifndef HAVE_NET_RT_IFLIST +extern void ifstat_update_sysctl (void); +#endif void ifstat_update_sysctl (void) diff --git a/zebra/interface.h b/zebra/interface.h index e07388cb..147521c6 100644 --- a/zebra/interface.h +++ b/zebra/interface.h @@ -225,16 +225,16 @@ extern int if_subnet_add (struct interface *, struct connected *); extern int if_subnet_delete (struct interface *, struct connected *); #ifdef HAVE_PROC_NET_DEV -extern void ifstat_update_proc (void); /* see if_proc.c */ -extern int interface_list_proc (void); /* see if_proc.c */ +extern void ifstat_update_proc (void); /* see if_proc.c */ +extern int interface_list_proc (void); /* see if_proc.c */ #endif /* HAVE_PROC_NET_DEV */ #if defined(HAVE_IPV6) && defined(HAVE_PROC_NET_IF_INET6) -extern int ifaddr_proc_ipv6 (void); /* see if_proc.c */ +extern int ifaddr_proc_ipv6 (void); /* see if_proc.c */ #endif /* HAVE_PROC_NET_IF_INET6 */ #ifdef HAVE_NET_RT_IFLIST -extern void ifstat_update_sysctl (void); +extern void ifstat_update_sysctl (void); /* see if_sysctl.c */ #endif /* HAVE_NET_RT_IFLIST */ #ifdef BSDI diff --git a/zebra/ioctl.c b/zebra/ioctl.c index 7c51e91b..ae8cadb6 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -80,7 +80,7 @@ if_ioctl (u_long request, caddr_t buffer) } #ifdef HAVE_IPV6 -static int +extern int if_ioctl_ipv6 (u_long request, caddr_t buffer) { int sock; diff --git a/zebra/ioctl.h b/zebra/ioctl.h index 2feb39bc..1c4142de 100644 --- a/zebra/ioctl.h +++ b/zebra/ioctl.h @@ -48,10 +48,10 @@ extern void if_get_mtu (struct interface *); #ifdef HAVE_IPV6 extern int if_prefix_add_ipv6 (struct interface *, struct connected *); extern int if_prefix_delete_ipv6 (struct interface *, struct connected *); +extern int if_ioctl_ipv6(u_long, caddr_t); #endif /* HAVE_IPV6 */ #ifdef SOLARIS_IPV6 -extern int if_ioctl_ipv6(u_long, caddr_t); extern struct connected *if_lookup_linklocal( struct interface *); #define AF_IOCTL(af, request, buffer) \ diff --git a/zebra/ioctl_solaris.c b/zebra/ioctl_solaris.c index 6c1c254a..5c7c00b1 100644 --- a/zebra/ioctl_solaris.c +++ b/zebra/ioctl_solaris.c @@ -79,11 +79,11 @@ if_ioctl (u_long request, caddr_t buffer) return 0; } +#ifdef HAVE_IPV6 int if_ioctl_ipv6 (u_long request, caddr_t buffer) { -#ifdef HAVE_IPV6 int sock; int ret; int err; @@ -115,11 +115,12 @@ if_ioctl_ipv6 (u_long request, caddr_t buffer) errno = err; return ret; } -#endif /* HAVE_IPV6 */ return 0; } +#endif /* HAVE_IPV6 */ + /* * get interface metric * -- if value is not avaliable set -1 |