Merge remote-tracking branch 'origin/stable/2.0'

This commit is contained in:
Donald Sharp 2017-02-02 10:42:51 -05:00
commit 1a35e2e565
95 changed files with 1504 additions and 394 deletions

7
.gitignore vendored
View File

@ -64,3 +64,10 @@ cscope.*
*.pb.h *.pb.h
*.pb-c.h *.pb-c.h
*.pb-c.c *.pb-c.c
TAGS
tags
GTAGS
GSYMS
GRTAGS
GPATH

View File

@ -1,4 +1,4 @@
ChangeLog information for Quagga is now recorded in our source-code ChangeLog information for FreeRangeRouting is for now recorded in source-code
management system. Please see: management system. Please see:
http://www.quagga.net/devel.php http://www.freerangerouting.org/

View File

@ -3,11 +3,11 @@
SUBDIRS = lib qpb fpm @ZEBRA@ @LIBRFP@ @RFPTEST@ \ SUBDIRS = lib qpb fpm @ZEBRA@ @LIBRFP@ @RFPTEST@ \
@BGPD@ @RIPD@ @RIPNGD@ @OSPFD@ @OSPF6D@ @LDPD@ \ @BGPD@ @RIPD@ @RIPNGD@ @OSPFD@ @OSPF6D@ @LDPD@ \
@ISISD@ @PIMD@ @WATCHFRR@ @VTYSH@ @OSPFCLIENT@ @DOC@ m4 @pkgsrcdir@ \ @ISISD@ @PIMD@ @WATCHFRR@ @VTYSH@ @OSPFCLIENT@ @DOC@ m4 @pkgsrcdir@ \
redhat @SOLARIS@ tests tools cumulus redhat @SOLARIS@ tests tools cumulus snapcraft
DIST_SUBDIRS = lib qpb fpm zebra bgpd ripd ripngd ospfd ospf6d ldpd \ DIST_SUBDIRS = lib qpb fpm zebra bgpd ripd ripngd ospfd ospf6d ldpd \
isisd watchfrr vtysh ospfclient doc m4 pkgsrc redhat tests \ isisd watchfrr vtysh ospfclient doc m4 pkgsrc redhat tests \
solaris pimd @LIBRFP@ @RFPTEST@ tools cumulus solaris pimd @LIBRFP@ @RFPTEST@ tools cumulus snapcraft
EXTRA_DIST = aclocal.m4 SERVICES REPORTING-BUGS \ EXTRA_DIST = aclocal.m4 SERVICES REPORTING-BUGS \
update-autotools \ update-autotools \

View File

@ -1,5 +1,5 @@
This file describes the procedure for reporting Quagga bugs. You are not This file describes the procedure for reporting FreeRangeRouting bugs. You are not
obliged to follow this format, but it would be great help for Quagga developers obliged to follow this format, but it would be great help for FreeRangeRouting developers
if you report a bug as described below. if you report a bug as described below.
Bugs submitted with woefully incomplete information may be summarily Bugs submitted with woefully incomplete information may be summarily
@ -9,23 +9,24 @@ additional information. Bugs may be closed after 30 days of
non-response to requests to reconfirm or supply additional non-response to requests to reconfirm or supply additional
information. information.
Report bugs http://bugzilla.quagga.net Report bugs on Github Issue Tracker at
https://github.com/freerangerouting/frr/issues
Please supply the following information: Please supply the following information:
1. Your Quagga version or if it is from git then the commit reference. 1. Your FreeRangeRouting version or if it is from git then the commit reference.
Please try to report bugs against git master or the latest release. Please try to report bugs against git master or the latest release.
2. Quagga daemons you run e.g. bgpd or ripd and full name of your OS. Any 2. FRR daemons you run e.g. bgpd or ripd and full name of your OS. Any
specific options you compiled Quagga with. specific options you compiled Quagga with.
3. Problem description. Copy and paste relative commands and their output to 3. Problem description. Copy and paste relative commands and their output to
describe your network setup e.g. "zebra>show ip route". describe your network setup e.g. "zebra>show ip route".
Please, also give your simple network layout and output of relative OS Please, also give your simple network layout and output of relative OS
commands (e.g., ifconfig (BSD) or ip (Linux)). commands (e.g., ifconfig (BSD) or ip (Linux)).
4. All Quagga configuration files you use. If you don't want to publish your 4. All FRR configuration files you use. If you don't want to publish your
network numbers change 2 middle bytes in IPv4 address to be XXX (e.g. network numbers change 2 middle bytes in IPv4 address to be XXX (e.g.
192.XXX.XXX.32/24). Similar could be done with IPv6. 192.XXX.XXX.32/24). Similar could be done with IPv6.
5. If any Quagga daemon core dumped, please, supply stack trace using the 5. If any FRR daemon core dumped, please, supply stack trace using the
following commands: host> gdb exec_file core_file , (gdb) bt . following commands: host> gdb exec_file core_file , (gdb) bt .
6. Run all Quagga daemons with full debugging on (see documentation on 6. Run all FRR daemons with full debugging on (see documentation on
debugging) and send _only_ part of logs which are relative to your problem. debugging) and send _only_ part of logs which are relative to your problem.
7. If the problem is difficult to reproduce please send a shell script to 7. If the problem is difficult to reproduce please send a shell script to
reproduce it. reproduce it.

View File

@ -171,6 +171,9 @@ bgp_bfd_deregister_peer (struct peer *peer)
if (!CHECK_FLAG(bfd_info->flags, BFD_FLAG_BFD_REG)) if (!CHECK_FLAG(bfd_info->flags, BFD_FLAG_BFD_REG))
return; return;
bfd_info->status = BFD_STATUS_DOWN;
bfd_info->last_update = bgp_clock();
bgp_bfd_peer_sendmsg(peer, ZEBRA_BFD_DEST_DEREGISTER); bgp_bfd_peer_sendmsg(peer, ZEBRA_BFD_DEST_DEREGISTER);
} }
@ -311,14 +314,14 @@ bgp_bfd_dest_update (int command, struct zclient *zclient,
prefix2str(&dp, buf[0], sizeof(buf[0])); prefix2str(&dp, buf[0], sizeof(buf[0]));
if (ifp) if (ifp)
{ {
zlog_debug("Zebra: interface %s bfd destination %s %s", zlog_debug("Zebra: vrf %d interface %s bfd destination %s %s",
ifp->name, buf[0], bfd_get_status_str(status)); vrf_id, ifp->name, buf[0], bfd_get_status_str(status));
} }
else else
{ {
prefix2str(&sp, buf[1], sizeof(buf[1])); prefix2str(&sp, buf[1], sizeof(buf[1]));
zlog_debug("Zebra: source %s bfd destination %s %s", zlog_debug("Zebra: vrf %d source %s bfd destination %s %s",
buf[1], buf[0], bfd_get_status_str(status)); vrf_id, buf[1], buf[0], bfd_get_status_str(status));
} }
} }

View File

@ -91,7 +91,7 @@ struct bgp_dump
struct thread *t_interval; struct thread *t_interval;
}; };
static int bgp_dump_unset (struct vty *vty, struct bgp_dump *bgp_dump); static int bgp_dump_unset (struct bgp_dump *bgp_dump);
static int bgp_dump_interval_func (struct thread *); static int bgp_dump_interval_func (struct thread *);
/* BGP packet dump output buffer. */ /* BGP packet dump output buffer. */
@ -657,7 +657,7 @@ bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump,
} }
/* Removing previous config */ /* Removing previous config */
bgp_dump_unset(vty, bgp_dump); bgp_dump_unset(bgp_dump);
if (interval_str) if (interval_str)
{ {
@ -696,7 +696,7 @@ bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump,
} }
static int static int
bgp_dump_unset (struct vty *vty, struct bgp_dump *bgp_dump) bgp_dump_unset (struct bgp_dump *bgp_dump)
{ {
/* Removing file name. */ /* Removing file name. */
if (bgp_dump->filename) if (bgp_dump->filename)
@ -817,7 +817,7 @@ DEFUN (no_dump_bgp_all,
break; break;
} }
return bgp_dump_unset (vty, bgp_dump_struct); return bgp_dump_unset (bgp_dump_struct);
} }
/* BGP node structure. */ /* BGP node structure. */
@ -919,6 +919,10 @@ bgp_dump_init (void)
void void
bgp_dump_finish (void) bgp_dump_finish (void)
{ {
bgp_dump_unset (&bgp_dump_all);
bgp_dump_unset (&bgp_dump_updates);
bgp_dump_unset (&bgp_dump_routes);
stream_free (bgp_dump_obuf); stream_free (bgp_dump_obuf);
bgp_dump_obuf = NULL; bgp_dump_obuf = NULL;
} }

View File

@ -40,6 +40,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "queue.h" #include "queue.h"
#include "vrf.h" #include "vrf.h"
#include "bfd.h" #include "bfd.h"
#include "sockopt.h"
#include "bgpd/bgpd.h" #include "bgpd/bgpd.h"
#include "bgpd/bgp_attr.h" #include "bgpd/bgp_attr.h"
@ -60,6 +61,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#endif #endif
/* bgpd options, we use GNU getopt library. */ /* bgpd options, we use GNU getopt library. */
#define OPTION_VTYSOCK 1000
static const struct option longopts[] = static const struct option longopts[] =
{ {
{ "daemon", no_argument, NULL, 'd'}, { "daemon", no_argument, NULL, 'd'},
@ -70,6 +72,7 @@ static const struct option longopts[] =
{ "listenon", required_argument, NULL, 'l'}, { "listenon", required_argument, NULL, 'l'},
{ "vty_addr", required_argument, NULL, 'A'}, { "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'}, { "vty_port", required_argument, NULL, 'P'},
{ "vty_socket", required_argument, NULL, OPTION_VTYSOCK },
{ "retain", no_argument, NULL, 'r'}, { "retain", no_argument, NULL, 'r'},
{ "no_kernel", no_argument, NULL, 'n'}, { "no_kernel", no_argument, NULL, 'n'},
{ "user", required_argument, NULL, 'u'}, { "user", required_argument, NULL, 'u'},
@ -112,6 +115,9 @@ static struct quagga_signal_t bgp_signals[] =
/* Configuration file and directory. */ /* Configuration file and directory. */
char config_default[] = SYSCONFDIR BGP_DEFAULT_CONFIG; char config_default[] = SYSCONFDIR BGP_DEFAULT_CONFIG;
/* VTY Socket prefix */
char vty_sock_path[MAXPATHLEN] = BGP_VTYSH_PATH;
/* Route retain mode flag. */ /* Route retain mode flag. */
static int retain_mode = 0; static int retain_mode = 0;
@ -124,6 +130,7 @@ static const char *pid_file = PATH_BGPD_PID;
/* VTY port number and address. */ /* VTY port number and address. */
int vty_port = BGP_VTY_PORT; int vty_port = BGP_VTY_PORT;
char *vty_addr = NULL; char *vty_addr = NULL;
char *vty_sock_name;
/* privileges */ /* privileges */
static zebra_capabilities_t _caps_p [] = static zebra_capabilities_t _caps_p [] =
@ -166,6 +173,7 @@ redistribution between different routing protocols.\n\n\
-l, --listenon Listen on specified address (implies -n)\n\ -l, --listenon Listen on specified address (implies -n)\n\
-A, --vty_addr Set vty's bind address\n\ -A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\ -P, --vty_port Set vty's port number\n\
--vty_socket Override vty socket path\n\
-r, --retain When program terminates, retain added route by bgpd.\n\ -r, --retain When program terminates, retain added route by bgpd.\n\
-n, --no_kernel Do not install route to kernel.\n\ -n, --no_kernel Do not install route to kernel.\n\
-u, --user User to run as\n\ -u, --user User to run as\n\
@ -196,7 +204,7 @@ sighup (void)
vty_read_config (config_file, config_default); vty_read_config (config_file, config_default);
/* Create VTY's socket */ /* Create VTY's socket */
vty_serv_sock (vty_addr, vty_port, BGP_VTYSH_PATH); vty_serv_sock (vty_addr, vty_port, vty_sock_path);
/* Try to return to normal operation. */ /* Try to return to normal operation. */
} }
@ -303,6 +311,8 @@ bgp_exit (int status)
if (zlog_default) if (zlog_default)
closezlog (zlog_default); closezlog (zlog_default);
memset (bm, 0, sizeof (*bm));
if (bgp_debug_count()) if (bgp_debug_count())
log_memstats_stderr ("bgpd"); log_memstats_stderr ("bgpd");
exit (status); exit (status);
@ -470,6 +480,9 @@ main (int argc, char **argv)
if (vty_port <= 0 || vty_port > 0xffff) if (vty_port <= 0 || vty_port > 0xffff)
vty_port = BGP_VTY_PORT; vty_port = BGP_VTY_PORT;
break; break;
case OPTION_VTYSOCK:
set_socket_path(vty_sock_path, BGP_VTYSH_PATH, optarg, sizeof (vty_sock_path));
break;
case 'r': case 'r':
retain_mode = 1; retain_mode = 1;
break; break;
@ -545,7 +558,7 @@ main (int argc, char **argv)
pid_output (pid_file); pid_output (pid_file);
/* Make bgp vty socket. */ /* Make bgp vty socket. */
vty_serv_sock (vty_addr, vty_port, BGP_VTYSH_PATH); vty_serv_sock (vty_addr, vty_port, vty_sock_path);
/* Print banner. */ /* Print banner. */
zlog_notice ("BGPd %s starting: vty@%d, bgp@%s:%d", FRR_COPYRIGHT, zlog_notice ("BGPd %s starting: vty@%d, bgp@%s:%d", FRR_COPYRIGHT,

View File

@ -4271,6 +4271,7 @@ peer_update_source_vty (struct vty *vty, const char *peer_str,
const char *source_str) const char *source_str)
{ {
struct peer *peer; struct peer *peer;
struct prefix p;
peer = peer_and_group_lookup_vty (vty, peer_str); peer = peer_and_group_lookup_vty (vty, peer_str);
if (! peer) if (! peer)
@ -4287,7 +4288,16 @@ peer_update_source_vty (struct vty *vty, const char *peer_str,
if (ret == 0) if (ret == 0)
peer_update_source_addr_set (peer, &su); peer_update_source_addr_set (peer, &su);
else else
peer_update_source_if_set (peer, source_str); {
if (str2prefix (source_str, &p))
{
vty_out (vty, "%% Invalid update-source, remove prefix length %s",
VTY_NEWLINE);
return CMD_WARNING;
}
else
peer_update_source_if_set (peer, source_str);
}
} }
else else
peer_update_source_unset (peer); peer_update_source_unset (peer);
@ -8217,11 +8227,19 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
tm = gmtime(&uptime); tm = gmtime(&uptime);
json_object_int_add(json_neigh, "lastResetTimerMsecs", (tm->tm_sec * 1000) + (tm->tm_min * 60000) + (tm->tm_hour * 3600000)); json_object_int_add(json_neigh, "lastResetTimerMsecs", (tm->tm_sec * 1000) + (tm->tm_min * 60000) + (tm->tm_hour * 3600000));
json_object_string_add(json_neigh, "lastResetDueTo", peer_down_str[(int) p->last_reset]); json_object_string_add(json_neigh, "lastResetDueTo", peer_down_str[(int) p->last_reset]);
if (p->last_reset_cause_size) if (p->last_reset == PEER_DOWN_NOTIFY_SEND ||
p->last_reset == PEER_DOWN_NOTIFY_RECEIVED)
{ {
char errorcodesubcode_hexstr[5]; char errorcodesubcode_hexstr[5];
char errorcodesubcode_str[256];
code_str = bgp_notify_code_str(p->notify.code);
subcode_str = bgp_notify_subcode_str(p->notify.code, p->notify.subcode);
sprintf(errorcodesubcode_hexstr, "%02X%02X", p->notify.code, p->notify.subcode); sprintf(errorcodesubcode_hexstr, "%02X%02X", p->notify.code, p->notify.subcode);
json_object_string_add(json_neigh, "lastErrorCodeSubcode", errorcodesubcode_hexstr); json_object_string_add(json_neigh, "lastErrorCodeSubcode", errorcodesubcode_hexstr);
snprintf(errorcodesubcode_str, 255, "%s%s", code_str, subcode_str);
json_object_string_add(json_neigh, "lastNotificationReason", errorcodesubcode_str);
} }
} }
else else

View File

@ -6723,26 +6723,27 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
} }
/* advertisement-interval */ /* advertisement-interval */
if (CHECK_FLAG (peer->config, PEER_CONFIG_ROUTEADV) if (CHECK_FLAG (peer->config, PEER_CONFIG_ROUTEADV) &&
&& peer->v_routeadv != BGP_DEFAULT_EBGP_ROUTEADV ((! peer_group_active (peer) && peer->v_routeadv != BGP_DEFAULT_EBGP_ROUTEADV) ||
&& ! peer_group_active (peer)) (peer_group_active (peer) && peer->v_routeadv != g_peer->v_routeadv)))
{ {
vty_out (vty, " neighbor %s advertisement-interval %d%s", vty_out (vty, " neighbor %s advertisement-interval %d%s",
addr, peer->v_routeadv, VTY_NEWLINE); addr, peer->v_routeadv, VTY_NEWLINE);
} }
/* timers */ /* timers */
if (CHECK_FLAG (peer->config, PEER_CONFIG_TIMER) if (CHECK_FLAG (peer->config, PEER_CONFIG_TIMER) &&
&& (peer->keepalive != BGP_DEFAULT_KEEPALIVE || peer->holdtime != BGP_DEFAULT_HOLDTIME) ((! peer_group_active (peer) && (peer->keepalive != BGP_DEFAULT_KEEPALIVE || peer->holdtime != BGP_DEFAULT_HOLDTIME)) ||
&& ! peer_group_active (peer)) (peer_group_active (peer) && (peer->keepalive != g_peer->keepalive || peer->holdtime != g_peer->holdtime))))
{ {
vty_out (vty, " neighbor %s timers %d %d%s", addr, vty_out (vty, " neighbor %s timers %d %d%s", addr,
peer->keepalive, peer->holdtime, VTY_NEWLINE); peer->keepalive, peer->holdtime, VTY_NEWLINE);
} }
if (CHECK_FLAG (peer->config, PEER_CONFIG_CONNECT) && if (CHECK_FLAG (peer->config, PEER_CONFIG_CONNECT) &&
peer->connect != BGP_DEFAULT_CONNECT_RETRY && ((! peer_group_active (peer) && peer->connect != BGP_DEFAULT_CONNECT_RETRY) ||
! peer_group_active (peer)) (peer_group_active (peer) && peer->connect != g_peer->connect)))
{ {
vty_out (vty, " neighbor %s timers connect %d%s", addr, vty_out (vty, " neighbor %s timers connect %d%s", addr,
peer->connect, VTY_NEWLINE); peer->connect, VTY_NEWLINE);

View File

@ -4,7 +4,7 @@
# builds some git commit of Quagga in some different configurations # builds some git commit of Quagga in some different configurations
# usage: buildtest.sh [commit [configurations...]] # usage: buildtest.sh [commit [configurations...]]
basecfg="--prefix=/usr --enable-user=quagga --enable-group=quagga --enable-vty-group=quagga --enable-configfile-mask=0660 --enable-logfile-mask=0640 --enable-vtysh --sysconfdir=/etc/quagga --enable-exampledir=/etc/quagga/samples --localstatedir=/var/run/quagga --libdir=/usr/lib64/quagga --enable-rtadv --disable-static --enable-isisd --enable-multipath=0 --enable-pimd --enable-werror" basecfg="--prefix=/usr --enable-user=frr --enable-group=frr --enable-vty-group=frr --enable-configfile-mask=0660 --enable-logfile-mask=0640 --enable-vtysh --sysconfdir=/etc/frr --enable-exampledir=/etc/frr/samples --localstatedir=/var/run/frr --libdir=/usr/lib64/frr --enable-rtadv --disable-static --enable-isisd --enable-multipath=0 --enable-pimd --enable-werror"
configs_base="gcc|$basecfg" configs_base="gcc|$basecfg"
@ -36,7 +36,7 @@ trap errfunc ERR
COMMITREF="$1" COMMITREF="$1"
COMMITISH="`git rev-list --max-count=1 ${COMMITREF:-HEAD}`" COMMITISH="`git rev-list --max-count=1 ${COMMITREF:-HEAD}`"
TEMP="`mktemp -t -d quaggabuild.XXXXXX`" TEMP="`mktemp -t -d frrbuild.XXXXXX`"
BASE="`pwd`" BASE="`pwd`"
CONFIGS="$2" CONFIGS="$2"

View File

@ -30,9 +30,9 @@ Q_PROTOBUF_SRCS = $(Q_PROTOBUF_CFILES) $(Q_PROTOBUF_HFILES)
# #
# Information about how to link to various libraries. # Information about how to link to various libraries.
# #
Q_QUAGGA_PB_CLIENT_LDOPTS = $(top_srcdir)/qpb/libquagga_pb.la $(Q_PROTOBUF_C_CLIENT_LDOPTS) Q_FRR_PB_CLIENT_LDOPTS = $(top_srcdir)/qpb/libfrr_pb.la $(Q_PROTOBUF_C_CLIENT_LDOPTS)
Q_FPM_PB_CLIENT_LDOPTS = $(top_srcdir)/fpm/libfpm_pb.la $(Q_QUAGGA_PB_CLIENT_LDOPTS) Q_FPM_PB_CLIENT_LDOPTS = $(top_srcdir)/fpm/libfpm_pb.la $(Q_FRR_PB_CLIENT_LDOPTS)
endif # HAVE_PROTOBUF endif # HAVE_PROTOBUF

View File

@ -493,6 +493,7 @@ dnl -----------------------------------
if test "x${EXTRAVERSION}" != "x" ; then if test "x${EXTRAVERSION}" != "x" ; then
VERSION="${VERSION}${EXTRAVERSION}" VERSION="${VERSION}${EXTRAVERSION}"
PACKAGE_VERSION="${PACKAGE_VERSION}${EXTRAVERSION}" PACKAGE_VERSION="${PACKAGE_VERSION}${EXTRAVERSION}"
AC_SUBST(PACKAGE_EXTRAVERSION, ["${EXTRAVERSION}"])
PACKAGE_STRING="${PACKAGE_STRING}${EXTRAVERSION}" PACKAGE_STRING="${PACKAGE_STRING}${EXTRAVERSION}"
fi fi
@ -1694,6 +1695,8 @@ AC_CONFIG_FILES([Makefile lib/Makefile qpb/Makefile zebra/Makefile ripd/Makefile
pkgsrc/Makefile pkgsrc/Makefile
fpm/Makefile fpm/Makefile
redhat/frr.spec redhat/frr.spec
snapcraft/Makefile
snapcraft/snapcraft.yaml
lib/version.h lib/version.h
doc/defines.texi doc/defines.texi
doc/bgpd.8 doc/bgpd.8

39
debian/README.Debian vendored
View File

@ -14,39 +14,26 @@ available forcing you to explicitly type "apt-get install frr" to upgrade it.
* What is frr? * What is frr?
================= =================
http://www.freerangerouting.net/ http://www.freerangerouting.org/
> Frr is a routing software suite, providing implementations of OSPFv2, FRR is a routing software suite, providing implementations of OSPFv2,
> OSPFv3, RIP v1 and v2, RIPv3 and BGPv4 for Unix platforms, particularly OSPFv3, RIP v1 and v2, RIPng, ISIS, PIM, BGP and LDP for Unix platforms, particularly
> FreeBSD and Linux and also NetBSD, to mention a few. Frr is a fork of GNU FreeBSD and Linux and also NetBSD, to mention a few. FRR is a fork of Quagga
> Zebra which was developed by Kunihiro Ishiguro. Development of GNU Zebra which itself is a fork of Zebra.
> slowed dramatically to the point where eventually GNU Zebra was forked into Zebra was developed by Kunihiro Ishiguro.
> Frr.
> The Frr tree is an attempt to provide a zebra tree with at least the
> bug-fixes, which have accumulated, applied, while tracking any significant
> changes made to the zebra.org tree. Ultimately, this tree hopes to revitalise
> development of this code base.
I packaged zebra-pj which was then renamed to frr to get people used to it
and offer Debian users the choice which versions they like to use. I hope this
brings frr some feedback and helps it evolving to a good successor of the
orphaned zebra.
-- Christian Hammers <ch@debian.org>, Jul/Aug 2003
* Why has SNMP support been disabled? * Why has SNMP support been disabled?
===================================== =====================================
Frr used to link against the NetSNMP libraries to provide SNMP FRR used to link against the NetSNMP libraries to provide SNMP
support. Those libraries sadly link against the OpenSSL libraries support. Those libraries sadly link against the OpenSSL libraries
to provide crypto support for SNMPv3 among others. to provide crypto support for SNMPv3 among others.
OpenSSL now is not compatible with the GNU GENERAL PUBLIC LICENSE (GPL) OpenSSL now is not compatible with the GNU GENERAL PUBLIC LICENSE (GPL)
licence that Frr is distributed under. For more explanation read: licence that FRR is distributed under. For more explanation read:
http://www.gnome.org/~markmc/openssl-and-the-gpl.html http://www.gnome.org/~markmc/openssl-and-the-gpl.html
http://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs http://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs
Updating the licence to explecitly allow linking against OpenSSL Updating the licence to explecitly allow linking against OpenSSL
would requite the affirmation of all people that ever contributed would requite the affirmation of all people that ever contributed
a significant part to Zebra or Frr and thus are the collective a significant part to Zebra / Quagga or FRR and thus are the collective
"copyright holder". That's too much work. Using a shrinked down "copyright holder". That's too much work. Using a shrinked down
version of NetSNMP without OpenSSL or convincing the NetSNMP people version of NetSNMP without OpenSSL or convincing the NetSNMP people
to change to GnuTLS are maybe good solutions but not reachable to change to GnuTLS are maybe good solutions but not reachable
@ -55,7 +42,7 @@ during the last days before the Sarge release :-(
*BUT* *BUT*
It is allowed by the used licence mix that you fetch the sources and It is allowed by the used licence mix that you fetch the sources and
build Frr yourself with SNMP with build FRR yourself with SNMP with
<remove the "grep ^smux" block at the end of debian/frr.preinst> <remove the "grep ^smux" block at the end of debian/frr.preinst>
# export WANT_SNMP=1 # export WANT_SNMP=1
# apt-get -b source frr # apt-get -b source frr
@ -73,9 +60,9 @@ Default is not to start anything, since it can hose your
system's routing table if not set up properly. system's routing table if not set up properly.
Priorities were suggested by Dancer <dancer@zeor.simegen.com>. Priorities were suggested by Dancer <dancer@zeor.simegen.com>.
They're used to start the Frr daemons in more than one step They're used to start the FRR daemons in more than one step
(for example start one or two at network initialization and the (for example start one or two at network initialization and the
rest later). The number of Frr daemons being small, priorities rest later). The number of FRR daemons being small, priorities
must be between 1 and 9, inclusive (or the initscript has to be must be between 1 and 9, inclusive (or the initscript has to be
changed). /etc/init.d/frr then can be started as changed). /etc/init.d/frr then can be started as
@ -99,7 +86,7 @@ If this message occurs the receive buffer should be increased by adding the
following to /etc/sysctl.conf and "--nl-bufsize" to /etc/frr/debian.conf. following to /etc/sysctl.conf and "--nl-bufsize" to /etc/frr/debian.conf.
> net.core.rmem_default = 262144 > net.core.rmem_default = 262144
> net.core.rmem_max = 262144 > net.core.rmem_max = 262144
See message #4525 from 2005-05-09 in the frr-users mailing list. See message #4525 from 2005-05-09 in the quagga-users mailing list.
* vtysh immediately exists: * vtysh immediately exists:

2
debian/changelog vendored
View File

@ -2,6 +2,8 @@ frr (2.1) Released; urgency=medium
* Switchover to FRR * Switchover to FRR
-- frr <frr@lists.nox.tf> Mon, 23 Jan 2017 16:30:22 -0400
quagga (0.99.24+cl3u5) RELEASED; urgency=medium quagga (0.99.24+cl3u5) RELEASED; urgency=medium
* Closes: CM-12846 - Resolve Memory leaks in 'show ip bgp neighbor json' * Closes: CM-12846 - Resolve Memory leaks in 'show ip bgp neighbor json'

4
debian/copyright vendored
View File

@ -1,7 +1,7 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Frr Upstream-Name: Frr
Upstream-Contact: maintainers@freerangerouting.net, security@freerangerouting.net Upstream-Contact: maintainers@freerangerouting.org, security@freerangerouting.org
Source: http://www.freerangerouting.net/ Source: http://www.freerangerouting.org/
Files: * Files: *
Copyright: 1996-2003 by the original Zebra authors: Copyright: 1996-2003 by the original Zebra authors:

View File

@ -7,7 +7,7 @@
@setfilename frr.info @setfilename frr.info
@c Set variables - sourced from defines.texi @c Set variables - sourced from defines.texi
@include defines.texi @include defines.texi
@settitle @uref{http://www.freerangerouting.net,,@value{PACKAGE_NAME}} @settitle @uref{http://www.freerangerouting.org,,@value{PACKAGE_NAME}}
@c %**end of header @c %**end of header
@c automake will automatically generate version.texi @c automake will automatically generate version.texi
@ -48,16 +48,16 @@ This file documents the Frr Software Routing Suite which manages common
TCP/IP routing protocols. TCP/IP routing protocols.
This is Edition @value{EDITION}, last updated @value{UPDATED} of This is Edition @value{EDITION}, last updated @value{UPDATED} of
@cite{The Frr Manual}, for @uref{http://www.freerangerouting.net/,,@value{PACKAGE_NAME}} @cite{The Frr Manual}, for @uref{http://www.freerangerouting.org/,,@value{PACKAGE_NAME}}
Version @value{VERSION}. Version @value{VERSION}.
@insertcopying @insertcopying
@end ifinfo @end ifinfo
@titlepage @titlepage
@title @uref{http://www.freerangerouting.net,,Frr} @title @uref{http://www.freerangerouting.org,,Frr}
@subtitle A routing software package for TCP/IP networks @subtitle A routing software package for TCP/IP networks
@subtitle @uref{http://www.freerangerouting.net,,@value{PACKAGE_NAME}} @value{VERSION} @subtitle @uref{http://www.freerangerouting.org,,@value{PACKAGE_NAME}} @value{VERSION}
@subtitle @value{UPDATED-MONTH} @subtitle @value{UPDATED-MONTH}
@author @value{AUTHORS} @author @value{AUTHORS}
@ -72,9 +72,9 @@ Version @value{VERSION}.
@node Top @node Top
@top Frr -- With Virtual Network Control @top Frr -- With Virtual Network Control
@uref{http://www.freerangerouting.net,,Frr} is an advanced routing software package @uref{http://www.freerangerouting.org,,Frr} is an advanced routing software package
that provides a suite of TCP/IP based routing protocols. This is the Manual that provides a suite of TCP/IP based routing protocols. This is the Manual
for @value{PACKAGE_STRING}. @uref{http://www.freerangerouting.net,,Frr} is a fork of for @value{PACKAGE_STRING}. @uref{http://www.freerangerouting.org,,Frr} is a fork of
@uref{http://www.quagga.net,,Quagga}. @uref{http://www.quagga.net,,Quagga}.
@insertcopying @insertcopying

View File

@ -2,7 +2,7 @@
@chapter Overview @chapter Overview
@cindex Overview @cindex Overview
@uref{http://www.freerangerouting.net,,Frr} is a routing software package that @uref{http://www.freerangerouting.org,,Frr} is a routing software package that
provides TCP/IP based routing services with routing protocols support such provides TCP/IP based routing services with routing protocols support such
as RIPv1, RIPv2, RIPng, OSPFv2, OSPFv3, IS-IS, BGP-4, and BGP-4+ (@pxref{Supported as RIPv1, RIPv2, RIPng, OSPFv2, OSPFv3, IS-IS, BGP-4, and BGP-4+ (@pxref{Supported
RFCs}). Frr also supports special BGP Route Reflector and Route Server RFCs}). Frr also supports special BGP Route Reflector and Route Server
@ -275,12 +275,12 @@ November 1995.}
The official Frr web-site is located at: The official Frr web-site is located at:
@uref{http://www.freerangerouting.net/} @uref{http://www.freerangerouting.org/}
and contains further information, as well as links to additional and contains further information, as well as links to additional
resources. resources.
@uref{http://www.freerangerouting.net/,Frr} is a fork of Quagga, whose @uref{http://www.freerangerouting.org/,Frr} is a fork of Quagga, whose
web-site is located at: web-site is located at:
@uref{http://www.quagga.net/}. @uref{http://www.quagga.net/}.
@ -298,7 +298,7 @@ comments or suggestions to Frr, please subscribe to:
@uref{http://lists.nox.tf/listinfo/frr-users}. @uref{http://lists.nox.tf/listinfo/frr-users}.
The @uref{http://www.freerangerouting.net/,,Frr} site has further information on The @uref{http://www.freerangerouting.org/,,Frr} site has further information on
the available mailing lists, see: the available mailing lists, see:
@uref{http://lists.nox.tf/lists.php} @uref{http://lists.nox.tf/lists.php}

View File

@ -38,6 +38,7 @@
#include "plist.h" #include "plist.h"
#include "zclient.h" #include "zclient.h"
#include "vrf.h" #include "vrf.h"
#include "sockopt.h"
#include "qobj.h" #include "qobj.h"
#include "isisd/dict.h" #include "isisd/dict.h"
@ -81,6 +82,7 @@ struct zebra_privs_t isisd_privs = {
}; };
/* isisd options */ /* isisd options */
#define OPTION_VTYSOCK 1000
struct option longopts[] = { struct option longopts[] = {
{"daemon", no_argument, NULL, 'd'}, {"daemon", no_argument, NULL, 'd'},
{"config_file", required_argument, NULL, 'f'}, {"config_file", required_argument, NULL, 'f'},
@ -88,6 +90,7 @@ struct option longopts[] = {
{"socket", required_argument, NULL, 'z'}, {"socket", required_argument, NULL, 'z'},
{"vty_addr", required_argument, NULL, 'A'}, {"vty_addr", required_argument, NULL, 'A'},
{"vty_port", required_argument, NULL, 'P'}, {"vty_port", required_argument, NULL, 'P'},
{"vty_socket", required_argument, NULL, OPTION_VTYSOCK},
{"user", required_argument, NULL, 'u'}, {"user", required_argument, NULL, 'u'},
{"group", required_argument, NULL, 'g'}, {"group", required_argument, NULL, 'g'},
{"version", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'v'},
@ -103,6 +106,9 @@ char *config_file = NULL;
/* isisd program name. */ /* isisd program name. */
char *progname; char *progname;
/* VTY Socket prefix */
char vty_sock_path[MAXPATHLEN] = ISIS_VTYSH_PATH;
int daemon_mode = 0; int daemon_mode = 0;
/* Master of threads. */ /* Master of threads. */
@ -144,6 +150,7 @@ Daemon which manages IS-IS routing\n\n\
-z, --socket Set path of zebra socket\n\ -z, --socket Set path of zebra socket\n\
-A, --vty_addr Set vty's bind address\n\ -A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\ -P, --vty_port Set vty's port number\n\
--vty_socket Override vty socket path\n\
-u, --user User to run as\n\ -u, --user User to run as\n\
-g, --group Group to run as\n\ -g, --group Group to run as\n\
-v, --version Print program version\n\ -v, --version Print program version\n\
@ -305,6 +312,9 @@ main (int argc, char **argv, char **envp)
vty_port = atoi (optarg); vty_port = atoi (optarg);
vty_port = (vty_port ? vty_port : ISISD_VTY_PORT); vty_port = (vty_port ? vty_port : ISISD_VTY_PORT);
break; break;
case OPTION_VTYSOCK:
set_socket_path(vty_sock_path, ISIS_VTYSH_PATH, optarg, sizeof (vty_sock_path));
break;
case 'u': case 'u':
isisd_privs.user = optarg; isisd_privs.user = optarg;
break; break;
@ -379,7 +389,7 @@ main (int argc, char **argv, char **envp)
pid_output (pid_file); pid_output (pid_file);
/* Make isis vty socket. */ /* Make isis vty socket. */
vty_serv_sock (vty_addr, vty_port, ISIS_VTYSH_PATH); vty_serv_sock (vty_addr, vty_port, vty_sock_path);
/* Print banner. */ /* Print banner. */
zlog_notice ("Quagga-ISISd %s starting: vty@%d", FRR_VERSION, vty_port); zlog_notice ("Quagga-ISISd %s starting: vty@%d", FRR_VERSION, vty_port);

View File

@ -610,12 +610,32 @@ parse_tlvs (char *areatag, u_char * stream, int size, u_int32_t * expected,
if (!tlvs->te_ipv4_reachs) if (!tlvs->te_ipv4_reachs)
tlvs->te_ipv4_reachs = list_new (); tlvs->te_ipv4_reachs = list_new ();
listnode_add (tlvs->te_ipv4_reachs, te_ipv4_reach); listnode_add (tlvs->te_ipv4_reachs, te_ipv4_reach);
/* this trickery is permitable since no subtlvs are defined */
value_len += 5 + ((te_ipv4_reach->control & 0x3F) ? /* Metric + Control-Byte + Prefix */
((((te_ipv4_reach->control & 0x3F) - unsigned int entry_len = 5 + PSIZE(te_ipv4_reach->control & 0x3F);
1) >> 3) + 1) : 0); value_len += entry_len;
pnt += 5 + ((te_ipv4_reach->control & 0x3F) ? pnt += entry_len;
((((te_ipv4_reach->control & 0x3F) - 1) >> 3) + 1) : 0);
if (te_ipv4_reach->control & TE_IPV4_HAS_SUBTLV)
{
if (length <= value_len)
{
zlog_warn("ISIS-TLV (%s): invalid IPv4 extended reachability SubTLV missing",
areatag);
retval = ISIS_WARNING;
break;
}
u_char subtlv_len = *pnt;
value_len += subtlv_len + 1;
pnt += subtlv_len + 1;
if (length < value_len)
{
zlog_warn("ISIS-TLV (%s): invalid IPv4 extended reachability SubTLVs have oversize",
areatag);
retval = ISIS_WARNING;
break;
}
}
} }
} }
@ -682,6 +702,27 @@ parse_tlvs (char *areatag, u_char * stream, int size, u_int32_t * expected,
prefix_octets = ((ipv6_reach->prefix_len + 7) / 8); prefix_octets = ((ipv6_reach->prefix_len + 7) / 8);
value_len += prefix_octets + 6; value_len += prefix_octets + 6;
pnt += prefix_octets + 6; pnt += prefix_octets + 6;
if (ipv6_reach->control_info & CTRL_INFO_SUBTLVS)
{
if (length <= value_len)
{
zlog_warn("ISIS-TLV (%s): invalid IPv6 extended reachability SubTLV missing",
areatag);
retval = ISIS_WARNING;
break;
}
u_char subtlv_len = *pnt;
value_len += subtlv_len + 1;
pnt += subtlv_len + 1;
if (length < value_len)
{
zlog_warn("ISIS-TLV (%s): invalid IPv6 extended reachability SubTLVs have oversize",
areatag);
retval = ISIS_WARNING;
break;
}
}
/* FIXME: sub-tlvs */ /* FIXME: sub-tlvs */
if (!tlvs->ipv6_reachs) if (!tlvs->ipv6_reachs)
tlvs->ipv6_reachs = list_new (); tlvs->ipv6_reachs = list_new ();
@ -752,6 +793,9 @@ parse_tlvs (char *areatag, u_char * stream, int size, u_int32_t * expected,
pnt += length; pnt += length;
break; break;
} }
/* Abort Parsing if error occured */
if (retval != ISIS_OK)
return retval;
} }
return retval; return retval;

View File

@ -223,7 +223,7 @@ struct te_ipv4_reachability
u_char prefix_start; /* since this is variable length by nature it only */ u_char prefix_start; /* since this is variable length by nature it only */
}; /* points to an approximate location */ }; /* points to an approximate location */
#define TE_IPV4_HAS_SUBTLV (0x40)
struct idrp_info struct idrp_info
{ {

View File

@ -51,28 +51,28 @@ control_init(void)
memset(&s_un, 0, sizeof(s_un)); memset(&s_un, 0, sizeof(s_un));
s_un.sun_family = AF_UNIX; s_un.sun_family = AF_UNIX;
strlcpy(s_un.sun_path, LDPD_SOCKET, sizeof(s_un.sun_path)); strlcpy(s_un.sun_path, ctl_sock_path, sizeof(s_un.sun_path));
if (unlink(LDPD_SOCKET) == -1) if (unlink(ctl_sock_path) == -1)
if (errno != ENOENT) { if (errno != ENOENT) {
log_warn("%s: unlink %s", __func__, LDPD_SOCKET); log_warn("%s: unlink %s", __func__, ctl_sock_path);
close(fd); close(fd);
return (-1); return (-1);
} }
old_umask = umask(S_IXUSR|S_IXGRP|S_IWOTH|S_IROTH|S_IXOTH); old_umask = umask(S_IXUSR|S_IXGRP|S_IWOTH|S_IROTH|S_IXOTH);
if (bind(fd, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) { if (bind(fd, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) {
log_warn("%s: bind: %s", __func__, LDPD_SOCKET); log_warn("%s: bind: %s", __func__, ctl_sock_path);
close(fd); close(fd);
umask(old_umask); umask(old_umask);
return (-1); return (-1);
} }
umask(old_umask); umask(old_umask);
if (chmod(LDPD_SOCKET, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) == -1) { if (chmod(ctl_sock_path, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) == -1) {
log_warn("%s: chmod", __func__); log_warn("%s: chmod", __func__);
close(fd); close(fd);
(void)unlink(LDPD_SOCKET); (void)unlink(ctl_sock_path);
return (-1); return (-1);
} }
@ -97,7 +97,7 @@ control_cleanup(void)
{ {
accept_del(control_fd); accept_del(control_fd);
close(control_fd); close(control_fd);
unlink(LDPD_SOCKET); unlink(ctl_sock_path);
} }
/* ARGSUSED */ /* ARGSUSED */

View File

@ -809,9 +809,9 @@ ldp_vty_connect(struct imsgbuf *ibuf)
memset(&s_un, 0, sizeof(s_un)); memset(&s_un, 0, sizeof(s_un));
s_un.sun_family = AF_UNIX; s_un.sun_family = AF_UNIX;
strlcpy(s_un.sun_path, LDPD_SOCKET, sizeof(s_un.sun_path)); strlcpy(s_un.sun_path, ctl_sock_path, sizeof(s_un.sun_path));
if (connect(ctl_sock, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) { if (connect(ctl_sock, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) {
log_warn("%s: connect: %s", __func__, LDPD_SOCKET); log_warn("%s: connect: %s", __func__, ctl_sock_path);
close(ctl_sock); close(ctl_sock);
return (-1); return (-1);
} }

View File

@ -40,11 +40,12 @@
#include "zclient.h" #include "zclient.h"
#include "vrf.h" #include "vrf.h"
#include "filter.h" #include "filter.h"
#include "sockopt.h"
#include "qobj.h" #include "qobj.h"
static void ldpd_shutdown(void); static void ldpd_shutdown(void);
static pid_t start_child(enum ldpd_process, char *, int, int, static pid_t start_child(enum ldpd_process, char *, int, int,
const char *, const char *); const char *, const char *, const char *);
static int main_dispatch_ldpe(struct thread *); static int main_dispatch_ldpe(struct thread *);
static int main_dispatch_lde(struct thread *); static int main_dispatch_lde(struct thread *);
static int main_imsg_send_ipc_sockets(struct imsgbuf *, static int main_imsg_send_ipc_sockets(struct imsgbuf *,
@ -116,7 +117,15 @@ struct zebra_privs_t ldpd_privs =
.cap_num_i = 0 .cap_num_i = 0
}; };
/* VTY Socket prefix */
char vty_sock_path[MAXPATHLEN] = LDP_VTYSH_PATH;
/* CTL Socket path */
char ctl_sock_path[MAXPATHLEN] = LDPD_SOCKET;
/* LDPd options. */ /* LDPd options. */
#define OPTION_VTYSOCK 1000
#define OPTION_CTLSOCK 1001
static struct option longopts[] = static struct option longopts[] =
{ {
{ "daemon", no_argument, NULL, 'd'}, { "daemon", no_argument, NULL, 'd'},
@ -127,6 +136,8 @@ static struct option longopts[] =
{ "help", no_argument, NULL, 'h'}, { "help", no_argument, NULL, 'h'},
{ "vty_addr", required_argument, NULL, 'A'}, { "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'}, { "vty_port", required_argument, NULL, 'P'},
{ "vty_socket", required_argument, NULL, OPTION_VTYSOCK},
{ "ctl_socket", required_argument, NULL, OPTION_CTLSOCK},
{ "user", required_argument, NULL, 'u'}, { "user", required_argument, NULL, 'u'},
{ "group", required_argument, NULL, 'g'}, { "group", required_argument, NULL, 'g'},
{ "version", no_argument, NULL, 'v'}, { "version", no_argument, NULL, 'v'},
@ -149,6 +160,8 @@ Daemon which manages LDP.\n\n\
-z, --socket Set path of zebra socket\n\ -z, --socket Set path of zebra socket\n\
-A, --vty_addr Set vty's bind address\n\ -A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\ -P, --vty_port Set vty's port number\n\
--vty_socket Override vty socket path\n\
--ctl_socket Override ctl socket path\n\
-u, --user User to run as\n\ -u, --user User to run as\n\
-g, --group Group to run as\n\ -g, --group Group to run as\n\
-v, --version Print program version\n\ -v, --version Print program version\n\
@ -213,6 +226,8 @@ main(int argc, char *argv[])
char *p; char *p;
char *vty_addr = NULL; char *vty_addr = NULL;
int vty_port = LDP_VTY_PORT; int vty_port = LDP_VTY_PORT;
char *ctl_sock_custom_path = NULL;
char *ctl_sock_name;
int daemon_mode = 0; int daemon_mode = 0;
const char *user = NULL; const char *user = NULL;
const char *group = NULL; const char *group = NULL;
@ -273,6 +288,28 @@ main(int argc, char *argv[])
if (vty_port <= 0 || vty_port > 0xffff) if (vty_port <= 0 || vty_port > 0xffff)
vty_port = LDP_VTY_PORT; vty_port = LDP_VTY_PORT;
break; break;
case OPTION_VTYSOCK:
set_socket_path(vty_sock_path, LDP_VTYSH_PATH, optarg, sizeof (vty_sock_path));
break;
case OPTION_CTLSOCK:
ctl_sock_name = strrchr(LDPD_SOCKET, '/');
if (ctl_sock_name)
/* skip '/' */
ctl_sock_name++;
else
/*
* LDPD_SOCKET configured as relative path
* during config? Should really never happen for
* sensible config
*/
ctl_sock_name = (char *)LDPD_SOCKET;
ctl_sock_custom_path = optarg;
strlcpy(ctl_sock_path, ctl_sock_custom_path,
sizeof(ctl_sock_path));
strlcat(ctl_sock_path, "/", sizeof(ctl_sock_path));
strlcat(ctl_sock_path, ctl_sock_name,
sizeof(ctl_sock_path));
break;
case 'u': case 'u':
user = optarg; user = optarg;
break; break;
@ -319,7 +356,7 @@ main(int argc, char *argv[])
if (lflag) if (lflag)
lde(user, group); lde(user, group);
else if (eflag) else if (eflag)
ldpe(user, group); ldpe(user, group, ctl_sock_path);
master = thread_master_create(); master = thread_master_create();
@ -374,9 +411,11 @@ main(int argc, char *argv[])
/* start children */ /* start children */
lde_pid = start_child(PROC_LDE_ENGINE, saved_argv0, lde_pid = start_child(PROC_LDE_ENGINE, saved_argv0,
pipe_parent2lde[1], pipe_parent2lde_sync[1], user, group); pipe_parent2lde[1], pipe_parent2lde_sync[1],
user, group, ctl_sock_custom_path);
ldpe_pid = start_child(PROC_LDP_ENGINE, saved_argv0, ldpe_pid = start_child(PROC_LDP_ENGINE, saved_argv0,
pipe_parent2ldpe[1], pipe_parent2ldpe_sync[1], user, group); pipe_parent2ldpe[1], pipe_parent2ldpe_sync[1],
user, group, ctl_sock_custom_path);
/* drop privileges */ /* drop privileges */
if (user) if (user)
@ -436,7 +475,7 @@ main(int argc, char *argv[])
pid_output(pid_file); pid_output(pid_file);
/* Create VTY socket */ /* Create VTY socket */
vty_serv_sock(vty_addr, vty_port, LDP_VTYSH_PATH); vty_serv_sock(vty_addr, vty_port, vty_sock_path);
/* Print banner. */ /* Print banner. */
log_notice("LDPd %s starting: vty@%d", FRR_VERSION, vty_port); log_notice("LDPd %s starting: vty@%d", FRR_VERSION, vty_port);
@ -494,9 +533,9 @@ ldpd_shutdown(void)
static pid_t static pid_t
start_child(enum ldpd_process p, char *argv0, int fd_async, int fd_sync, start_child(enum ldpd_process p, char *argv0, int fd_async, int fd_sync,
const char *user, const char *group) const char *user, const char *group, const char *ctl_sock_custom_path)
{ {
char *argv[7]; char *argv[9];
int argc = 0; int argc = 0;
pid_t pid; pid_t pid;
@ -535,6 +574,10 @@ start_child(enum ldpd_process p, char *argv0, int fd_async, int fd_sync,
argv[argc++] = (char *)"-g"; argv[argc++] = (char *)"-g";
argv[argc++] = (char *)group; argv[argc++] = (char *)group;
} }
if (ctl_sock_custom_path) {
argv[argc++] = (char *)"--ctl_socket";
argv[argc++] = (char *)ctl_sock_custom_path;
}
argv[argc++] = NULL; argv[argc++] = NULL;
execvp(argv0, argv); execvp(argv0, argv);

View File

@ -715,6 +715,7 @@ int sock_set_ipv6_mcast_loop(int);
/* quagga */ /* quagga */
extern struct thread_master *master; extern struct thread_master *master;
extern char ctl_sock_path[MAXPATHLEN];
/* ldp_zebra.c */ /* ldp_zebra.c */
void ldp_zebra_init(struct thread_master *); void ldp_zebra_init(struct thread_master *);

View File

@ -99,7 +99,7 @@ static struct quagga_signal_t ldpe_signals[] =
/* label distribution protocol engine */ /* label distribution protocol engine */
void void
ldpe(const char *user, const char *group) ldpe(const char *user, const char *group, const char *ctl_path)
{ {
struct thread thread; struct thread thread;
@ -128,6 +128,7 @@ ldpe(const char *user, const char *group)
ldpe_privs.group = group; ldpe_privs.group = group;
zprivs_init(&ldpe_privs); zprivs_init(&ldpe_privs);
strlcpy(ctl_sock_path, ctl_path, sizeof(ctl_sock_path));
if (control_init() == -1) if (control_init() == -1)
fatalx("control socket setup failed"); fatalx("control socket setup failed");

View File

@ -187,7 +187,7 @@ int tlv_decode_fec_elm(struct nbr *, struct ldp_msg *, char *,
uint16_t, struct map *); uint16_t, struct map *);
/* ldpe.c */ /* ldpe.c */
void ldpe(const char *, const char *); void ldpe(const char *, const char *, const char *);
int ldpe_imsg_compose_parent(int, pid_t, void *, int ldpe_imsg_compose_parent(int, pid_t, void *,
uint16_t); uint16_t);
int ldpe_imsg_compose_lde(int, uint32_t, pid_t, void *, int ldpe_imsg_compose_lde(int, uint32_t, pid_t, void *,

View File

@ -326,6 +326,9 @@ prefix_list_get (afi_t afi, int orf, const char *name)
return plist; return plist;
} }
static void prefix_list_trie_del (struct prefix_list *plist,
struct prefix_list_entry *pentry);
/* Delete prefix-list from prefix_list_master and free it. */ /* Delete prefix-list from prefix_list_master and free it. */
static void static void
prefix_list_delete (struct prefix_list *plist) prefix_list_delete (struct prefix_list *plist)
@ -339,6 +342,7 @@ prefix_list_delete (struct prefix_list *plist)
for (pentry = plist->head; pentry; pentry = next) for (pentry = plist->head; pentry; pentry = next)
{ {
next = pentry->next; next = pentry->next;
prefix_list_trie_del (plist, pentry);
prefix_list_entry_free (pentry); prefix_list_entry_free (pentry);
plist->count--; plist->count--;
} }

View File

@ -251,7 +251,8 @@ zprivs_caps_init (struct zebra_privs_t *zprivs)
} }
/* we have caps, we have no need to ever change back the original user */ /* we have caps, we have no need to ever change back the original user */
if (zprivs_state.zuid) /* only change uid if we don't have the correct one */
if ((zprivs_state.zuid) && (zprivs_state.zsuid != zprivs_state.zuid))
{ {
if ( setreuid (zprivs_state.zuid, zprivs_state.zuid) ) if ( setreuid (zprivs_state.zuid, zprivs_state.zuid) )
{ {
@ -531,7 +532,8 @@ zprivs_caps_init (struct zebra_privs_t *zprivs)
/* we have caps, we have no need to ever change back the original user /* we have caps, we have no need to ever change back the original user
* change real, effective and saved to the specified user. * change real, effective and saved to the specified user.
*/ */
if (zprivs_state.zuid) /* only change uid if we don't have the correct one */
if ((zprivs_state.zuid) && (zprivs_state.zsuid != zprivs_state.zuid))
{ {
if ( setreuid (zprivs_state.zuid, zprivs_state.zuid) ) if ( setreuid (zprivs_state.zuid, zprivs_state.zuid) )
{ {
@ -602,7 +604,8 @@ zprivs_caps_terminate (void)
int int
zprivs_change_uid (zebra_privs_ops_t op) zprivs_change_uid (zebra_privs_ops_t op)
{ {
if (zprivs_state.zsuid == zprivs_state.zuid)
return 0;
if (op == ZPRIVS_RAISE) if (op == ZPRIVS_RAISE)
return seteuid (zprivs_state.zsuid); return seteuid (zprivs_state.zsuid);
else if (op == ZPRIVS_LOWER) else if (op == ZPRIVS_LOWER)
@ -766,7 +769,8 @@ zprivs_init(struct zebra_privs_t *zprivs)
} }
} }
if (ngroups) /* add groups only if we changed uid - otherwise skip */
if ((ngroups) && (zprivs_state.zsuid != zprivs_state.zuid))
{ {
if ( setgroups (ngroups, groups) ) if ( setgroups (ngroups, groups) )
{ {
@ -776,7 +780,8 @@ zprivs_init(struct zebra_privs_t *zprivs)
} }
} }
if (zprivs_state.zgid) /* change gid only if we changed uid - otherwise skip */
if ((zprivs_state.zgid) && (zprivs_state.zsuid != zprivs_state.zuid))
{ {
/* change group now, forever. uid we do later */ /* change group now, forever. uid we do later */
if ( setregid (zprivs_state.zgid, zprivs_state.zgid) ) if ( setregid (zprivs_state.zgid, zprivs_state.zgid) )
@ -797,7 +802,8 @@ zprivs_init(struct zebra_privs_t *zprivs)
* This is not worth that much security wise, but all we can do. * This is not worth that much security wise, but all we can do.
*/ */
zprivs_state.zsuid = geteuid(); zprivs_state.zsuid = geteuid();
if ( zprivs_state.zuid ) /* only change uid if we don't have the correct one */
if (( zprivs_state.zuid ) && (zprivs_state.zsuid != zprivs_state.zuid))
{ {
if ( setreuid (-1, zprivs_state.zuid) ) if ( setreuid (-1, zprivs_state.zuid) )
{ {
@ -824,7 +830,8 @@ zprivs_terminate (struct zebra_privs_t *zprivs)
#ifdef HAVE_CAPABILITIES #ifdef HAVE_CAPABILITIES
zprivs_caps_terminate(); zprivs_caps_terminate();
#else /* !HAVE_CAPABILITIES */ #else /* !HAVE_CAPABILITIES */
if (zprivs_state.zuid) /* only change uid if we don't have the correct one */
if ((zprivs_state.zuid) && (zprivs_state.zsuid != zprivs_state.zuid))
{ {
if ( setreuid (zprivs_state.zuid, zprivs_state.zuid) ) if ( setreuid (zprivs_state.zuid, zprivs_state.zuid) )
{ {

View File

@ -29,6 +29,29 @@
#include "sockopt.h" #include "sockopt.h"
#include "sockunion.h" #include "sockunion.h"
/* Replace the path of given defaultpath with newpath, but keep filename */
void
set_socket_path (char *path, const char *defaultpath, char *newpath, int maxsize)
{
const char *sock_name;
sock_name = strrchr(defaultpath, '/');
if (sock_name)
/* skip '/' */
sock_name++;
else
/*
* VTYSH_PATH configured as relative path
* during config? Should really never happen for
* sensible config
*/
sock_name = defaultpath;
strlcpy (path, newpath, maxsize);
strlcat (path, "/", maxsize);
strlcat (path, sock_name, maxsize);
}
void void
setsockopt_so_recvbuf (int sock, int size) setsockopt_so_recvbuf (int sock, int size)
{ {

View File

@ -24,6 +24,10 @@
#include "sockunion.h" #include "sockunion.h"
/* Override (vty) socket paths, but keep the filename */
extern void set_socket_path (char *path, const char *defaultpath,
char *newpath, int maxsize);
extern void setsockopt_so_recvbuf (int sock, int size); extern void setsockopt_so_recvbuf (int sock, int size);
extern void setsockopt_so_sendbuf (const int sock, int size); extern void setsockopt_so_sendbuf (const int sock, int size);
extern int getsockopt_so_sendbuf (const int sock); extern int getsockopt_so_sendbuf (const int sock);

View File

@ -2022,7 +2022,10 @@ vty_serv_un (const char *path)
zprivs_get_ids(&ids); zprivs_get_ids(&ids);
if (ids.gid_vty > 0) /* Hack: ids.gid_vty is actually a uint, but we stored -1 in it
earlier for the case when we don't need to chown the file
type casting it here to make a compare */
if ((int)ids.gid_vty > 0)
{ {
/* set group of socket */ /* set group of socket */
if ( chown (path, -1, ids.gid_vty) ) if ( chown (path, -1, ids.gid_vty) )

View File

@ -39,6 +39,7 @@
#include "zclient.h" #include "zclient.h"
#include "vrf.h" #include "vrf.h"
#include "bfd.h" #include "bfd.h"
#include "sockopt.h"
#include "ospf6d.h" #include "ospf6d.h"
#include "ospf6_top.h" #include "ospf6_top.h"
@ -51,6 +52,9 @@
/* Default configuration file name for ospf6d. */ /* Default configuration file name for ospf6d. */
#define OSPF6_DEFAULT_CONFIG "ospf6d.conf" #define OSPF6_DEFAULT_CONFIG "ospf6d.conf"
/* VTY Socket prefix */
char vty_sock_path[MAXPATHLEN] = OSPF6_VTYSH_PATH;
/* Default port values. */ /* Default port values. */
#define OSPF6_VTY_PORT 2606 #define OSPF6_VTY_PORT 2606
@ -78,6 +82,7 @@ struct zebra_privs_t ospf6d_privs =
}; };
/* ospf6d options, we use GNU getopt library. */ /* ospf6d options, we use GNU getopt library. */
#define OPTION_VTYSOCK 1000
struct option longopts[] = struct option longopts[] =
{ {
{ "daemon", no_argument, NULL, 'd'}, { "daemon", no_argument, NULL, 'd'},
@ -86,6 +91,7 @@ struct option longopts[] =
{ "socket", required_argument, NULL, 'z'}, { "socket", required_argument, NULL, 'z'},
{ "vty_addr", required_argument, NULL, 'A'}, { "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'}, { "vty_port", required_argument, NULL, 'P'},
{ "vty_socket", required_argument, NULL, OPTION_VTYSOCK},
{ "user", required_argument, NULL, 'u'}, { "user", required_argument, NULL, 'u'},
{ "group", required_argument, NULL, 'g'}, { "group", required_argument, NULL, 'g'},
{ "version", no_argument, NULL, 'v'}, { "version", no_argument, NULL, 'v'},
@ -125,6 +131,7 @@ Daemon which manages OSPF version 3.\n\n\
-z, --socket Set path of zebra socket\n\ -z, --socket Set path of zebra socket\n\
-A, --vty_addr Set vty's bind address\n\ -A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\ -P, --vty_port Set vty's port number\n\
--vty_socket Override vty socket path\n\
-u, --user User to run as\n\ -u, --user User to run as\n\
-g, --group Group to run as\n\ -g, --group Group to run as\n\
-v, --version Print program version\n\ -v, --version Print program version\n\
@ -285,6 +292,9 @@ main (int argc, char *argv[], char *envp[])
if (vty_port <= 0 || vty_port > 0xffff) if (vty_port <= 0 || vty_port > 0xffff)
vty_port = OSPF6_VTY_PORT; vty_port = OSPF6_VTY_PORT;
break; break;
case OPTION_VTYSOCK:
set_socket_path(vty_sock_path, OSPF6_VTYSH_PATH, optarg, sizeof (vty_sock_path));
break;
case 'u': case 'u':
ospf6d_privs.user = optarg; ospf6d_privs.user = optarg;
break; break;
@ -357,7 +367,7 @@ main (int argc, char *argv[], char *envp[])
/* Make ospf6 vty socket. */ /* Make ospf6 vty socket. */
if (!vty_port) if (!vty_port)
vty_port = OSPF6_VTY_PORT; vty_port = OSPF6_VTY_PORT;
vty_serv_sock (vty_addr, vty_port, OSPF6_VTYSH_PATH); vty_serv_sock (vty_addr, vty_port, vty_sock_path);
/* Print start message */ /* Print start message */
zlog_notice ("OSPF6d (Quagga-%s ospf6d-%s) starts: vty@%d", zlog_notice ("OSPF6d (Quagga-%s ospf6d-%s) starts: vty@%d",

View File

@ -41,6 +41,7 @@
#include "sigevent.h" #include "sigevent.h"
#include "zclient.h" #include "zclient.h"
#include "vrf.h" #include "vrf.h"
#include "sockopt.h"
#include "ospfd/ospfd.h" #include "ospfd/ospfd.h"
#include "ospfd/ospf_interface.h" #include "ospfd/ospf_interface.h"
@ -79,6 +80,7 @@ struct zebra_privs_t ospfd_privs =
char config_default[100]; char config_default[100];
/* OSPFd options. */ /* OSPFd options. */
#define OPTION_VTYSOCK 1000
struct option longopts[] = struct option longopts[] =
{ {
{ "daemon", no_argument, NULL, 'd'}, { "daemon", no_argument, NULL, 'd'},
@ -90,6 +92,7 @@ struct option longopts[] =
{ "help", no_argument, NULL, 'h'}, { "help", no_argument, NULL, 'h'},
{ "vty_addr", required_argument, NULL, 'A'}, { "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'}, { "vty_port", required_argument, NULL, 'P'},
{ "vty_socket", required_argument, NULL, OPTION_VTYSOCK},
{ "user", required_argument, NULL, 'u'}, { "user", required_argument, NULL, 'u'},
{ "group", required_argument, NULL, 'g'}, { "group", required_argument, NULL, 'g'},
{ "apiserver", no_argument, NULL, 'a'}, { "apiserver", no_argument, NULL, 'a'},
@ -99,6 +102,9 @@ struct option longopts[] =
/* OSPFd program name */ /* OSPFd program name */
/* VTY Socket prefix */
char vty_sock_path[MAXPATHLEN] = OSPF_VTYSH_PATH;
/* Master of threads. */ /* Master of threads. */
struct thread_master *master; struct thread_master *master;
@ -126,6 +132,7 @@ Daemon which manages OSPF.\n\n\
-z, --socket Set path of zebra socket\n\ -z, --socket Set path of zebra socket\n\
-A, --vty_addr Set vty's bind address\n\ -A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\ -P, --vty_port Set vty's port number\n\
--vty_socket Override vty socket path\n\
-u, --user User to run as\n\ -u, --user User to run as\n\
-g, --group Group to run as\n\ -g, --group Group to run as\n\
-a. --apiserver Enable OSPF apiserver\n\ -a. --apiserver Enable OSPF apiserver\n\
@ -253,6 +260,9 @@ main (int argc, char **argv)
if (vty_port <= 0 || vty_port > 0xffff) if (vty_port <= 0 || vty_port > 0xffff)
vty_port = OSPF_VTY_PORT; vty_port = OSPF_VTY_PORT;
break; break;
case OPTION_VTYSOCK:
set_socket_path(vty_sock_path, OSPF_VTYSH_PATH, optarg, sizeof (vty_sock_path));
break;
case 'u': case 'u':
ospfd_privs.user = optarg; ospfd_privs.user = optarg;
break; break;
@ -357,19 +367,48 @@ main (int argc, char **argv)
exit (1); exit (1);
} }
/* Create VTY socket */ /* Create PID file */
if (instance) if (instance)
{ {
sprintf(pid_file, "%s/ospfd-%d.pid", DAEMON_VTY_DIR, instance); char pidfile_temp[100];
sprintf(vty_path, "%s/ospfd-%d.vty", DAEMON_VTY_DIR, instance);
} /* Override the single file with file including instance
else number in case of multi-instance */
{ if (strrchr(pid_file, '/') != NULL)
strcpy(vty_path, OSPF_VTYSH_PATH); /* cut of pid_file at last / char * to get directory */
*strrchr(pid_file, '/') = '\0';
else
/* pid_file contains no directory - should never happen, but deal with it anyway */
/* throw-away all pid_file and assume it's only the filename */
pid_file[0] = '\0';
snprintf(pidfile_temp, sizeof(pidfile_temp), "%s/ospfd-%d.pid", pid_file, instance );
strncpy(pid_file, pidfile_temp, sizeof(pid_file));
} }
/* Process id file create. */ /* Process id file create. */
pid_output (pid_file); pid_output (pid_file);
/* Create VTY socket */
if (instance)
{
/* Multi-Instance. Use only path section of vty_sock_path with new file incl instance */
if (strrchr(vty_sock_path, '/') != NULL)
{
/* cut of pid_file at last / char * to get directory */
*strrchr(vty_sock_path, '/') = '\0';
}
else
{
/* pid_file contains no directory - should never happen, but deal with it anyway */
/* throw-away all pid_file and assume it's only the filename */
vty_sock_path[0] = '\0';
}
snprintf(vty_path, sizeof(vty_path), "%s/ospfd-%d.vty", vty_sock_path, instance );
}
else
{
strcpy(vty_path, vty_sock_path);
}
vty_serv_sock (vty_addr, vty_port, vty_path); vty_serv_sock (vty_addr, vty_port, vty_path);
/* Print banner. */ /* Print banner. */

View File

@ -38,6 +38,7 @@
#include "prefix.h" #include "prefix.h"
#include "plist.h" #include "plist.h"
#include "vrf.h" #include "vrf.h"
#include "sockopt.h"
#include "pimd.h" #include "pimd.h"
#include "pim_version.h" #include "pim_version.h"
@ -51,18 +52,25 @@ extern struct host host;
char config_default[] = SYSCONFDIR PIMD_DEFAULT_CONFIG; char config_default[] = SYSCONFDIR PIMD_DEFAULT_CONFIG;
/* pimd options */
#define OPTION_VTYSOCK 1000
struct option longopts[] = { struct option longopts[] = {
{ "daemon", no_argument, NULL, 'd'}, { "daemon", no_argument, NULL, 'd'},
{ "config_file", required_argument, NULL, 'f'}, { "config_file", required_argument, NULL, 'f'},
{ "pid_file", required_argument, NULL, 'i'}, { "pid_file", required_argument, NULL, 'i'},
{ "socket", required_argument, NULL, 'z'},
{ "vty_addr", required_argument, NULL, 'A'}, { "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'}, { "vty_port", required_argument, NULL, 'P'},
{ "vty_socket", required_argument, NULL, OPTION_VTYSOCK},
{ "version", no_argument, NULL, 'v'}, { "version", no_argument, NULL, 'v'},
{ "debug_zclient", no_argument, NULL, 'Z'}, { "debug_zclient", no_argument, NULL, 'Z'},
{ "help", no_argument, NULL, 'h'}, { "help", no_argument, NULL, 'h'},
{ 0 } { 0 }
}; };
/* VTY Socket prefix */
char vty_sock_path[MAXPATHLEN] = PIM_VTYSH_PATH;
/* pimd privileges */ /* pimd privileges */
zebra_capabilities_t _caps_p [] = zebra_capabilities_t _caps_p [] =
{ {
@ -103,6 +111,7 @@ Daemon which manages PIM.\n\n\
-z, --socket Set path of zebra socket\n\ -z, --socket Set path of zebra socket\n\
-A, --vty_addr Set vty's bind address\n\ -A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\ -P, --vty_port Set vty's port number\n\
--vty_socket Override vty socket path\n\
-v, --version Print program version\n\ -v, --version Print program version\n\
-h, --help Display this help and exit\n\ -h, --help Display this help and exit\n\
\n\ \n\
@ -163,6 +172,9 @@ int main(int argc, char** argv, char** envp) {
case 'P': case 'P':
vty_port = atoi (optarg); vty_port = atoi (optarg);
break; break;
case OPTION_VTYSOCK:
set_socket_path(vty_sock_path, PIM_VTYSH_PATH, optarg, sizeof (vty_sock_path));
break;
case 'v': case 'v':
printf(PIMD_PROGNAME " version %s\n", PIMD_VERSION); printf(PIMD_PROGNAME " version %s\n", PIMD_VERSION);
print_version(progname); print_version(progname);
@ -228,7 +240,7 @@ int main(int argc, char** argv, char** envp) {
/* Create pimd VTY socket */ /* Create pimd VTY socket */
if (vty_port < 0) if (vty_port < 0)
vty_port = PIMD_VTY_PORT; vty_port = PIMD_VTY_PORT;
vty_serv_sock(vty_addr, vty_port, PIM_VTYSH_PATH); vty_serv_sock(vty_addr, vty_port, vty_sock_path);
zlog_notice("Quagga %s " PIMD_PROGNAME " %s starting, VTY interface at port TCP %d", zlog_notice("Quagga %s " PIMD_PROGNAME " %s starting, VTY interface at port TCP %d",
FRR_VERSION, PIMD_VERSION, vty_port); FRR_VERSION, PIMD_VERSION, vty_port);

View File

@ -5,8 +5,8 @@ AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib $(Q
PROTOBUF_INCLUDES=-I$(top_srcdir) PROTOBUF_INCLUDES=-I$(top_srcdir)
PROTOBUF_PACKAGE = qpb PROTOBUF_PACKAGE = qpb
lib_LTLIBRARIES = libquagga_pb.la lib_LTLIBRARIES = libfrr_pb.la
libquagga_pb_la_LDFLAGS = -version-info 0:0:0 libfrr_pb_la_LDFLAGS = -version-info 0:0:0
if HAVE_PROTOBUF if HAVE_PROTOBUF
protobuf_srcs = \ protobuf_srcs = \
@ -16,14 +16,14 @@ protobuf_srcs_nodist = \
qpb.pb-c.c qpb.pb-c.c
endif endif
libquagga_pb_la_SOURCES = \ libfrr_pb_la_SOURCES = \
linear_allocator.h \ linear_allocator.h \
qpb.h \ qpb.h \
qpb.c \ qpb.c \
qpb_allocator.h \ qpb_allocator.h \
$(protobuf_srcs) $(protobuf_srcs)
nodist_libquagga_pb_la_SOURCES = $(protobuf_srcs_nodist) nodist_libfrr_pb_la_SOURCES = $(protobuf_srcs_nodist)
CLEANFILES = $(Q_CLEANFILES) CLEANFILES = $(Q_CLEANFILES)
BUILT_SOURCES = $(Q_PROTOBUF_SRCS) BUILT_SOURCES = $(Q_PROTOBUF_SRCS)

View File

@ -1 +1 @@
Protobuf definitions and code that is applicable to all of quagga. Protobuf definitions and code that is applicable to all of Quagga/FRR.

View File

@ -21,7 +21,7 @@
*/ */
/* /*
* Protobuf definitions pertaining to the Quagga Protobuf component. * Protobuf definitions pertaining to the Quagga/FRR Protobuf component.
*/ */
package qpb; package qpb;

View File

@ -24,7 +24,7 @@
*/ */
/* /*
* Header file for quagga protobuf memory management code. * Header file for Quagga/FRR protobuf memory management code.
*/ */
#ifndef _QPB_ALLOCATOR_H_ #ifndef _QPB_ALLOCATOR_H_

View File

@ -570,10 +570,10 @@ rm -rf %{buildroot}
%endif %endif
%changelog %changelog
* Fri Jan 6 2017 Martin Winter <mwinter@opensourcerouting.org> * Fri Jan 6 2017 Martin Winter <mwinter@opensourcerouting.org> - %{version}
- Renamed to frr for FreeRangeRouting fork of Quagga - Renamed to frr for FreeRangeRouting fork of Quagga
* Thu Feb 11 2016 Paul Jakma <paul@jakma.org> - %{version} * Thu Feb 11 2016 Paul Jakma <paul@jakma.org>
- remove with_ipv6 conditionals, always build v6 - remove with_ipv6 conditionals, always build v6
- Fix UTF-8 char in spec changelog - Fix UTF-8 char in spec changelog
- remove quagga.pam.stack, long deprecated. - remove quagga.pam.stack, long deprecated.

View File

@ -35,10 +35,12 @@
#include "sigevent.h" #include "sigevent.h"
#include "zclient.h" #include "zclient.h"
#include "vrf.h" #include "vrf.h"
#include "sockopt.h"
#include "ripd/ripd.h" #include "ripd/ripd.h"
/* ripd options. */ /* ripd options. */
#define OPTION_VTYSOCK 1000
static struct option longopts[] = static struct option longopts[] =
{ {
{ "daemon", no_argument, NULL, 'd'}, { "daemon", no_argument, NULL, 'd'},
@ -49,6 +51,7 @@ static struct option longopts[] =
{ "dryrun", no_argument, NULL, 'C'}, { "dryrun", no_argument, NULL, 'C'},
{ "vty_addr", required_argument, NULL, 'A'}, { "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'}, { "vty_port", required_argument, NULL, 'P'},
{ "vty_socket", required_argument, NULL, OPTION_VTYSOCK},
{ "retain", no_argument, NULL, 'r'}, { "retain", no_argument, NULL, 'r'},
{ "user", required_argument, NULL, 'u'}, { "user", required_argument, NULL, 'u'},
{ "group", required_argument, NULL, 'g'}, { "group", required_argument, NULL, 'g'},
@ -85,6 +88,9 @@ char *config_file = NULL;
/* ripd program name */ /* ripd program name */
/* VTY Socket prefix */
char vty_sock_path[MAXPATHLEN] = RIP_VTYSH_PATH;
/* Route retain mode flag. */ /* Route retain mode flag. */
int retain_mode = 0; int retain_mode = 0;
@ -116,6 +122,7 @@ Daemon which manages RIP version 1 and 2.\n\n\
-z, --socket Set path of zebra socket\n\ -z, --socket Set path of zebra socket\n\
-A, --vty_addr Set vty's bind address\n\ -A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\ -P, --vty_port Set vty's port number\n\
--vty_socket Override vty socket path\n\
-C, --dryrun Check configuration for validity and exit\n\ -C, --dryrun Check configuration for validity and exit\n\
-r, --retain When program terminates, retain added route by ripd.\n\ -r, --retain When program terminates, retain added route by ripd.\n\
-u, --user User to run as\n\ -u, --user User to run as\n\
@ -142,7 +149,7 @@ sighup (void)
vty_read_config (config_file, config_default); vty_read_config (config_file, config_default);
/* Create VTY's socket */ /* Create VTY's socket */
vty_serv_sock (vty_addr, vty_port, RIP_VTYSH_PATH); vty_serv_sock (vty_addr, vty_port, vty_sock_path);
/* Try to return to normal operation. */ /* Try to return to normal operation. */
} }
@ -251,6 +258,9 @@ main (int argc, char **argv)
if (vty_port <= 0 || vty_port > 0xffff) if (vty_port <= 0 || vty_port > 0xffff)
vty_port = RIP_VTY_PORT; vty_port = RIP_VTY_PORT;
break; break;
case OPTION_VTYSOCK:
set_socket_path(vty_sock_path, RIP_VTYSH_PATH, optarg, sizeof (vty_sock_path));
break;
case 'r': case 'r':
retain_mode = 1; retain_mode = 1;
break; break;
@ -311,7 +321,7 @@ main (int argc, char **argv)
pid_output (pid_file); pid_output (pid_file);
/* Create VTY's socket */ /* Create VTY's socket */
vty_serv_sock (vty_addr, vty_port, RIP_VTYSH_PATH); vty_serv_sock (vty_addr, vty_port, vty_sock_path);
/* Print banner. */ /* Print banner. */
zlog_notice ("RIPd %s starting: vty@%d", FRR_VERSION, vty_port); zlog_notice ("RIPd %s starting: vty@%d", FRR_VERSION, vty_port);

View File

@ -36,6 +36,7 @@
#include "privs.h" #include "privs.h"
#include "sigevent.h" #include "sigevent.h"
#include "vrf.h" #include "vrf.h"
#include "sockopt.h"
#include "ripngd/ripngd.h" #include "ripngd/ripngd.h"
@ -44,6 +45,7 @@ char config_default[] = SYSCONFDIR RIPNG_DEFAULT_CONFIG;
char *config_file = NULL; char *config_file = NULL;
/* RIPngd options. */ /* RIPngd options. */
#define OPTION_VTYSOCK 1000
struct option longopts[] = struct option longopts[] =
{ {
{ "daemon", no_argument, NULL, 'd'}, { "daemon", no_argument, NULL, 'd'},
@ -54,6 +56,7 @@ struct option longopts[] =
{ "help", no_argument, NULL, 'h'}, { "help", no_argument, NULL, 'h'},
{ "vty_addr", required_argument, NULL, 'A'}, { "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'}, { "vty_port", required_argument, NULL, 'P'},
{ "vty_socket", required_argument, NULL, OPTION_VTYSOCK},
{ "retain", no_argument, NULL, 'r'}, { "retain", no_argument, NULL, 'r'},
{ "user", required_argument, NULL, 'u'}, { "user", required_argument, NULL, 'u'},
{ "group", required_argument, NULL, 'g'}, { "group", required_argument, NULL, 'g'},
@ -87,6 +90,9 @@ struct zebra_privs_t ripngd_privs =
/* RIPngd program name */ /* RIPngd program name */
/* VTY Socket prefix */
char vty_sock_path[MAXPATHLEN] = RIPNG_VTYSH_PATH;
/* Route retain mode flag. */ /* Route retain mode flag. */
int retain_mode = 0; int retain_mode = 0;
@ -118,6 +124,7 @@ Daemon which manages RIPng.\n\n\
-z, --socket Set path of zebra socket\n\ -z, --socket Set path of zebra socket\n\
-A, --vty_addr Set vty's bind address\n\ -A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\ -P, --vty_port Set vty's port number\n\
--vty_socket Override vty socket path\n\
-r, --retain When program terminates, retain added route by ripngd.\n\ -r, --retain When program terminates, retain added route by ripngd.\n\
-u, --user User to run as\n\ -u, --user User to run as\n\
-g, --group Group to run as\n\ -g, --group Group to run as\n\
@ -141,7 +148,7 @@ sighup (void)
/* Reload config file. */ /* Reload config file. */
vty_read_config (config_file, config_default); vty_read_config (config_file, config_default);
/* Create VTY's socket */ /* Create VTY's socket */
vty_serv_sock (vty_addr, vty_port, RIPNG_VTYSH_PATH); vty_serv_sock (vty_addr, vty_port, vty_sock_path);
/* Try to return to normal operation. */ /* Try to return to normal operation. */
} }
@ -249,6 +256,9 @@ main (int argc, char **argv)
if (vty_port <= 0 || vty_port > 0xffff) if (vty_port <= 0 || vty_port > 0xffff)
vty_port = RIPNG_VTY_PORT; vty_port = RIPNG_VTY_PORT;
break; break;
case OPTION_VTYSOCK:
set_socket_path(vty_sock_path, RIPNG_VTYSH_PATH, optarg, sizeof (vty_sock_path));
break;
case 'r': case 'r':
retain_mode = 1; retain_mode = 1;
break; break;
@ -303,7 +313,7 @@ main (int argc, char **argv)
} }
/* Create VTY socket */ /* Create VTY socket */
vty_serv_sock (vty_addr, vty_port, RIPNG_VTYSH_PATH); vty_serv_sock (vty_addr, vty_port, vty_sock_path);
/* Process id file create. */ /* Process id file create. */
pid_output (pid_file); pid_output (pid_file);

6
snapcraft/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
snapcraft.yaml
parts
prime
stage
quagga*.snap
!*/Makefile

11
snapcraft/Makefile.am Normal file
View File

@ -0,0 +1,11 @@
EXTRA_DIST = snapcraft.yaml \
scripts/Makefile scripts/zebra-service scripts/bgpd-service \
scripts/isisd-service scripts/ripd-service scripts/ripngd-service \
scripts/ospf6d-service scripts/ospfd-service \
scripts/isisd-service scripts/pimd-service \
scripts/ldpd-service \
defaults/bgpd.conf.default defaults/isisd.conf.default \
defaults/ospf6d.conf.default defaults/ospfd.conf.default \
defaults/pimd.conf.default defaults/zebra.conf.default \
defaults/ripd.conf.default defaults/ripngd.conf.default \
defaults/ldpd.conf.default defaults/vtysh.conf.default

View File

@ -0,0 +1,93 @@
Building your own FreeRangeRouting Snap
========================================
(Tested on Ubuntu 16.04 with Snap Version 2, does not work on Ubuntu 15.x
which uses earlier versions of snaps)
1. Install snapcraft:
sudo apt-get install snapcraft
2. Checkout FreeRangeRouting under a **unpriviledged** user account
git clone https://github.com/freerangerouting/frr.git
cd frr
3. Run Bootstrap and make distribution tar.gz
./bootstrap.sh
./configure --with-pkg-extra-version=-MySnapVersion
make dist
Note: configure parameters are not important for the Snap building,
except the `with-pkg-extra-version` if you want to give the Snap
a specific name to mark your own unoffical build
This will build `frr-something.tar.gz` - the distribution tar and
the snapcraft/snapcraft.yaml with the matching version number
4. Create snap
cd snapcraft
snapcraft
You should now end up with `frr_something.snap`
Installing the snap
===================
(This can be done on a different system)
1. Install snapd
sudo apt-get install snapd
2. Install self-built frr snap. (`--force-dangerous` is required to
install a unsigned self-built snap)
snap install --force-dangerous ./frr*.snap
Connect the priviledged `network-control` plug to the snap:
snap connect frr:network-control ubuntu-core:network-control
DONE.
The Snap will be auto-started and running.
Operations
==========
### FreeRangeRouting Daemons
At this time, all FreeRangeRouting daemons are auto-started.
A daemon can be stopped/started with (ie ospf6d)
systemctl stop snap.frr.ospf6d.service
systemctl start snap.frr.ospf6d.service
or disabled/enabled with
systemctl disable snap.frr.ospf6d.service
systemctl enable snap.frr.ospf6d.service
### FreeRangeRouting Commands
All the commands are prefixed with frr.
frr.vtysh -> vtysh
frr.version -> Just gives version output (zebra --version)
frr.readme -> Returns simple README with hints on using FRR
frr.bgpd-debug -> Directly start each daemon (without service)
frr.isisd-debug
frr.ospf6d-debug
frr.ospfd-debug
frr.pimd-debug
frr.ripd-debug
frr.ripngd-debug
frr.ldp-debug
frr.zebra-debug
vtysh can be accessed as frr.vtysh (Make sure you have /snap/bin in your
path). If access as `vtysh` instead of `frr.vtysh` is needed, a symlink
can be created:
sudo ln -s /snap/bin/frr.vtysh /usr/local/bin/vtysh

77
snapcraft/README.usage.md Normal file
View File

@ -0,0 +1,77 @@
Using the FreeRangeRouting Snap
===============================
After installing the Snap, the priviledged plug need to be connected:
snap connect frr:network-control ubuntu-core:network-control
Enabling/Disabling FreeRangeRouting Daemons
-------------------------------------------
By default (at this time), all FreeRangeRouting daemons will be enabled
on installation. If you want to disable a specific daemon, then use
the systemctl commands
ie for `ospf6d` (OSPFv3):
systemctl disable snap.frr.ospf6d.service
systemctl enable snap.frr.ospf6d.service
The daemons are: `ripd`, `ripngd`, `ospfd`, `ospf6d`, `isisd`, `bgpd`,
`pimd`, `zebra`
Commands defined by this snap
-----------------------------
- `frr.vtysh`:
FreeRangeRouting VTY Shell (configuration tool)
- `frr.version`:
Returns output of `zebra --version` to display version and configured
options
- `frr.readme`:
Returns this document `cat README_usage.md`
and for debugging defined at this time (May get removed later - do not
depend on them). These are mainly intended to debug the Snap
- `frr.zebra-debug`:
Starts zebra daemon in foreground
- `frr.ripd-debug`:
Starts ripd daemon in foreground
- `frr.ripngd-debug`:
Starts ripng daemon in foreground
- `frr.ospfd-debug`:
Starts ospfd daemon in foreground
- `frr.ospf6d-debug`:
Starts ospf6d daemon in foreground
- `frr.isisd-debug`:
Starts isisd daemon in foreground
- `frr.bgpd-debug`:
Starts bgpd daemon in foreground
- `frr.pimd-debug`:
Starts pimd daemon in foreground
- `frr.ldpd-debug`:
Starts ldpd daemon in foreground
FAQ
---
- frr.vtysh displays `--MORE--` on long output. How to suppress this?
- Define `VTYSH_PAGER` to `cat` (default is `more`). (Ie add
`export VTYSH_PAGER=cat` to the end of your `.profile`)
Sourcecode available
====================
The source for this SNAP is available as part of the FreeRangeRouting
Source Code Distribution.
https://github.com/freerangerouting/frr.git
Instructions for rebuilding the snap are in `README.snap_build.md`
Feedback welcome
================
Please send Feedback about this snap to Martin Winter at
`mwinter@opensourcerouting.org`

View File

View File

View File

View File

View File

View File

View File

View File

View File

@ -0,0 +1 @@
no service integrated-vtysh-config

View File

View File

@ -0,0 +1,7 @@
all:
install:
install -D -m 0755 $(DESTDIR)/usr/bin/telnet.netkit $(DESTDIR)/bin/telnet
install -D -m 0755 $(DESTDIR)/usr/bin/traceroute.db $(DESTDIR)/bin/traceroute
install -D -m 0755 $(DESTDIR)/usr/bin/traceroute6.db $(DESTDIR)/bin/traceroute6

View File

@ -0,0 +1,14 @@
all:
install:
mkdir -p $(DESTDIR)/bin
install -D -m 0755 zebra-service $(DESTDIR)/bin/
install -D -m 0755 bgpd-service $(DESTDIR)/bin/
install -D -m 0755 ospfd-service $(DESTDIR)/bin/
install -D -m 0755 ospf6d-service $(DESTDIR)/bin/
install -D -m 0755 ripd-service $(DESTDIR)/bin/
install -D -m 0755 ripngd-service $(DESTDIR)/bin/
install -D -m 0755 isisd-service $(DESTDIR)/bin/
install -D -m 0755 pimd-service $(DESTDIR)/bin/
install -D -m 0755 ldpd-service $(DESTDIR)/bin/

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e -x
if ! [ -e $SNAP_DATA/bgpd.conf ]; then
cp $SNAP/etc/frr/bgpd.conf.default $SNAP_DATA/bgpd.conf
fi
exec $SNAP/sbin/bgpd \
-f $SNAP_DATA/bgpd.conf \
--pid_file $SNAP_DATA/bgpd.pid \
--socket $SNAP_DATA/zsock \
--vty_socket $SNAP_DATA

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e -x
if ! [ -e $SNAP_DATA/isisd.conf ]; then
cp $SNAP/etc/frr/isisd.conf.default $SNAP_DATA/isisd.conf
fi
exec $SNAP/sbin/isisd \
-f $SNAP_DATA/isisd.conf \
--pid_file $SNAP_DATA/isisd.pid \
--socket $SNAP_DATA/zsock \
--vty_socket $SNAP_DATA

View File

@ -0,0 +1,14 @@
#!/bin/sh
set -e -x
if ! [ -e $SNAP_DATA/ldpd.conf ]; then
cp $SNAP/etc/frr/ldpd.conf.default $SNAP_DATA/ldpd.conf
fi
exec $SNAP/sbin/ldpd \
-f $SNAP_DATA/ldpd.conf \
--pid_file $SNAP_DATA/ldpd.pid \
--socket $SNAP_DATA/zsock \
--ctl_socket $SNAP_DATA \
--vty_socket $SNAP_DATA

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e -x
if ! [ -e $SNAP_DATA/ospf6d.conf ]; then
cp $SNAP/etc/frr/ospf6d.conf.default $SNAP_DATA/ospf6d.conf
fi
exec $SNAP/sbin/ospf6d \
-f $SNAP_DATA/ospf6d.conf \
--pid_file $SNAP_DATA/ospf6d.pid \
--socket $SNAP_DATA/zsock \
--vty_socket $SNAP_DATA

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e -x
if ! [ -e $SNAP_DATA/ospfd.conf ]; then
cp $SNAP/etc/frr/ospfd.conf.default $SNAP_DATA/ospfd.conf
fi
exec $SNAP/sbin/ospfd \
-f $SNAP_DATA/ospfd.conf \
--pid_file $SNAP_DATA/ospfd.pid \
--socket $SNAP_DATA/zsock \
--vty_socket $SNAP_DATA

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e -x
if ! [ -e $SNAP_DATA/pimd.conf ]; then
cp $SNAP/etc/frr/pimd.conf.default $SNAP_DATA/pimd.conf
fi
exec $SNAP/sbin/pimd \
-f $SNAP_DATA/pimd.conf \
--pid_file $SNAP_DATA/pimd.pid \
--socket $SNAP_DATA/zsock \
--vty_socket $SNAP_DATA

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e -x
if ! [ -e $SNAP_DATA/ripd.conf ]; then
cp $SNAP/etc/frr/ripd.conf.default $SNAP_DATA/ripd.conf
fi
exec $SNAP/sbin/ripd \
-f $SNAP_DATA/ripd.conf \
--pid_file $SNAP_DATA/ripd.pid \
--socket $SNAP_DATA/zsock \
--vty_socket $SNAP_DATA

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e -x
if ! [ -e $SNAP_DATA/ripngd.conf ]; then
cp $SNAP/etc/frr/ripngd.conf.default $SNAP_DATA/ripngd.conf
fi
exec $SNAP/sbin/ripngd \
-f $SNAP_DATA/ripngd.conf \
--pid_file $SNAP_DATA/ripngd.pid \
--socket $SNAP_DATA/zsock \
--vty_socket $SNAP_DATA

View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e -x
if ! [ -e $SNAP_DATA/zebra.conf ]; then
cp $SNAP/etc/frr/zebra.conf.default $SNAP_DATA/zebra.conf
fi
if ! [ -e $SNAP_DATA/vtysh.conf ]; then
cp $SNAP/etc/frr/vtysh.conf.default $SNAP_DATA/vtysh.conf
fi
exec $SNAP/sbin/zebra \
-f $SNAP_DATA/zebra.conf \
--pid_file $SNAP_DATA/zebra.pid \
--socket $SNAP_DATA/zsock \
--vty_socket $SNAP_DATA

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

235
snapcraft/snapcraft.yaml.in Normal file
View File

@ -0,0 +1,235 @@
name: frr
version: @VERSION@
summary: FreeRangeRouting BGP/OSPFv2/OSPFv3/ISIS/RIP/RIPng/PIM/LDP routing daemon
description: BGP/OSPFv2/OSPFv3/ISIS/RIP/RIPng/PIM routing daemon
FreeRangeRouting (FRR) is free software which manages TCP/IP based routing
protocols. It supports BGP4, BGP4+, OSPFv2, OSPFv3, IS-IS, RIPv1, RIPv2,
RIPng, PIM and LDP as well as the IPv6 versions of these.
FreeRangeRouting (frr) is a fork of Quagga.
confinement: strict
grade: devel
apps:
vtysh:
command: bin/vtysh --vty_socket $SNAP_DATA --config_dir $SNAP_DATA
plugs:
- network
- network-bind
- network-control
version:
command: sbin/zebra --version
readme:
command: bin/cat $SNAP/doc/README.usage.md
zebra:
command: bin/zebra-service
daemon: simple
plugs:
- network
- network-bind
- network-control
bgpd:
command: bin/bgpd-service
daemon: simple
plugs:
- network
- network-bind
- network-control
ospfd:
command: bin/ospfd-service
daemon: simple
plugs:
- network
- network-bind
- network-control
ospf6d:
command: bin/ospf6d-service
daemon: simple
plugs:
- network
- network-bind
- network-control
isisd:
command: bin/isisd-service
daemon: simple
plugs:
- network
- network-bind
- network-control
ripd:
command: bin/ripd-service
daemon: simple
plugs:
- network
- network-bind
- network-control
ripngd:
command: bin/ripngd-service
daemon: simple
plugs:
- network
- network-bind
- network-control
pimd:
command: bin/pimd-service
daemon: simple
plugs:
- network
- network-bind
- network-control
ldpd:
command: bin/ldpd-service
daemon: simple
plugs:
- network
- network-bind
- network-control
zebra-debug:
command: sbin/zebra -f $SNAP_DATA/zebra.conf --pid_file $SNAP_DATA/zebra.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA
plugs:
- network
- network-bind
- network-control
bgpd-debug:
command: sbin/bgpd -f $SNAP_DATA/bgpd.conf --pid_file $SNAP_DATA/bgpd.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA
plugs:
- network
- network-bind
- network-control
ospfd-debug:
command: sbin/ospfd -f $SNAP_DATA/ospfd.conf --pid_file $SNAP_DATA/ospfd.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA
plugs:
- network
- network-bind
- network-control
ospf6d-debug:
command: sbin/ospf6d -f $SNAP_DATA/ospf6d.conf --pid_file $SNAP_DATA/ospf6d.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA
plugs:
- network
- network-bind
- network-control
isisd-debug:
command: sbin/isisd -f $SNAP_DATA/isisd.conf --pid_file $SNAP_DATA/isisd.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA
plugs:
- network
- network-bind
- network-control
ripd-debug:
command: sbin/ripd -f $SNAP_DATA/ripd.conf --pid_file $SNAP_DATA/ripd.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA
plugs:
- network
- network-bind
- network-control
ripngd-debug:
command: sbin/ripngd -f $SNAP_DATA/ripngd.conf --pid_file $SNAP_DATA/ripngd.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA
plugs:
- network
- network-bind
- network-control
pimd-debug:
command: sbin/pimd -f $SNAP_DATA/pimd.conf --pid_file $SNAP_DATA/pimd.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA
plugs:
- network
- network-bind
- network-control
ldpd-debug:
command: sbin/ldpd -f $SNAP_DATA/pimd.conf --pid_file $SNAP_DATA/pimd.pid --socket $SNAP_DATA/zsock --ctl_socket $SNAP_DATA --vty_socket $SNAP_DATA
plugs:
- network
- network-bind
- network-control
parts:
frr:
build-packages:
- autoconf
- automake
- libtool
- make
- gawk
- libreadline-dev
- texinfo
- dejagnu
- libncurses5-dev
- texlive-latex-base
- texlive-generic-recommended
- libcap-dev
- imagemagick
- ghostscript
- groff
- hardening-wrapper
- libpcre3-dev
- chrpath
- pkg-config
- libjson-c-dev
stage-packages:
- coreutils
- iproute2
- logrotate
- libcap2
- libc6
- libtinfo5
- libreadline6
- libjson-c2
plugin: autotools
source: ../frr-@PACKAGE_VERSION@.tar.gz
configflags:
- --with-cflags=-g
- --with-cflags=-O0
- --with-cflags=-std=gnu99
- --with-cflags=-fpie
- --with-cflags=-fno-omit-frame-pointer
- --with-cflags=-Wall
- --enable-vtysh
- --enable-isisd
- --enable-watchfrr
- --enable-ospfclient=yes
- --enable-ospfapi=yes
- --enable-multipath=64
- --enable-rtadv
- --enable-irdp
- --enable-gcc-rdynamic
- --enable-user=root
- --enable-group=root
- --enable-pimd
- --enable-ldpd
- --enable-configfile-mask=0640
- --enable-logfile-mask=0640
- --localstatedir=/var/run
- --sbindir=/sbin
- --bindir=/bin
- --sysconfdir=/etc/frr
- --with-pkg-extra-version=@PACKAGE_EXTRAVERSION@
frr-defaults:
plugin: dump
source: defaults
organize:
zebra.conf.default: etc/frr/zebra.conf.default
bgpd.conf.default: etc/frr/bgpd.conf.default
isisd.conf.default: etc/frr/isisd.conf.default
ospf6d.conf.default: etc/frr/ospf6d.conf.default
ospfd.conf.default: etc/frr/ospfd.conf.default
pimd.conf.default: etc/frr/pimd.conf.default
ripd.conf.default: etc/frr/ripd.conf.default
ripngd.conf.default: etc/frr/ripngd.conf.default
ldpd.conf.default: etc/frr/ldpd.conf.default
vtysh.conf.default: etc/frr/vtysh.conf.default
frr-scripts:
plugin: make
source: scripts
helpers:
stage-packages:
- telnet
- traceroute
plugin: make
source: helpers
prime:
- bin/telnet
- bin/traceroute
- bin/traceroute6
docs:
plugin: dump
source: .
organize:
README.usage.md: doc/README.usage.md
README.snap_build.md: doc/README.snap_build.md

View File

@ -7,13 +7,13 @@
# the names of the various subpackages, and some convenient # the names of the various subpackages, and some convenient
# derived variables. # derived variables.
pkg_names = daemons dev doc libs smf pkg_names = daemons dev doc libs smf
pkg_quagga_daemons = zebra bgpd ospfd ospf6d ripd ripngd pkg_frr_daemons = zebra bgpd ospfd ospf6d ripd ripngd
pkg_name_rev = @PACKAGE_VERSION@-@CONFDATE@-@target_os@-@target_cpu@ pkg_name_rev = @PACKAGE_VERSION@-@CONFDATE@-@target_os@-@target_cpu@
pkg_depends = $(pkg_names:%=depend.%) pkg_depends = $(pkg_names:%=depend.%)
pkg_packages = $(pkg_names:%=@PACKAGE_TARNAME@-%-$(pkg_name_rev).pkg) pkg_packages = $(pkg_names:%=@PACKAGE_TARNAME@-%-$(pkg_name_rev).pkg)
pkg_pkginfos = $(pkg_names:%=pkginfo.%.full) pkg_pkginfos = $(pkg_names:%=pkginfo.%.full)
pkg_prototypes = $(pkg_names:%=prototype.%) pkg_prototypes = $(pkg_names:%=prototype.%)
pkg_manifests = quagga.xml pkg_manifests = frr.xml
# pkgmk variable substitutions wont grok ${variable} in prototype # pkgmk variable substitutions wont grok ${variable} in prototype
# file, so we cant let autoconf generate the file sadly # file, so we cant let autoconf generate the file sadly
@ -35,7 +35,7 @@ edit = $(SED) \
-e 's,@enable_user\@,$(enable_user),g' \ -e 's,@enable_user\@,$(enable_user),g' \
-e 's,@enable_group\@,$(enable_group),g' \ -e 's,@enable_group\@,$(enable_group),g' \
-e 's,@enable_vty_group\@,$(enable_vty_group),g' \ -e 's,@enable_vty_group\@,$(enable_vty_group),g' \
-e 's,@quagga_statedir\@,$(quagga_statedir),g' \ -e 's,@frr_statedir\@,$(frr_statedir),g' \
-e 's,[@]PACKAGE_NAME[@],@PACKAGE_NAME@,g' \ -e 's,[@]PACKAGE_NAME[@],@PACKAGE_NAME@,g' \
-e 's,[@]PACKAGE_TARNAME[@],@PACKAGE_TARNAME@,g' \ -e 's,[@]PACKAGE_TARNAME[@],@PACKAGE_TARNAME@,g' \
-e 's,[@]PACKAGE_VERSION[@],@PACKAGE_VERSION@,g' \ -e 's,[@]PACKAGE_VERSION[@],@PACKAGE_VERSION@,g' \
@ -90,15 +90,15 @@ depend.%: $(srcdir)/depend.%.in Makefile
$(edit) $< > $@ $(edit) $< > $@
# method file (bit like init script) # method file (bit like init script)
quagga.init: $(srcdir)/quagga.init.in Makefile frr.init: $(srcdir)/frr.init.in Makefile
rm -f $@ rm -f $@
$(edit) $< > $@ $(edit) $< > $@
# construct the pkg # construct the pkg
@PACKAGE_TARNAME@-%-$(pkg_name_rev).pkg: prototype.% \ @PACKAGE_TARNAME@-%-$(pkg_name_rev).pkg: prototype.% \
depend.% quagga.init pkginfo.%.full depend.% frr.init pkginfo.%.full
($(pkg_make) && \ ($(pkg_make) && \
$(pkg_trans) "QUAGGA$*") $(pkg_trans) "FRR$*")
%.pkg.gz : %.pkg %.pkg.gz : %.pkg
(gzip -c $< > $@) (gzip -c $< > $@)
@ -107,17 +107,17 @@ quagga.init: $(srcdir)/quagga.init.in Makefile
#BUILT_SOURCES = pkginfo.daemons pkginfo.dev pkginfo.doc pkginfo.libs \ #BUILT_SOURCES = pkginfo.daemons pkginfo.dev pkginfo.doc pkginfo.libs \
# prototype.daemons prototype.dev prototype.doc prototype.libs # prototype.daemons prototype.dev prototype.doc prototype.libs
BUILT_SOURCES = $(pkg_pkginfos) pkginfo.tmpl $(pkg_prototypes) \ BUILT_SOURCES = $(pkg_pkginfos) pkginfo.tmpl $(pkg_prototypes) \
$(pkg_manifests) $(pkg_depends) quagga.init $(pkg_manifests) $(pkg_depends) frr.init
CLEANFILES = $(BUILT_SOURCES) $(pkg_packages) CLEANFILES = $(BUILT_SOURCES) $(pkg_packages)
EXTRA_DIST = $(pkg_manifests:%=%.in) $(pkg_prototypes:%=%.in) \ EXTRA_DIST = $(pkg_manifests:%=%.in) $(pkg_prototypes:%=%.in) \
$(pkg_names:%=pkginfo.%.tmpl.in) $(srcdir)/pkginfo.tmpl.in \ $(pkg_names:%=pkginfo.%.tmpl.in) $(srcdir)/pkginfo.tmpl.in \
$(pkg_depends:%=%.in) quagga.init.in README.txt $(pkg_depends:%=%.in) frr.init.in README.txt
pkg-root-install: pkg-root-install:
(cd $(top_builddir) && \ (cd $(top_builddir) && \
$(MAKE) DESTDIR=$(abs_builddir)/quagga-root install) $(MAKE) DESTDIR=$(abs_builddir)/frr-root install)
packages: $(pkg_packages) packages: $(pkg_packages)

View File

@ -15,21 +15,20 @@ Requirements:
i.manifest must be at least version 1.5. Place these scripts in i.manifest must be at least version 1.5. Place these scripts in
this directory if you are using Solaris 10 GA (which does not ship with this directory if you are using Solaris 10 GA (which does not ship with
these scripts), or in the solaris/ directory in the Quagga source. these scripts), or in the solaris/ directory in the FreeRangeRouting source.
Package creation instructions: Package creation instructions:
------------------------------ ------------------------------
1. Configure and build Quagga in the top level build directory as per 1. Configure and build FreeRangeRouting (frr) in the top level build directory as per normal, eg:
normal, eg:
./configure --prefix=/usr/local/quagga \ ./configure --prefix=/usr/local/frr \
--localstatedir=/var/run/quagga --localstatedir=/var/run/frr \
--enable-gcc-rdynamic --enable-opaque-lsa --enable-ospf-te \ --enable-gcc-rdynamic --enable-opaque-lsa --enable-ospf-te \
--enable-multipath=64 --enable-user=quagga \ --enable-multipath=64 --enable-user=frr \
--enable-ospfclient=yes --enable-ospfapi=yes \ --enable-ospfclient=yes --enable-ospfapi=yes \
--enable-group=quagga --enable-nssa --enable-opaque-lsa --enable-group=frr --enable-nssa --enable-opaque-lsa
You will need /usr/sfw/bin and /usr/ccs/bin in your path. You will need /usr/sfw/bin and /usr/ccs/bin in your path.
@ -45,13 +44,13 @@ appropriate, eg:
This should result in 4 packages being created: This should result in 4 packages being created:
quagga-libs-...-$ARCH.pkg - QUAGGAlibs frr-libs-...-$ARCH.pkg - FRRlibs
quagga-daemons-...-$ARCH.pkg - QUAGGAdaemons frr-daemons-...-$ARCH.pkg - FRRdaemons
quagga-doc-...-$ARCH.pkg - QUAGGAdoc frr-doc-...-$ARCH.pkg - FRRdoc
quagga-dev-...-$ARCH.pkg - QUAGGAdev frr-dev-...-$ARCH.pkg - FRRdev
quagga-smf-...-$ARCH.pkg - QUAGGAsmf frr-smf-...-$ARCH.pkg - FRRsmf
QUAGGAlibs and QUAGGAdaemons are needed for daemon runtime. QUAGGAsmf FRRlibs and FRRdaemons are needed for daemon runtime. FRRsmf
provides the required bits for Solaris 10+ SMF support. provides the required bits for Solaris 10+ SMF support.
@ -59,7 +58,7 @@ Install and post-install configuration notes:
--------------------------------------------- ---------------------------------------------
- If you specified a user/group which does not exist per default on Solaris - If you specified a user/group which does not exist per default on Solaris
(eg quagga/quagga) you *must* create these before installing these on a (eg frr/frr) you *must* create these before installing these on a
system. The packages do *not* create the users. system. The packages do *not* create the users.
- The configuration files are not created. You must create the configuration - The configuration files are not created. You must create the configuration
@ -69,107 +68,107 @@ Install and post-install configuration notes:
password whatever password whatever
The user which quagga runs as must have write permissions on this file, no The user which frr runs as must have write permissions on this file, no
other user should have read permissions, and you would also have to enable other user should have read permissions, and you would also have to enable
the telnet interface (see below). the telnet interface (see below).
- SMF notes: - SMF notes:
- QUAGGAsmf installs a svc:/network/routing/quagga service, with an - FRRsmf installs a svc:/network/routing/frr service, with an
instance for each daemon instance for each daemon
- The state of all instances of quagga service can be inspected with: - The state of all instances of frr service can be inspected with:
svcs -l svc:/network/routing/quagga svcs -l svc:/network/routing/frr
or typically just with a shortcut of 'quagga': or typically just with a shortcut of 'frr':
svcs -l quagga svcs -l frr
- A specific instance of the quagga service can be inspected by specifying - A specific instance of the frr service can be inspected by specifying
the daemon name as the instance, ie quagga:<daemon>: the daemon name as the instance, ie frr:<daemon>:
svcs -l svc:/network/routing/quagga:zebra svcs -l svc:/network/routing/frr:zebra
svcs -l svc:/network/routing/quagga:ospfd svcs -l svc:/network/routing/frr:ospfd
<etc> <etc>
or typically just with the shortcut of 'quagga:<daemon>' or even or typically just with the shortcut of 'frr:<daemon>' or even
<daemon>: <daemon>:
svcs -l quagga:zebra svcs -l frr:zebra
svcs -l ospfd svcs -l ospfd
Eg: Eg:
# # svcs -l ripd # # svcs -l ripd
fmri svc:/network/routing/quagga:ripd fmri svc:/network/routing/frr:ripd
name Quagga: ripd, RIPv1/2 IPv4 routing protocol daemon. name FreeRangeRouting: ripd, RIPv1/2 IPv4 routing protocol daemon.
enabled true enabled true
state online state online
next_state none next_state none
state_time Wed Jun 15 16:21:02 2005 state_time Wed Jun 15 16:21:02 2005
logfile /var/svc/log/network-routing-quagga:ripd.log logfile /var/svc/log/network-routing-frr:ripd.log
restarter svc:/system/svc/restarter:default restarter svc:/system/svc/restarter:default
contract_id 93 contract_id 93
dependency require_all/restart svc:/network/routing/quagga:zebra (online) dependency require_all/restart svc:/network/routing/frr:zebra (online)
dependency require_all/restart file://localhost//usr/local/quagga/etc/ripd.conf (online) dependency require_all/restart file://localhost//usr/local/frr/etc/ripd.conf (online)
dependency require_all/none svc:/system/filesystem/usr:default (online) dependency require_all/none svc:/system/filesystem/usr:default (online)
dependency require_all/none svc:/network/loopback (online) dependency require_all/none svc:/network/loopback (online)
- Configuration of startup options is by way of SMF properties in a - Configuration of startup options is by way of SMF properties in a
property group named 'quagga'. The defaults should automatically be property group named 'frr'. The defaults should automatically be
inline with how you configured Quagga in Step 1 above. inline with how you configured FreeRangeRouting in Step 1 above.
- By default the VTY interface is disabled. To change this, see below for - By default the VTY interface is disabled. To change this, see below for
how to set the 'quagga/vty_port' property as appropriate for how to set the 'frr/vty_port' property as appropriate for
/each/ service. Also, the VTY is set to listen only to localhost by /each/ service. Also, the VTY is set to listen only to localhost by
default, you may change the 'quagga/vty_addr' property as appropriate default, you may change the 'frr/vty_addr' property as appropriate
for both of the 'quagga' service and specific individual instances of for both of the 'frr' service and specific individual instances of
the 'quagga' service (ie quagga:zebra, quagga:ospfd, etc..). the 'frr' service (ie frr:zebra, frr:ospfd, etc..).
- Properties belonging to the 'quagga' service are inherited by all - Properties belonging to the 'frr' service are inherited by all
instances. Eg: instances. Eg:
# svcprop -p quagga svc:/network/routing/quagga # svcprop -p frr svc:/network/routing/frr
quagga/group astring root frr/group astring root
quagga/retain boolean false frr/retain boolean false
quagga/user astring root frr/user astring root
quagga/vty_addr astring 127.1 frr/vty_addr astring 127.1
quagga/vty_port integer 0 frr/vty_port integer 0
# svcprop -p quagga svc:/network/routing/quagga:ospfd # svcprop -p frr svc:/network/routing/frr:ospfd
quagga/retain_routes boolean false frr/retain_routes boolean false
quagga/group astring root frr/group astring root
quagga/retain boolean false frr/retain boolean false
quagga/user astring root frr/user astring root
quagga/vty_addr astring 127.1 frr/vty_addr astring 127.1
quagga/vty_port integer 0 frr/vty_port integer 0
All instances will inherit these properties, unless the instance itself All instances will inherit these properties, unless the instance itself
overrides these defaults. This also implies one can modify properties of overrides these defaults. This also implies one can modify properties of
the 'quagga' service and have them apply to all daemons. the 'frr' service and have them apply to all daemons.
# svccfg -s svc:/network/routing/quagga \ # svccfg -s svc:/network/routing/frr \
setprop quagga/vty_addr = astring: ::1 setprop frr/vty_addr = astring: ::1
# svcprop -p quagga svc:/network/routing/quagga # svcprop -p frr svc:/network/routing/frr
quagga/group astring root frr/group astring root
quagga/retain boolean false frr/retain boolean false
quagga/user astring root frr/user astring root
quagga/vty_port integer 0 frr/vty_port integer 0
quagga/vty_addr astring ::1 frr/vty_addr astring ::1
# # You *must* refresh instances to have the property change # # You *must* refresh instances to have the property change
# # take affect for the 'running snapshot' of service state. # # take affect for the 'running snapshot' of service state.
# svcadm refresh quagga:ospfd # svcadm refresh frr:ospfd
# svcprop -p quagga svc:/network/routing/quagga:ospfd # svcprop -p frr svc:/network/routing/frr:ospfd
quagga/retain_routes boolean false frr/retain_routes boolean false
quagga/group astring root frr/group astring root
quagga/retain boolean false frr/retain boolean false
quagga/user astring root frr/user astring root
quagga/vty_port integer 0 frr/vty_port integer 0
quagga/vty_addr astring ::1 frr/vty_addr astring ::1
Other daemon-specific options/properties may be available, however they Other daemon-specific options/properties may be available, however they
are not yet honoured/used (eg ospfd/apiserver on svc:/network/ospf). are not yet honoured/used (eg ospfd/apiserver on svc:/network/ospf).
@ -177,12 +176,11 @@ Install and post-install configuration notes:
- As SMF is dependency aware, restarting network/zebra will restart all the - As SMF is dependency aware, restarting network/zebra will restart all the
other daemons. other daemons.
- To upgrade from one set of Quagga packages to a newer release, one must - To upgrade from one set of FreeRangeRouting packages to a newer release,
first pkgrm the installed packages. When one pkgrm's QUAGGAsmf all one must first pkgrm the installed packages. When one pkgrm's FRRsmf all
property configuration will be lost, and any customisations will have to property configuration will be lost, and any customisations will have to
redone after installing the updated QUAGGAsmf package. redone after installing the updated FRRsmf package.
- These packages are not supported by Sun Microsystems, report bugs via the - These packages are not supported by Sun Microsystems, report bugs via the
usual Quagga channels, ie Bugzilla. Improvements/contributions of course usual FreeRangeRouting channels, ie Issue Tracker. Improvements/contributions of course would be greatly appreciated.
would be greatly appreciated.

View File

@ -1,4 +1,4 @@
P QUAGGAlibs Quagga common runtime libraries P FRRlibs FreeRangeRouting common runtime libraries
@PACKAGE_VERSION@,REV=@CONFDATE@ @PACKAGE_VERSION@,REV=@CONFDATE@
P SUNWcsu Core Solaris, (Usr) P SUNWcsu Core Solaris, (Usr)
P SUNWcsr Core Solaris Libraries (Root) P SUNWcsr Core Solaris Libraries (Root)

View File

@ -1,2 +1,2 @@
P QUAGGAlibs Quagga common runtime libraries P FRRlibs FreeRangeRouting common runtime libraries
@PACKAGE_VERSION@,REV=@CONFDATE@ @PACKAGE_VERSION@,REV=@CONFDATE@

View File

@ -1,5 +1,5 @@
P SUNWcslr Core Solaris Libraries (Root) P SUNWcslr Core Solaris Libraries (Root)
P SUNWcsl Core Solaris, (Shared Libs) P SUNWcsl Core Solaris, (Shared Libs)
P SUNWlibmsr Math & Microtasking Libraries (Root) P SUNWlibmsr Math & Microtasking Libraries (Root)
R QUAGGAdaemons Quagga daemons R FRRdaemons FreeRangeRouting daemons
R QUAGGAdev R FRRdev

View File

@ -1,4 +1,4 @@
P QUAGGAdaemons Quagga daemons P FRRaemons FreeRangeRouting daemons
@PACKAGE_VERSION@,REV=@CONFDATE@ @PACKAGE_VERSION@,REV=@CONFDATE@
P SUNWcsu Core Solaris, (Usr) P SUNWcsu Core Solaris, (Usr)
P SUNWcsr Core Solaris Libraries (Root) P SUNWcsr Core Solaris Libraries (Root)

View File

@ -3,22 +3,22 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms. # Use is subject to license terms.
# #
# This file is part of Quagga. # This file is part of FreeRangeRouting.
# #
# Quagga is free software; you can redistribute it and/or modify it # FreeRangeRouting is free software; you can redistribute it and/or modify
# under the terms of the GNU General Public License as published by the # it under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any # Free Software Foundation; either version 2, or (at your option) any
# later version. # later version.
# #
# Quagga is distributed in the hope that it will be useful, but # FreeRangeRouting is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Quagga; see the file COPYING. If not, write to the Free # along with FreeRangeRouting; see the file COPYING. If not, write to
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# 02111-1307, USA. # Boston, MA 02111-1307, USA.
# #
# Starts/stops the given daemon # Starts/stops the given daemon
@ -74,36 +74,36 @@ handle_routeadm_upgrade () {
upgrade_config () { upgrade_config () {
DAEMON=$1 DAEMON=$1
# handle upgrade of SUNWzebra to Quagga # handle upgrade of SUNWzebra to FreeRangeRouting
if [ -d "/etc/quagga" -a ! -f "/etc/quagga/${DAEMON}.conf" ] ; then if [ -d "/etc/frr" -a ! -f "/etc/frr/${DAEMON}.conf" ] ; then
if [ -f "/etc/sfw/zebra/${DAEMON}.conf" ] ; then if [ -f "/etc/sfw/zebra/${DAEMON}.conf" ] ; then
cp "/etc/sfw/zebra/${DAEMON}.conf" \ cp "/etc/sfw/zebra/${DAEMON}.conf" \
"/etc/quagga/${DAEMON}.conf.upgrade" \ "/etc/frr/${DAEMON}.conf.upgrade" \
|| exit $SMF_EXIT_ERR_FATAL || exit $SMF_EXIT_ERR_FATAL
chown "${USER}:${GROUP}" "/etc/quagga/${DAEMON}.conf.upgrade" \ chown "${USER}:${GROUP}" "/etc/frr/${DAEMON}.conf.upgrade" \
|| exit $SMF_EXIT_ERR_FATAL || exit $SMF_EXIT_ERR_FATAL
chmod 0600 "/etc/quagga/${DAEMON}.conf.upgrade" \ chmod 0600 "/etc/frr/${DAEMON}.conf.upgrade" \
|| exit $SMF_EXIT_ERR_FATAL || exit $SMF_EXIT_ERR_FATAL
mv "/etc/quagga/${DAEMON}.conf.upgrade" "/etc/quagga/${DAEMON}.conf" \ mv "/etc/frr/${DAEMON}.conf.upgrade" "/etc/frr/${DAEMON}.conf" \
|| exit $SMF_EXIT_ERR_FATAL || exit $SMF_EXIT_ERR_FATAL
fi fi
fi fi
if [ ! -f "/etc/quagga/${DAEMON}.conf" ] ; then if [ ! -f "/etc/frr/${DAEMON}.conf" ] ; then
touch "/etc/quagga/${DAEMON}.conf.new" \ touch "/etc/frr/${DAEMON}.conf.new" \
|| exit $SMF_EXIT_ERR_FATAL || exit $SMF_EXIT_ERR_FATAL
chown "${USER}:${GROUP}" "/etc/quagga/${DAEMON}.conf.new" \ chown "${USER}:${GROUP}" "/etc/frr/${DAEMON}.conf.new" \
|| exit $SMF_EXIT_ERR_FATAL || exit $SMF_EXIT_ERR_FATAL
chmod 0600 "/etc/quagga/${DAEMON}.conf.new" \ chmod 0600 "/etc/frr/${DAEMON}.conf.new" \
|| exit $SMF_EXIT_ERR_FATAL || exit $SMF_EXIT_ERR_FATAL
mv "/etc/quagga/${DAEMON}.conf.new" "/etc/quagga/${DAEMON}.conf" \ mv "/etc/frr/${DAEMON}.conf.new" "/etc/frr/${DAEMON}.conf" \
|| exit $SMF_EXIT_ERR_FATAL || exit $SMF_EXIT_ERR_FATAL
fi fi
} }
# Relevant to S10+ # Relevant to S10+
quagga_is_globalzone () { frr_is_globalzone () {
if [ "${QUAGGA_INIT_ZONENAME:=`/sbin/zonename`}" = "global" \ if [ "${FRR_INIT_ZONENAME:=`/sbin/zonename`}" = "global" \
-o `/sbin/zonename -t` = "exclusive" ]; then -o `/sbin/zonename -t` = "exclusive" ]; then
return 0 return 0
else else
@ -188,9 +188,9 @@ case $1 in
esac esac
if smf_present ; then if smf_present ; then
QUAGGA_METHOD="start" FRR_METHOD="start"
else else
QUAGGA_METHOD="$1" FRR_METHOD="$1"
shift; shift;
fi fi
@ -208,7 +208,7 @@ case "${DAEMON}" in
bgpd) bgpd)
;; ;;
zebra | ospfd | ospf6d | ripd | ripngd ) zebra | ospfd | ospf6d | ripd | ripngd )
quagga_is_globalzone || exit $SMF_EXIT_OK frr_is_globalzone || exit $SMF_EXIT_OK
;; ;;
*) *)
usage usage
@ -216,7 +216,7 @@ case "${DAEMON}" in
;; ;;
esac esac
# Older Quagga SMF packages pass daemon args on the commandline # Older FreeRangeRouting SMF packages pass daemon args on the commandline
# Newer SMF routeadm model uses properties for each argument # Newer SMF routeadm model uses properties for each argument
# so we must handle that. # so we must handle that.
if [ smf_present -a -f "$ROUTEADMINCLUDE" ]; then if [ smf_present -a -f "$ROUTEADMINCLUDE" ]; then
@ -236,14 +236,14 @@ if [ ! -f "@sysconfdir@/${DAEMON}.conf" ] ; then
exit $SMF_EXIT_ERR_CONFIG exit $SMF_EXIT_ERR_CONFIG
fi fi
# we need @quagga_statedir@ to exist, it probably is on tmpfs. # we need @frr_statedir@ to exist, it probably is on tmpfs.
if [ ! -d @quagga_statedir@ ] ; then if [ ! -d @frr_statedir@ ] ; then
mkdir -p @quagga_statedir@ mkdir -p @frr_statedir@
chown @enable_user@:@enable_group@ @quagga_statedir@ chown @enable_user@:@enable_group@ @frr_statedir@
chmod 751 @quagga_statedir@ chmod 751 @frr_statedir@
fi fi
PIDFILE="@quagga_statedir@/${DAEMON}.pid" PIDFILE="@frr_statedir@/${DAEMON}.pid"
start () { start () {
if [ ! -x "$DAEMON_PATH/$DAEMON" ] ; then if [ ! -x "$DAEMON_PATH/$DAEMON" ] ; then
@ -259,7 +259,7 @@ stop_by_pidfile () {
fi fi
} }
case "$QUAGGA_METHOD" in case "$FRR_METHOD" in
'start') 'start')
start start
;; ;;

View File

@ -1,32 +1,32 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!-- <!--
This file is part of Quagga. This file is part of FreeRangeRouting (FRR)
Quagga is free software; you can redistribute it and/or modify it FreeRangeRouting is free software; you can redistribute it and/or
under the terms of the GNU General Public License as published by the modify it under the terms of the GNU General Public License as
Free Software Foundation; either version 2, or (at your option) any published by the Free Software Foundation; either version 2, or
later version. (at your option) anylater version.
Quagga is distributed in the hope that it will be useful, but FreeRangeRouting is distributed in the hope that it will be useful,
WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Quagga; see the file COPYING. If not, write to the Free along with FreeRangeRouting; see the file COPYING. If not, write to
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
02111-1307, USA. Boston, MA 02111-1307, USA.
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Copyright 2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms. Use is subject to license terms.
Copyright 2015 Joyent, Inc. Copyright 2015 Joyent, Inc.
ident "@(#)quagga.xml 1.0 05/03/15 SMI" ident "@(#)frr.xml 1.0 19/01/17 SMI"
--> -->
<service_bundle type='manifest' name='SUNWquagga-daemons:quagga'> <service_bundle type='manifest' name='SUNWfrr-daemons:frr'>
<service <service
name='network/routing/zebra' name='network/routing/zebra'
@ -34,7 +34,7 @@
version='1'> version='1'>
<single_instance /> <single_instance />
<instance name='quagga' enabled='false'> <instance name='frr' enabled='false'>
<dependency name='fs' <dependency name='fs'
grouping='require_all' grouping='require_all'
@ -63,7 +63,7 @@
<exec_method <exec_method
type='method' type='method'
name='start' name='start'
exec='/lib/svc/method/quagga zebra' exec='/lib/svc/method/frr zebra'
timeout_seconds='60'> timeout_seconds='60'>
<method_context> <method_context>
<method_credential <method_credential
@ -107,9 +107,9 @@
<propval name='value_authorization' type='astring' <propval name='value_authorization' type='astring'
value='solaris.smf.value.routing' /> value='solaris.smf.value.routing' />
<!-- Options common to Quagga daemons <!-- Options common to FreeRangeRouting daemons
Property names are equivalent to the long Property names are equivalent to the long
option name, consult Quagga documentation --> option name, consult FreeRangeRouting documentation -->
<!-- The config file to use, if not the default --> <!-- The config file to use, if not the default -->
<propval name='config_file' type='astring' value=''/> <propval name='config_file' type='astring' value=''/>
<!-- The vty_port to listen on if not the default. <!-- The vty_port to listen on if not the default.
@ -124,7 +124,7 @@
same name as user --> same name as user -->
<propval name='group' type='astring' value='' /> <propval name='group' type='astring' value='' />
<!-- The pidfile to use, if not the default of <!-- The pidfile to use, if not the default of
@quagga_statedir@ --> @frr_statedir@ -->
<propval name='pid_file' type='astring' value='' /> <propval name='pid_file' type='astring' value='' />
<!-- Options specific to zebra --> <!-- Options specific to zebra -->
@ -142,14 +142,14 @@
<template> <template>
<common_name> <common_name>
<loctext xml:lang='C'> <loctext xml:lang='C'>
Quagga: zebra, RIB, kernel intermediary and misc daemon FreeRangeRouting: zebra, RIB, kernel intermediary and misc daemon
</loctext> </loctext>
</common_name> </common_name>
<documentation> <documentation>
<manpage title='zebra' section='1M' <manpage title='zebra' section='1M'
manpath='@mandir@' /> manpath='@mandir@' />
<doc_link name='quagga.net' <doc_link name='freerangerouting.org'
uri='http://www.quagga.net/' /> uri='http://www.freerangerouting.org/' />
</documentation> </documentation>
</template> </template>
</instance> </instance>
@ -161,7 +161,7 @@
type='service' type='service'
version='1'> version='1'>
<instance name='quagga' enabled='false'> <instance name='frr' enabled='false'>
<dependency name='fs' <dependency name='fs'
grouping='require_all' grouping='require_all'
@ -194,13 +194,13 @@
grouping='require_all' grouping='require_all'
restart_on='restart' restart_on='restart'
type='service'> type='service'>
<service_fmri value='svc:/network/routing/zebra:quagga' /> <service_fmri value='svc:/network/routing/zebra:frr' />
</dependency> </dependency>
<exec_method <exec_method
type='method' type='method'
name='start' name='start'
exec='/lib/svc/method/quagga ripd' exec='/lib/svc/method/frr ripd'
timeout_seconds='60'> timeout_seconds='60'>
<method_context> <method_context>
<method_credential <method_credential
@ -240,7 +240,7 @@
<propval name='value_authorization' type='astring' <propval name='value_authorization' type='astring'
value='solaris.smf.value.routing' /> value='solaris.smf.value.routing' />
<!-- Options common to Quagga daemons --> <!-- Options common to FreeRangeRouting daemons -->
<!-- The config file to use, if not the default --> <!-- The config file to use, if not the default -->
<propval name='config_file' type='astring' value=''/> <propval name='config_file' type='astring' value=''/>
<!-- The vty_port to listen on if not the default. <!-- The vty_port to listen on if not the default.
@ -255,7 +255,7 @@
same name as user --> same name as user -->
<propval name='group' type='astring' value='' /> <propval name='group' type='astring' value='' />
<!-- The pidfile to use, if not the default of <!-- The pidfile to use, if not the default of
@quagga_statedir@ --> @frr_statedir@ -->
<propval name='pid_file' type='astring' value='' /> <propval name='pid_file' type='astring' value='' />
<!-- Options specific to ripd --> <!-- Options specific to ripd -->
@ -273,14 +273,14 @@
<template> <template>
<common_name> <common_name>
<loctext xml:lang='C'> <loctext xml:lang='C'>
Quagga: ripd, RIPv1/2 IPv4 routing protocol daemon. FreeRangeRouting: ripd, RIPv1/2 IPv4 routing protocol daemon.
</loctext> </loctext>
</common_name> </common_name>
<documentation> <documentation>
<manpage title='ripd' section='1M' <manpage title='ripd' section='1M'
manpath='@mandir@' /> manpath='@mandir@' />
<doc_link name='quagga.net' <doc_link name='freerangerouting.org'
uri='http://www.quagga.net/' /> uri='http://www.freerangerouting.org/' />
</documentation> </documentation>
</template> </template>
</instance> </instance>
@ -292,7 +292,7 @@
type='service' type='service'
version='1'> version='1'>
<instance name='quagga' enabled='false'> <instance name='frr' enabled='false'>
<dependency name='fs' <dependency name='fs'
grouping='require_all' grouping='require_all'
@ -325,13 +325,13 @@
grouping='require_all' grouping='require_all'
restart_on='restart' restart_on='restart'
type='service'> type='service'>
<service_fmri value='svc:/network/routing/zebra:quagga' /> <service_fmri value='svc:/network/routing/zebra:frr' />
</dependency> </dependency>
<exec_method <exec_method
type='method' type='method'
name='start' name='start'
exec='/lib/svc/method/quagga ripngd' exec='/lib/svc/method/frr ripngd'
timeout_seconds='60'> timeout_seconds='60'>
<method_context> <method_context>
<method_credential <method_credential
@ -369,7 +369,7 @@
<propval name='value_authorization' type='astring' <propval name='value_authorization' type='astring'
value='solaris.smf.value.routing' /> value='solaris.smf.value.routing' />
<!-- Options common to Quagga daemons --> <!-- Options common to frr daemons -->
<!-- The config file to use, if not the default --> <!-- The config file to use, if not the default -->
<propval name='config_file' type='astring' value=''/> <propval name='config_file' type='astring' value=''/>
<!-- The vty_port to listen on if not the default. <!-- The vty_port to listen on if not the default.
@ -384,7 +384,7 @@
same name as user --> same name as user -->
<propval name='group' type='astring' value='' /> <propval name='group' type='astring' value='' />
<!-- The pidfile to use, if not the default of <!-- The pidfile to use, if not the default of
@quagga_statedir@ --> @frr_statedir@ -->
<propval name='pid_file' type='astring' value='' /> <propval name='pid_file' type='astring' value='' />
<!-- Options specific to ripngd --> <!-- Options specific to ripngd -->
@ -402,14 +402,14 @@
<template> <template>
<common_name> <common_name>
<loctext xml:lang='C'> <loctext xml:lang='C'>
Quagga: ripngd, RIPng IPv6 routing protocol daemon. frr: ripngd, RIPng IPv6 routing protocol daemon.
</loctext> </loctext>
</common_name> </common_name>
<documentation> <documentation>
<manpage title='ripngd' section='1M' <manpage title='ripngd' section='1M'
manpath='@mandir@' /> manpath='@mandir@' />
<doc_link name='quagga.net' <doc_link name='freerangerouting.org'
uri='http://www.quagga.net/' /> uri='http://www.freerangerouting.org/' />
</documentation> </documentation>
</template> </template>
</instance> </instance>
@ -421,7 +421,7 @@
type='service' type='service'
version='1'> version='1'>
<instance name='quagga' enabled='false'> <instance name='frr' enabled='false'>
<dependency name='fs' <dependency name='fs'
grouping='require_all' grouping='require_all'
@ -454,13 +454,13 @@
grouping='require_all' grouping='require_all'
restart_on='restart' restart_on='restart'
type='service'> type='service'>
<service_fmri value='svc:/network/routing/zebra:quagga' /> <service_fmri value='svc:/network/routing/zebra:frr' />
</dependency> </dependency>
<exec_method <exec_method
type='method' type='method'
name='start' name='start'
exec='/lib/svc/method/quagga ospfd' exec='/lib/svc/method/frr ospfd'
timeout_seconds='60'> timeout_seconds='60'>
<method_context> <method_context>
<method_credential <method_credential
@ -503,7 +503,7 @@
<propval name='value_authorization' type='astring' <propval name='value_authorization' type='astring'
value='solaris.smf.value.routing' /> value='solaris.smf.value.routing' />
<!-- Options common to Quagga daemons --> <!-- Options common to frr daemons -->
<!-- The config file to use, if not the default --> <!-- The config file to use, if not the default -->
<propval name='config_file' type='astring' value=''/> <propval name='config_file' type='astring' value=''/>
<!-- The vty_port to listen on if not the default. <!-- The vty_port to listen on if not the default.
@ -518,7 +518,7 @@
same name as user --> same name as user -->
<propval name='group' type='astring' value='' /> <propval name='group' type='astring' value='' />
<!-- The pidfile to use, if not the default of <!-- The pidfile to use, if not the default of
@quagga_statedir@ --> @frr_statedir@ -->
<propval name='pid_file' type='astring' value='' /> <propval name='pid_file' type='astring' value='' />
</property_group> </property_group>
@ -533,14 +533,14 @@
<template> <template>
<common_name> <common_name>
<loctext xml:lang='C'> <loctext xml:lang='C'>
Quagga: ospfd, OSPFv2 IPv4 routing protocol daemon. frr: ospfd, OSPFv2 IPv4 routing protocol daemon.
</loctext> </loctext>
</common_name> </common_name>
<documentation> <documentation>
<manpage title='ospfd' section='1M' <manpage title='ospfd' section='1M'
manpath='@mandir@' /> manpath='@mandir@' />
<doc_link name='quagga.net' <doc_link name='freerangerouting.org'
uri='http://www.quagga.net/' /> uri='http://www.freerangerouting.org/' />
</documentation> </documentation>
</template> </template>
</instance> </instance>
@ -552,7 +552,7 @@
type='service' type='service'
version='1'> version='1'>
<instance name='quagga' enabled='false'> <instance name='frr' enabled='false'>
<dependency name='fs' <dependency name='fs'
grouping='require_all' grouping='require_all'
@ -585,13 +585,13 @@
grouping='require_all' grouping='require_all'
restart_on='restart' restart_on='restart'
type='service'> type='service'>
<service_fmri value='svc:/network/routing/zebra:quagga' /> <service_fmri value='svc:/network/routing/zebra:frr' />
</dependency> </dependency>
<exec_method <exec_method
type='method' type='method'
name='start' name='start'
exec='/lib/svc/method/quagga ospf6d' exec='/lib/svc/method/frr ospf6d'
timeout_seconds='60'> timeout_seconds='60'>
<method_context> <method_context>
<method_credential <method_credential
@ -629,7 +629,7 @@
<propval name='value_authorization' type='astring' <propval name='value_authorization' type='astring'
value='solaris.smf.value.routing' /> value='solaris.smf.value.routing' />
<!-- Options common to Quagga daemons --> <!-- Options common to frr daemons -->
<!-- The config file to use, if not the default --> <!-- The config file to use, if not the default -->
<propval name='config_file' type='astring' value=''/> <propval name='config_file' type='astring' value=''/>
<!-- The vty_port to listen on if not the default. <!-- The vty_port to listen on if not the default.
@ -644,7 +644,7 @@
same name as user --> same name as user -->
<propval name='group' type='astring' value='' /> <propval name='group' type='astring' value='' />
<!-- The pidfile to use, if not the default of <!-- The pidfile to use, if not the default of
@quagga_statedir@ --> @frr_statedir@ -->
<propval name='pid_file' type='astring' value='' /> <propval name='pid_file' type='astring' value='' />
</property_group> </property_group>
@ -659,14 +659,14 @@
<template> <template>
<common_name> <common_name>
<loctext xml:lang='C'> <loctext xml:lang='C'>
Quagga: ospf6d, OSPFv3 IPv6 routing protocol daemon. frr: ospf6d, OSPFv3 IPv6 routing protocol daemon.
</loctext> </loctext>
</common_name> </common_name>
<documentation> <documentation>
<manpage title='ospf6d' section='1M' <manpage title='ospf6d' section='1M'
manpath='@mandir@' /> manpath='@mandir@' />
<doc_link name='quagga.net' <doc_link name='freerangerouting.org'
uri='http://www.quagga.net/' /> uri='http://www.freerangerouting.org/' />
</documentation> </documentation>
</template> </template>
</instance> </instance>
@ -679,7 +679,7 @@
type='service' type='service'
version='1'> version='1'>
<instance name='quagga' enabled='false'> <instance name='frr' enabled='false'>
<dependency name='fs' <dependency name='fs'
grouping='require_all' grouping='require_all'
@ -720,13 +720,13 @@
grouping='require_all' grouping='require_all'
restart_on='restart' restart_on='restart'
type='service'> type='service'>
<service_fmri value='svc:/network/routing/zebra:quagga' /> <service_fmri value='svc:/network/routing/zebra:frr' />
</dependency> </dependency>
<exec_method <exec_method
type='method' type='method'
name='start' name='start'
exec='/lib/svc/method/quagga bgpd' exec='/lib/svc/method/frr bgpd'
timeout_seconds='60'> timeout_seconds='60'>
<method_context> <method_context>
<method_credential <method_credential
@ -771,7 +771,7 @@
<propval name='value_authorization' type='astring' <propval name='value_authorization' type='astring'
value='solaris.smf.value.routing' /> value='solaris.smf.value.routing' />
<!-- Options common to Quagga daemons. --> <!-- Options common to frr daemons. -->
<!-- The config file to use, if not the default --> <!-- The config file to use, if not the default -->
<propval name='config_file' type='astring' value=''/> <propval name='config_file' type='astring' value=''/>
<!-- The vty_port to listen on if not the default. <!-- The vty_port to listen on if not the default.
@ -786,7 +786,7 @@
same name as user --> same name as user -->
<propval name='group' type='astring' value='' /> <propval name='group' type='astring' value='' />
<!-- The pidfile to use, if not the default of <!-- The pidfile to use, if not the default of
@quagga_statedir@ --> @frr_statedir@ -->
<propval name='pid_file' type='astring' value='' /> <propval name='pid_file' type='astring' value='' />
<!-- Options specific to bgpd --> <!-- Options specific to bgpd -->
@ -812,14 +812,14 @@
<template> <template>
<common_name> <common_name>
<loctext xml:lang='C'> <loctext xml:lang='C'>
Quagga: bgpd, BGP routing protocol daemon. frr: bgpd, BGP routing protocol daemon.
</loctext> </loctext>
</common_name> </common_name>
<documentation> <documentation>
<manpage title='bgpd' section='1M' <manpage title='bgpd' section='1M'
manpath='@mandir@' /> manpath='@mandir@' />
<doc_link name='quagga.net' <doc_link name='freerangerouting.org'
uri='http://www.quagga.net/' /> uri='http://www.freerangerouting.org/' />
</documentation> </documentation>
</template> </template>
</instance> </instance>

View File

@ -1,2 +1,2 @@
PKG="QUAGGAdaemons" PKG="FRRdaemons"
NAME="@PACKAGE_NAME@ - @PACKAGE_NAME@ daemons" NAME="@PACKAGE_NAME@ - @PACKAGE_NAME@ daemons"

View File

@ -1,3 +1,3 @@
PKG=QUAGGAdev PKG=FRRdev
NAME="@PACKAGE_NAME@ - @PACKAGE_NAME@ development files" NAME="@PACKAGE_NAME@ - @PACKAGE_NAME@ development files"

View File

@ -1,2 +1,2 @@
PKG=QUAGGAdoc PKG=FRRdoc
NAME="@PACKAGE_NAME@ - @PACKAGE_NAME@ documentation" NAME="@PACKAGE_NAME@ - @PACKAGE_NAME@ documentation"

View File

@ -1,2 +1,2 @@
PKG=QUAGGAlibs PKG=FRRlibs
NAME="@PACKAGE_NAME@ - @PACKAGE_NAME@ common runtime libraries" NAME="@PACKAGE_NAME@ - @PACKAGE_NAME@ common runtime libraries"

View File

@ -1,2 +1,2 @@
PKG="QUAGGAsmf" PKG="FRRsmf"
NAME="@PACKAGE_NAME@ - @PACKAGE_NAME@ SMF support" NAME="@PACKAGE_NAME@ - @PACKAGE_NAME@ SMF support"

View File

@ -1,9 +1,9 @@
ARCH="@target_cpu@" ARCH="@target_cpu@"
CATEGORY="system" CATEGORY="system"
VERSION="@PACKAGE_VERSION@,REV=@CONFDATE@" VERSION="@PACKAGE_VERSION@,REV=@CONFDATE@"
VENDOR="http://www.quagga.net/" VENDOR="http://www.freerangerouting.org/"
HOTLINE="@PACKAGE_BUGREPORT@" HOTLINE="@PACKAGE_BUGREPORT@"
EMAIL=paul@quagga.net EMAIL=maintainers@freerangerouting.org
DESC="@PACKAGE_NAME@ Routing Protocols" DESC="@PACKAGE_NAME@ Routing Protocols"
MAXINST=1 MAXINST=1
CLASSES="none preserve renamenew manifest" CLASSES="none preserve renamenew manifest"

View File

@ -17,4 +17,4 @@ f none @sysconfdir@/ripd.conf.sample=$DESTDIR/@sysconfdir@/ripd.conf.sample 0644
f none @sysconfdir@/ripngd.conf.sample=$DESTDIR/@sysconfdir@/ripngd.conf.sample 0644 root bin f none @sysconfdir@/ripngd.conf.sample=$DESTDIR/@sysconfdir@/ripngd.conf.sample 0644 root bin
f none @sysconfdir@/ospfd.conf.sample=$DESTDIR/@sysconfdir@/ospfd.conf.sample 0644 root bin f none @sysconfdir@/ospfd.conf.sample=$DESTDIR/@sysconfdir@/ospfd.conf.sample 0644 root bin
f none @sysconfdir@/ospf6d.conf.sample=$DESTDIR/@sysconfdir@/ospf6d.conf.sample 0644 root bin f none @sysconfdir@/ospf6d.conf.sample=$DESTDIR/@sysconfdir@/ospf6d.conf.sample 0644 root bin
d none @quagga_statedir@=$DESTDIR/@quagga_statedir@ 0711 @enable_user@ @enable_group@ d none @frr_statedir@=$DESTDIR/@frr_statedir@ 0711 @enable_user@ @enable_group@

View File

@ -8,50 +8,50 @@ f none @libdir@/libospf.a=$DESTDIR/@libdir@/libospf.a 0644 root bin
f none @libdir@/libospfapiclient.la=$DESTDIR/@libdir@/libospfapiclient.la 0755 root bin f none @libdir@/libospfapiclient.la=$DESTDIR/@libdir@/libospfapiclient.la 0755 root bin
f none @libdir@/libospfapiclient.a=$DESTDIR/@libdir@/libospfapiclient.a 0644 root bin f none @libdir@/libospfapiclient.a=$DESTDIR/@libdir@/libospfapiclient.a 0644 root bin
d none @includedir@=$DESTDIR/@includedir@ 0755 root bin d none @includedir@=$DESTDIR/@includedir@ 0755 root bin
d none @includedir@/quagga=$DESTDIR/@includedir@/quagga 0755 root bin d none @includedir@/frr=$DESTDIR/@includedir@/frr 0755 root bin
d none @includedir@/quagga/ospfd=$DESTDIR/@includedir@/quagga/ospfd 0755 root bin d none @includedir@/frr/ospfd=$DESTDIR/@includedir@/frr/ospfd 0755 root bin
f none @includedir@/quagga/ospfd/ospf_api.h=$DESTDIR/@includedir@/quagga/ospfd/ospf_api.h 0644 root bin f none @includedir@/frr/ospfd/ospf_api.h=$DESTDIR/@includedir@/frr/ospfd/ospf_api.h 0644 root bin
f none @includedir@/quagga/ospfd/ospf_asbr.h=$DESTDIR/@includedir@/quagga/ospfd/ospf_asbr.h 0644 root bin f none @includedir@/frr/ospfd/ospf_asbr.h=$DESTDIR/@includedir@/frr/ospfd/ospf_asbr.h 0644 root bin
f none @includedir@/quagga/ospfd/ospf_dump.h=$DESTDIR/@includedir@/quagga/ospfd/ospf_dump.h 0644 root bin f none @includedir@/frr/ospfd/ospf_dump.h=$DESTDIR/@includedir@/frr/ospfd/ospf_dump.h 0644 root bin
f none @includedir@/quagga/ospfd/ospf_lsa.h=$DESTDIR/@includedir@/quagga/ospfd/ospf_lsa.h 0644 root bin f none @includedir@/frr/ospfd/ospf_lsa.h=$DESTDIR/@includedir@/frr/ospfd/ospf_lsa.h 0644 root bin
f none @includedir@/quagga/ospfd/ospf_lsdb.h=$DESTDIR/@includedir@/quagga/ospfd/ospf_lsdb.h 0644 root bin f none @includedir@/frr/ospfd/ospf_lsdb.h=$DESTDIR/@includedir@/frr/ospfd/ospf_lsdb.h 0644 root bin
f none @includedir@/quagga/ospfd/ospf_nsm.h=$DESTDIR/@includedir@/quagga/ospfd/ospf_nsm.h 0644 root bin f none @includedir@/frr/ospfd/ospf_nsm.h=$DESTDIR/@includedir@/frr/ospfd/ospf_nsm.h 0644 root bin
f none @includedir@/quagga/ospfd/ospf_ism.h=$DESTDIR/@includedir@/quagga/ospfd/ospf_ism.h 0644 root bin f none @includedir@/frr/ospfd/ospf_ism.h=$DESTDIR/@includedir@/frr/ospfd/ospf_ism.h 0644 root bin
f none @includedir@/quagga/ospfd/ospf_opaque.h=$DESTDIR/@includedir@/quagga/ospfd/ospf_opaque.h 0644 root bin f none @includedir@/frr/ospfd/ospf_opaque.h=$DESTDIR/@includedir@/frr/ospfd/ospf_opaque.h 0644 root bin
f none @includedir@/quagga/ospfd/ospfd.h=$DESTDIR/@includedir@/quagga/ospfd/ospfd.h 0644 root bin f none @includedir@/frr/ospfd/ospfd.h=$DESTDIR/@includedir@/frr/ospfd/ospfd.h 0644 root bin
f none @includedir@/quagga/buffer.h=$DESTDIR/@includedir@/quagga/buffer.h 0644 root bin f none @includedir@/frr/buffer.h=$DESTDIR/@includedir@/frr/buffer.h 0644 root bin
f none @includedir@/quagga/command.h=$DESTDIR/@includedir@/quagga/command.h 0644 root bin f none @includedir@/frr/command.h=$DESTDIR/@includedir@/frr/command.h 0644 root bin
f none @includedir@/quagga/filter.h=$DESTDIR/@includedir@/quagga/filter.h 0644 root bin f none @includedir@/frr/filter.h=$DESTDIR/@includedir@/frr/filter.h 0644 root bin
f none @includedir@/quagga/getopt.h=$DESTDIR/@includedir@/quagga/getopt.h 0644 root bin f none @includedir@/frr/getopt.h=$DESTDIR/@includedir@/frr/getopt.h 0644 root bin
f none @includedir@/quagga/hash.h=$DESTDIR/@includedir@/quagga/hash.h 0644 root bin f none @includedir@/frr/hash.h=$DESTDIR/@includedir@/frr/hash.h 0644 root bin
f none @includedir@/quagga/if.h=$DESTDIR/@includedir@/quagga/if.h 0644 root bin f none @includedir@/frr/if.h=$DESTDIR/@includedir@/frr/if.h 0644 root bin
f none @includedir@/quagga/linklist.h=$DESTDIR/@includedir@/quagga/linklist.h 0644 root bin f none @includedir@/frr/linklist.h=$DESTDIR/@includedir@/frr/linklist.h 0644 root bin
f none @includedir@/quagga/log.h=$DESTDIR/@includedir@/quagga/log.h 0644 root bin f none @includedir@/frr/log.h=$DESTDIR/@includedir@/frr/log.h 0644 root bin
f none @includedir@/quagga/memory.h=$DESTDIR/@includedir@/quagga/memory.h 0644 root bin f none @includedir@/frr/memory.h=$DESTDIR/@includedir@/frr/memory.h 0644 root bin
f none @includedir@/quagga/network.h=$DESTDIR/@includedir@/quagga/network.h 0644 root bin f none @includedir@/frr/network.h=$DESTDIR/@includedir@/frr/network.h 0644 root bin
f none @includedir@/quagga/prefix.h=$DESTDIR/@includedir@/quagga/prefix.h 0644 root bin f none @includedir@/frr/prefix.h=$DESTDIR/@includedir@/frr/prefix.h 0644 root bin
f none @includedir@/quagga/routemap.h=$DESTDIR/@includedir@/quagga/routemap.h 0644 root bin f none @includedir@/frr/routemap.h=$DESTDIR/@includedir@/frr/routemap.h 0644 root bin
f none @includedir@/quagga/distribute.h=$DESTDIR/@includedir@/quagga/distribute.h 0644 root bin f none @includedir@/frr/distribute.h=$DESTDIR/@includedir@/frr/distribute.h 0644 root bin
f none @includedir@/quagga/sockunion.h=$DESTDIR/@includedir@/quagga/sockunion.h 0644 root bin f none @includedir@/frr/sockunion.h=$DESTDIR/@includedir@/frr/sockunion.h 0644 root bin
f none @includedir@/quagga/str.h=$DESTDIR/@includedir@/quagga/str.h 0644 root bin f none @includedir@/frr/str.h=$DESTDIR/@includedir@/frr/str.h 0644 root bin
f none @includedir@/quagga/stream.h=$DESTDIR/@includedir@/quagga/stream.h 0644 root bin f none @includedir@/frr/stream.h=$DESTDIR/@includedir@/frr/stream.h 0644 root bin
f none @includedir@/quagga/table.h=$DESTDIR/@includedir@/quagga/table.h 0644 root bin f none @includedir@/frr/table.h=$DESTDIR/@includedir@/frr/table.h 0644 root bin
f none @includedir@/quagga/thread.h=$DESTDIR/@includedir@/quagga/thread.h 0644 root bin f none @includedir@/frr/thread.h=$DESTDIR/@includedir@/frr/thread.h 0644 root bin
f none @includedir@/quagga/vector.h=$DESTDIR/@includedir@/quagga/vector.h 0644 root bin f none @includedir@/frr/vector.h=$DESTDIR/@includedir@/frr/vector.h 0644 root bin
f none @includedir@/quagga/version.h=$DESTDIR/@includedir@/quagga/version.h 0644 root bin f none @includedir@/frr/version.h=$DESTDIR/@includedir@/frr/version.h 0644 root bin
f none @includedir@/quagga/vty.h=$DESTDIR/@includedir@/quagga/vty.h 0644 root bin f none @includedir@/frr/vty.h=$DESTDIR/@includedir@/frr/vty.h 0644 root bin
f none @includedir@/quagga/zebra.h=$DESTDIR/@includedir@/quagga/zebra.h 0644 root bin f none @includedir@/frr/zebra.h=$DESTDIR/@includedir@/frr/zebra.h 0644 root bin
f none @includedir@/quagga/plist.h=$DESTDIR/@includedir@/quagga/plist.h 0644 root bin f none @includedir@/frr/plist.h=$DESTDIR/@includedir@/frr/plist.h 0644 root bin
f none @includedir@/quagga/zclient.h=$DESTDIR/@includedir@/quagga/zclient.h 0644 root bin f none @includedir@/frr/zclient.h=$DESTDIR/@includedir@/frr/zclient.h 0644 root bin
f none @includedir@/quagga/sockopt.h=$DESTDIR/@includedir@/quagga/sockopt.h 0644 root bin f none @includedir@/frr/sockopt.h=$DESTDIR/@includedir@/frr/sockopt.h 0644 root bin
f none @includedir@/quagga/smux.h=$DESTDIR/@includedir@/quagga/smux.h 0644 root bin f none @includedir@/frr/smux.h=$DESTDIR/@includedir@/frr/smux.h 0644 root bin
f none @includedir@/quagga/md5.h=$DESTDIR/@includedir@/quagga/md5.h 0644 root bin f none @includedir@/frr/md5.h=$DESTDIR/@includedir@/frr/md5.h 0644 root bin
f none @includedir@/quagga/if_rmap.h=$DESTDIR/@includedir@/quagga/if_rmap.h 0644 root bin f none @includedir@/frr/if_rmap.h=$DESTDIR/@includedir@/frr/if_rmap.h 0644 root bin
f none @includedir@/quagga/keychain.h=$DESTDIR/@includedir@/quagga/keychain.h 0644 root bin f none @includedir@/frr/keychain.h=$DESTDIR/@includedir@/frr/keychain.h 0644 root bin
f none @includedir@/quagga/privs.h=$DESTDIR/@includedir@/quagga/privs.h 0644 root bin f none @includedir@/frr/privs.h=$DESTDIR/@includedir@/frr/privs.h 0644 root bin
f none @includedir@/quagga/sigevent.h=$DESTDIR/@includedir@/quagga/sigevent.h 0644 root bin f none @includedir@/frr/sigevent.h=$DESTDIR/@includedir@/frr/sigevent.h 0644 root bin
f none @includedir@/quagga/pqueue.h=$DESTDIR/@includedir@/quagga/pqueue.h 0644 root bin f none @includedir@/frr/pqueue.h=$DESTDIR/@includedir@/frr/pqueue.h 0644 root bin
f none @includedir@/quagga/jhash.h=$DESTDIR/@includedir@/quagga/jhash.h 0644 root bin f none @includedir@/frr/jhash.h=$DESTDIR/@includedir@/frr/jhash.h 0644 root bin
f none @includedir@/quagga/zassert.h=$DESTDIR/@includedir@/quagga/zassert.h 0644 root bin f none @includedir@/frr/zassert.h=$DESTDIR/@includedir@/frr/zassert.h 0644 root bin
d none @includedir@/quagga/ospfapi=$DESTDIR/@includedir@/quagga/ospfapi 0755 root bin d none @includedir@/frr/ospfapi=$DESTDIR/@includedir@/frr/ospfapi 0755 root bin
f none @includedir@/quagga/ospfapi/ospf_apiclient.h=$DESTDIR/@includedir@/quagga/ospfapi/ospf_apiclient.h 0644 root bin f none @includedir@/frr/ospfapi/ospf_apiclient.h=$DESTDIR/@includedir@/frr/ospfapi/ospf_apiclient.h 0644 root bin

View File

@ -3,7 +3,7 @@ i depend=$abs_builddir/depend.doc
i copying=$abs_top_srcdir/COPYING i copying=$abs_top_srcdir/COPYING
d none @infodir@=$DESTDIR/@infodir@ 0755 root bin d none @infodir@=$DESTDIR/@infodir@ 0755 root bin
#f none @infodir@/dir=$DESTDIR/@infodir@/dir 0644 root bin #f none @infodir@/dir=$DESTDIR/@infodir@/dir 0644 root bin
f none @infodir@/quagga.info=$DESTDIR/@infodir@/quagga.info 0644 root bin f none @infodir@/frr.info=$DESTDIR/@infodir@/frr.info 0644 root bin
d none @mandir@=$DESTDIR/@mandir@ 0755 root bin d none @mandir@=$DESTDIR/@mandir@ 0755 root bin
d none @mandir@/man1=$DESTDIR/@mandir@/man1 0755 root bin d none @mandir@/man1=$DESTDIR/@mandir@/man1 0755 root bin
f none @mandir@/man1/vtysh.1=$DESTDIR/@mandir@/man1/vtysh.1 0644 root bin f none @mandir@/man1/vtysh.1=$DESTDIR/@mandir@/man1/vtysh.1 0644 root bin

View File

@ -3,6 +3,6 @@ i depend=$abs_builddir/depend.smf
i copying=$abs_top_srcdir/COPYING i copying=$abs_top_srcdir/COPYING
i i.manifest i i.manifest
i r.manifest i r.manifest
f manifest var/svc/manifest/network/quagga.xml 0444 root bin f manifest var/svc/manifest/network/frr.xml 0444 root bin
#f none var/svc/profile/@PACKAGE_TARNAME@_options.xml=$abs_builddir/options.xml 0755 root sys #f none var/svc/profile/@PACKAGE_TARNAME@_options.xml=$abs_builddir/options.xml 0755 root sys
f none lib/svc/method/quagga=$abs_builddir/quagga.init 0755 root bin f none lib/svc/method/frr=$abs_builddir/frr.init 0755 root bin

View File

@ -38,7 +38,7 @@ import string
import subprocess import subprocess
import sys import sys
from collections import OrderedDict from collections import OrderedDict
from ipaddr import IPv6Address from ipaddr import IPv6Address, IPNetwork
from pprint import pformat from pprint import pformat
@ -173,6 +173,100 @@ class Config(object):
if not key: if not key:
return return
'''
IP addresses specified in "network" statements, "ip prefix-lists"
etc. can differ in the host part of the specification the user
provides and what the running config displays. For example, user
can specify 11.1.1.1/24, and the running config displays this as
11.1.1.0/24. Ensure we don't do a needless operation for such
lines. IS-IS & OSPFv3 have no "network" support.
'''
re_key_rt = re.match(r'(ip|ipv6)\s+route\s+([A-Fa-f:.0-9/]+)(.*)$', key[0])
if re_key_rt:
addr = re_key_rt.group(2)
if '/' in addr:
try:
newaddr = IPNetwork(addr)
key[0] = '%s route %s/%s%s' % (re_key_rt.group(1),
newaddr.network,
newaddr.prefixlen,
re_key_rt.group(3))
except ValueError:
pass
re_key_rt = re.match(
r'(ip|ipv6)\s+prefix-list(.*)(permit|deny)\s+([A-Fa-f:.0-9/]+)(.*)$',
key[0]
)
if re_key_rt:
addr = re_key_rt.group(4)
if '/' in addr:
try:
newaddr = '%s/%s' % (IPNetwork(addr).network,
IPNetwork(addr).prefixlen)
except ValueError:
newaddr = addr
else:
newaddr = addr
legestr = re_key_rt.group(5)
re_lege = re.search(r'(.*)le\s+(\d+)\s+ge\s+(\d+)(.*)', legestr)
if re_lege:
legestr = '%sge %s le %s%s' % (re_lege.group(1),
re_lege.group(3),
re_lege.group(2),
re_lege.group(4))
re_lege = re.search(r'(.*)ge\s+(\d+)\s+le\s+(\d+)(.*)', legestr)
if (re_lege and ((re_key_rt.group(1) == "ip" and
re_lege.group(3) == "32") or
(re_key_rt.group(1) == "ipv6" and
re_lege.group(3) == "128"))):
legestr = '%sge %s%s' % (re_lege.group(1),
re_lege.group(2),
re_lege.group(4))
key[0] = '%s prefix-list%s%s %s%s' % (re_key_rt.group(1),
re_key_rt.group(2),
re_key_rt.group(3),
newaddr,
legestr)
if lines and key[0].startswith('router bgp'):
newlines = []
for line in lines:
re_net = re.match(r'network\s+([A-Fa-f:.0-9/]+)(.*)$', line)
if re_net:
addr = re_net.group(1)
if '/' not in addr and key[0].startswith('router bgp'):
# This is most likely an error because with no
# prefixlen, BGP treats the prefixlen as 8
addr = addr + '/8'
try:
newaddr = IPNetwork(addr)
line = 'network %s/%s %s' % (newaddr.network,
newaddr.prefixlen,
re_net.group(2))
newlines.append(line)
except ValueError:
# Really this should be an error. Whats a network
# without an IP Address following it ?
newlines.append(line)
else:
newlines.append(line)
lines = newlines
'''
More fixups in user specification and what running config shows.
"null0" in routes must be replaced by Null0, and "blackhole" must
be replaced by Null0 as well.
'''
if (key[0].startswith('ip route') or key[0].startswith('ipv6 route') and
'null0' in key[0] or 'blackhole' in key[0]):
key[0] = re.sub(r'\s+null0(\s*$)', ' Null0', key[0])
key[0] = re.sub(r'\s+blackhole(\s*$)', ' Null0', key[0])
if lines: if lines:
if tuple(key) not in self.contexts: if tuple(key) not in self.contexts:
ctx = Context(tuple(key), lines) ctx = Context(tuple(key), lines)
@ -437,16 +531,25 @@ def get_normalized_ipv6_line(line):
""" """
Return a normalized IPv6 line as produced by frr, Return a normalized IPv6 line as produced by frr,
with all letters in lower case and trailing and leading with all letters in lower case and trailing and leading
zeros removed zeros removed, and only the network portion present if
the IPv6 word is a network
""" """
norm_line = "" norm_line = ""
words = line.split(' ') words = line.split(' ')
for word in words: for word in words:
if ":" in word: if ":" in word:
try: norm_word = None
norm_word = str(IPv6Address(word)).lower() if "/" in word:
except: try:
norm_word = word v6word = IPNetwork(word)
norm_word = '%s/%s' % (v6word.network, v6word.prefixlen)
except ValueError:
pass
if not norm_word:
try:
norm_word = '%s' % IPv6Address(word)
except ValueError:
norm_word = word
else: else:
norm_word = word norm_word = word
norm_line = norm_line + " " + norm_word norm_line = norm_line + " " + norm_word
@ -579,6 +682,60 @@ def ignore_delete_re_add_lines(lines_to_add, lines_to_del):
lines_to_add_to_del.append((ctx_keys, swpx_interface)) lines_to_add_to_del.append((ctx_keys, swpx_interface))
lines_to_add_to_del.append((tmp_ctx_keys, swpx_remoteas)) lines_to_add_to_del.append((tmp_ctx_keys, swpx_remoteas))
'''
In 3.0, we made bgp bestpath multipath as-relax command
automatically assume no-as-set since the lack of this option caused
weird routing problems and this problem was peculiar to this
implementation. When the running config is shown in relases after
3.0, the no-as-set is not shown as its the default. This causes
reload to unnecessarily unapply this option to only apply it back
again, causing unnecessary session resets. Handle this.
'''
if ctx_keys[0].startswith('router bgp') and line and 'multipath-relax' in line:
re_asrelax_new = re.search('^bgp\s+bestpath\s+as-path\s+multipath-relax$', line)
old_asrelax_cmd = 'bgp bestpath as-path multipath-relax no-as-set'
found_asrelax_old = line_exist(lines_to_add, ctx_keys, old_asrelax_cmd)
if re_asrelax_new and found_asrelax_old:
deleted = True
lines_to_del_to_del.append((ctx_keys, line))
lines_to_add_to_del.append((ctx_keys, old_asrelax_cmd))
'''
More old-to-new config handling. ip import-table no longer accepts
distance, but we honor the old syntax. But 'show running' shows only
the new syntax. This causes an unnecessary 'no import-table' followed
by the same old 'ip import-table' which causes perturbations in
announced routes leading to traffic blackholes. Fix this issue.
'''
re_importtbl = re.search('^ip\s+import-table\s+(\d+)$', ctx_keys[0])
if re_importtbl:
table_num = re_importtbl.group(1)
for ctx in lines_to_add:
if ctx[0][0].startswith('ip import-table %s distance' % table_num):
lines_to_del_to_del.append((('ip import-table %s' % table_num,), None))
lines_to_add_to_del.append((ctx[0], None))
'''
ip/ipv6 prefix-list can be specified without a seq number. However,
the running config always adds 'seq x', where x is a number incremented
by 5 for every element, to the prefix list. So, ignore such lines as
well. Sample prefix-list lines:
ip prefix-list PR-TABLE-2 seq 5 permit 20.8.2.0/24 le 32
ip prefix-list PR-TABLE-2 seq 10 permit 20.8.2.0/24 le 32
ipv6 prefix-list vrfdev6-12 permit 2000:9:2::/64 gt 64
'''
re_ip_pfxlst = re.search('^(ip|ipv6)(\s+prefix-list\s+)(\S+\s+)(seq \d+\s+)(permit|deny)(.*)$',
ctx_keys[0])
if re_ip_pfxlst:
tmpline = (re_ip_pfxlst.group(1) + re_ip_pfxlst.group(2) +
re_ip_pfxlst.group(3) + re_ip_pfxlst.group(5) +
re_ip_pfxlst.group(6))
for ctx in lines_to_add:
if ctx[0][0] == tmpline:
lines_to_del_to_del.append((ctx_keys, None))
lines_to_add_to_del.append(((tmpline,), None))
if not deleted: if not deleted:
found_add_line = line_exist(lines_to_add, ctx_keys, line) found_add_line = line_exist(lines_to_add, ctx_keys, line)
@ -646,6 +803,11 @@ def compare_context_objects(newconf, running):
delete_bgpd = True delete_bgpd = True
lines_to_del.append((running_ctx_keys, None)) lines_to_del.append((running_ctx_keys, None))
# We cannot do 'no interface' in quagga, and so deal with it
elif running_ctx_keys[0].startswith('interface'):
for line in running_ctx.lines:
lines_to_del.append((running_ctx_keys, line))
# If this is an address-family under 'router bgp' and we are already deleting the # If this is an address-family under 'router bgp' and we are already deleting the
# entire 'router bgp' context then ignore this sub-context # entire 'router bgp' context then ignore this sub-context
elif "router bgp" in running_ctx_keys[0] and len(running_ctx_keys) > 1 and delete_bgpd: elif "router bgp" in running_ctx_keys[0] and len(running_ctx_keys) > 1 and delete_bgpd:
@ -697,6 +859,7 @@ if __name__ == '__main__':
parser.add_argument('--debug', action='store_true', help='Enable debugs', default=False) parser.add_argument('--debug', action='store_true', help='Enable debugs', default=False)
parser.add_argument('--stdout', action='store_true', help='Log to STDOUT', default=False) parser.add_argument('--stdout', action='store_true', help='Log to STDOUT', default=False)
parser.add_argument('filename', help='Location of new frr config file') parser.add_argument('filename', help='Location of new frr config file')
parser.add_argument('--overwrite', action='store_true', help='Overwrite Quagga.conf with running config output', default=False)
args = parser.parse_args() args = parser.parse_args()
# Logging # Logging
@ -904,5 +1067,6 @@ if __name__ == '__main__':
subprocess.call(['/usr/bin/vtysh', '-f', filename]) subprocess.call(['/usr/bin/vtysh', '-f', filename])
os.unlink(filename) os.unlink(filename)
# Make these changes persistent # Make these changes persistent
if args.overwrite or args.filename != '/etc/quagga/Quagga.conf':
subprocess.call(['/usr/bin/vtysh', '-c', 'write']) subprocess.call(['/usr/bin/vtysh', '-c', 'write'])

View File

@ -62,6 +62,9 @@ $ignore{'"address-family vpnv4 unicast"'} = "ignore";
$ignore{'"address-family ipv4 vrf NAME"'} = "ignore"; $ignore{'"address-family ipv4 vrf NAME"'} = "ignore";
$ignore{'"address-family <encap|encapv4>"'} = "ignore"; $ignore{'"address-family <encap|encapv4>"'} = "ignore";
$ignore{'"address-family encapv6"'} = "ignore"; $ignore{'"address-family encapv6"'} = "ignore";
$ignore{'"address-family ipv4 encap"'} = "ignore";
$ignore{'"address-family ipv6 encap"'} = "ignore";
$ignore{'"address-family ipv6 vpn"'} = "ignore";
$ignore{'"address-family vpnv6"'} = "ignore"; $ignore{'"address-family vpnv6"'} = "ignore";
$ignore{'"address-family vpnv6 unicast"'} = "ignore"; $ignore{'"address-family vpnv6 unicast"'} = "ignore";
$ignore{'"exit-address-family"'} = "ignore"; $ignore{'"exit-address-family"'} = "ignore";

View File

@ -2842,13 +2842,34 @@ vtysh_connect (struct vtysh_client *vclient)
int sock, len; int sock, len;
struct sockaddr_un addr; struct sockaddr_un addr;
struct stat s_stat; struct stat s_stat;
char path[MAXPATHLEN];
if (vty_sock_path == NULL)
strlcpy (path, vclient->path, sizeof (path));
else {
/* Different path for VTY Socket specified
overriding the default path, but keep the filename */
strlcpy (path, vty_sock_path, sizeof (path));
if (strrchr (vclient->path, '/') != NULL)
strlcat (path, strrchr (vclient->path, '/'), sizeof (path));
else {
/*
* vclient->path configured as relative path during config? Should
* really never happen for sensible config
*/
strlcat (path, "/", sizeof (path));
strlcat (path, vclient->path, sizeof (path));
}
}
path[sizeof(path)-1] = '\0';
/* Stat socket to see if we have permission to access it. */ /* Stat socket to see if we have permission to access it. */
ret = stat (vclient->path, &s_stat); ret = stat (path, &s_stat);
if (ret < 0 && errno != ENOENT) if (ret < 0 && errno != ENOENT)
{ {
fprintf (stderr, "vtysh_connect(%s): stat = %s\n", fprintf (stderr, "vtysh_connect(%s): stat = %s\n",
vclient->path, safe_strerror(errno)); path, safe_strerror(errno));
exit(1); exit(1);
} }
@ -2857,7 +2878,7 @@ vtysh_connect (struct vtysh_client *vclient)
if (! S_ISSOCK(s_stat.st_mode)) if (! S_ISSOCK(s_stat.st_mode))
{ {
fprintf (stderr, "vtysh_connect(%s): Not a socket\n", fprintf (stderr, "vtysh_connect(%s): Not a socket\n",
vclient->path); path);
exit (1); exit (1);
} }
@ -2867,7 +2888,7 @@ vtysh_connect (struct vtysh_client *vclient)
if (sock < 0) if (sock < 0)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "vtysh_connect(%s): socket = %s\n", vclient->path, fprintf(stderr, "vtysh_connect(%s): socket = %s\n", path,
safe_strerror(errno)); safe_strerror(errno));
#endif /* DEBUG */ #endif /* DEBUG */
return -1; return -1;
@ -2875,7 +2896,7 @@ vtysh_connect (struct vtysh_client *vclient)
memset (&addr, 0, sizeof (struct sockaddr_un)); memset (&addr, 0, sizeof (struct sockaddr_un));
addr.sun_family = AF_UNIX; addr.sun_family = AF_UNIX;
strncpy (addr.sun_path, vclient->path, strlen (vclient->path)); strncpy (addr.sun_path, path, strlen (path));
#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN #ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
len = addr.sun_len = SUN_LEN(&addr); len = addr.sun_len = SUN_LEN(&addr);
#else #else
@ -2886,7 +2907,7 @@ vtysh_connect (struct vtysh_client *vclient)
if (ret < 0) if (ret < 0)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "vtysh_connect(%s): connect = %s\n", vclient->path, fprintf(stderr, "vtysh_connect(%s): connect = %s\n", path,
safe_strerror(errno)); safe_strerror(errno));
#endif /* DEBUG */ #endif /* DEBUG */
close (sock); close (sock);
@ -2937,14 +2958,23 @@ vtysh_update_all_insances(struct vtysh_client * head_client)
{ {
struct vtysh_client *client; struct vtysh_client *client;
char *ptr; char *ptr;
char vty_dir[MAXPATHLEN];
DIR *dir; DIR *dir;
struct dirent *file; struct dirent *file;
int n = 0; int n = 0;
if (head_client->flag != VTYSH_OSPFD) return; if (head_client->flag != VTYSH_OSPFD) return;
/* ls DAEMON_VTY_DIR and look for all files ending in .vty */ if (vty_sock_path == NULL)
dir = opendir(DAEMON_VTY_DIR "/"); /* ls DAEMON_VTY_DIR and look for all files ending in .vty */
strlcpy(vty_dir, DAEMON_VTY_DIR "/", MAXPATHLEN);
else
{
/* ls vty_sock_dir and look for all files ending in .vty */
strlcpy(vty_dir, vty_sock_path, MAXPATHLEN);
strlcat(vty_dir, "/", MAXPATHLEN);
}
dir = opendir(vty_dir);
if (dir) if (dir)
{ {
while ((file = readdir(dir)) != NULL) while ((file = readdir(dir)) != NULL)
@ -2954,8 +2984,8 @@ vtysh_update_all_insances(struct vtysh_client * head_client)
if (n == MAXIMUM_INSTANCES) if (n == MAXIMUM_INSTANCES)
{ {
fprintf(stderr, fprintf(stderr,
"Parsing %s/, client limit(%d) reached!\n", "Parsing %s, client limit(%d) reached!\n",
DAEMON_VTY_DIR, n); vty_dir, n);
break; break;
} }
client = (struct vtysh_client *) malloc(sizeof(struct vtysh_client)); client = (struct vtysh_client *) malloc(sizeof(struct vtysh_client));
@ -2963,7 +2993,7 @@ vtysh_update_all_insances(struct vtysh_client * head_client)
client->name = "ospfd"; client->name = "ospfd";
client->flag = VTYSH_OSPFD; client->flag = VTYSH_OSPFD;
ptr = (char *) malloc(100); ptr = (char *) malloc(100);
sprintf(ptr, "%s/%s", DAEMON_VTY_DIR, file->d_name); sprintf(ptr, "%s%s", vty_dir, file->d_name);
client->path = (const char *)ptr; client->path = (const char *)ptr;
client->next = NULL; client->next = NULL;
vtysh_client_sorted_insert(head_client, client); vtysh_client_sorted_insert(head_client, client);

View File

@ -96,4 +96,6 @@ extern int execute_flag;
extern struct vty *vty; extern struct vty *vty;
extern char * vty_sock_path;
#endif /* VTYSH_H */ #endif /* VTYSH_H */

View File

@ -45,14 +45,17 @@
char *progname; char *progname;
/* Configuration file name and directory. */ /* Configuration file name and directory. */
static char vtysh_config_always[] = SYSCONFDIR VTYSH_DEFAULT_CONFIG; static char vtysh_config_always[MAXPATHLEN] = SYSCONFDIR VTYSH_DEFAULT_CONFIG;
static char quagga_config_default[] = SYSCONFDIR QUAGGA_DEFAULT_CONFIG; static char quagga_config_default[MAXPATHLEN] = SYSCONFDIR QUAGGA_DEFAULT_CONFIG;
char *quagga_config = quagga_config_default; char *quagga_config = quagga_config_default;
char history_file[MAXPATHLEN]; char history_file[MAXPATHLEN];
/* Flag for indicate executing child command. */ /* Flag for indicate executing child command. */
int execute_flag = 0; int execute_flag = 0;
/* VTY Socket prefix */
char * vty_sock_path = NULL;
/* For sigsetjmp() & siglongjmp(). */ /* For sigsetjmp() & siglongjmp(). */
static sigjmp_buf jmpbuf; static sigjmp_buf jmpbuf;
@ -144,8 +147,11 @@ usage (int status)
"-f, --inputfile Execute commands from specific file and exit\n" \ "-f, --inputfile Execute commands from specific file and exit\n" \
"-E, --echo Echo prompt and command in -c mode\n" \ "-E, --echo Echo prompt and command in -c mode\n" \
"-C, --dryrun Check configuration for validity and exit\n" \ "-C, --dryrun Check configuration for validity and exit\n" \
"-m, --markfile Mark input file with context end\n" " --vty_socket Override vty socket path\n" \
"-w, --writeconfig Write integrated config (Quagga.conf) and exit\n" "-m, --markfile Mark input file with context end\n" \
" --vty_socket Override vty socket path\n" \
" --config_dir Override config directory path\n" \
"-w, --writeconfig Write integrated config (Quagga.conf) and exit\n" \
"-h, --help Display this help and exit\n\n" \ "-h, --help Display this help and exit\n\n" \
"Note that multiple commands may be executed from the command\n" \ "Note that multiple commands may be executed from the command\n" \
"line by passing multiple -c args, or by embedding linefeed\n" \ "line by passing multiple -c args, or by embedding linefeed\n" \
@ -156,6 +162,8 @@ usage (int status)
} }
/* VTY shell options, we use GNU getopt library. */ /* VTY shell options, we use GNU getopt library. */
#define OPTION_VTYSOCK 1000
#define OPTION_CONFDIR 1001
struct option longopts[] = struct option longopts[] =
{ {
{ "boot", no_argument, NULL, 'b'}, { "boot", no_argument, NULL, 'b'},
@ -163,6 +171,8 @@ struct option longopts[] =
{ "eval", required_argument, NULL, 'e'}, { "eval", required_argument, NULL, 'e'},
{ "command", required_argument, NULL, 'c'}, { "command", required_argument, NULL, 'c'},
{ "daemon", required_argument, NULL, 'd'}, { "daemon", required_argument, NULL, 'd'},
{ "vty_socket", required_argument, NULL, OPTION_VTYSOCK},
{ "config_dir", required_argument, NULL, OPTION_CONFDIR},
{ "inputfile", required_argument, NULL, 'f'}, { "inputfile", required_argument, NULL, 'f'},
{ "echo", no_argument, NULL, 'E'}, { "echo", no_argument, NULL, 'E'},
{ "dryrun", no_argument, NULL, 'C'}, { "dryrun", no_argument, NULL, 'C'},
@ -262,6 +272,7 @@ main (int argc, char **argv, char **env)
int boot_flag = 0; int boot_flag = 0;
const char *daemon_name = NULL; const char *daemon_name = NULL;
const char *inputfile = NULL; const char *inputfile = NULL;
const char *vtysh_configfile_name;
struct cmd_rec { struct cmd_rec {
const char *line; const char *line;
struct cmd_rec *next; struct cmd_rec *next;
@ -274,6 +285,9 @@ main (int argc, char **argv, char **env)
int ret = 0; int ret = 0;
char *homedir = NULL; char *homedir = NULL;
/* check for restricted functionality if vtysh is run setuid */
int restricted = (getuid() != geteuid()) || (getgid() != getegid());
/* Preserve name of myself. */ /* Preserve name of myself. */
progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]); progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]);
@ -310,6 +324,55 @@ main (int argc, char **argv, char **env)
tail = cr; tail = cr;
} }
break; break;
case OPTION_VTYSOCK:
vty_sock_path = optarg;
break;
case OPTION_CONFDIR:
/*
* Skip option for Config Directory if setuid
*/
if (restricted)
{
fprintf (stderr, "Overriding of Config Directory blocked for vtysh with setuid");
return 1;
}
/*
* Overwrite location for vtysh.conf
*/
vtysh_configfile_name = strrchr(VTYSH_DEFAULT_CONFIG, '/');
if (vtysh_configfile_name)
/* skip '/' */
vtysh_configfile_name++;
else
/*
* VTYSH_DEFAULT_CONFIG configured with relative path
* during config? Should really never happen for
* sensible config
*/
vtysh_configfile_name = (char *) VTYSH_DEFAULT_CONFIG;
strlcpy(vtysh_config_always, optarg, sizeof(vtysh_config_always));
strlcat(vtysh_config_always, "/", sizeof(vtysh_config_always));
strlcat(vtysh_config_always, vtysh_configfile_name,
sizeof(vtysh_config_always));
/*
* Overwrite location for Quagga.conf
*/
vtysh_configfile_name = strrchr(QUAGGA_DEFAULT_CONFIG, '/');
if (vtysh_configfile_name)
/* skip '/' */
vtysh_configfile_name++;
else
/*
* QUAGGA_DEFAULT_CONFIG configured with relative path
* during config? Should really never happen for
* sensible config
*/
vtysh_configfile_name = (char *) QUAGGA_DEFAULT_CONFIG;
strlcpy(quagga_config_default, optarg, sizeof(vtysh_config_always));
strlcat(quagga_config_default, "/", sizeof(vtysh_config_always));
strlcat(quagga_config_default, vtysh_configfile_name,
sizeof(quagga_config_default));
break;
case 'd': case 'd':
daemon_name = optarg; daemon_name = optarg;
break; break;

View File

@ -220,7 +220,12 @@ char *
vtysh_get_home (void) vtysh_get_home (void)
{ {
struct passwd *passwd; struct passwd *passwd;
char * homedir;
if ((homedir = getenv("HOME")) != 0)
return homedir;
/* Fallback if HOME is undefined */
passwd = getpwuid (getuid ()); passwd = getpwuid (getuid ());
return passwd ? passwd->pw_dir : NULL; return passwd ? passwd->pw_dir : NULL;

View File

@ -35,6 +35,7 @@
#include "privs.h" #include "privs.h"
#include "sigevent.h" #include "sigevent.h"
#include "vrf.h" #include "vrf.h"
#include "sockopt.h"
#include "zebra/rib.h" #include "zebra/rib.h"
#include "zebra/zserv.h" #include "zebra/zserv.h"
@ -59,6 +60,9 @@ struct zebra_t zebrad =
/* process id. */ /* process id. */
pid_t pid; pid_t pid;
/* VTY Socket prefix */
char vty_sock_path[MAXPATHLEN] = ZEBRA_VTYSH_PATH;
/* Pacify zclient.o in libzebra, which expects this variable. */ /* Pacify zclient.o in libzebra, which expects this variable. */
struct thread_master *master; struct thread_master *master;
@ -77,6 +81,7 @@ u_int32_t nl_rcvbufsize = 4194304;
#endif /* HAVE_NETLINK */ #endif /* HAVE_NETLINK */
/* Command line options. */ /* Command line options. */
#define OPTION_VTYSOCK 1000
struct option longopts[] = struct option longopts[] =
{ {
{ "batch", no_argument, NULL, 'b'}, { "batch", no_argument, NULL, 'b'},
@ -90,6 +95,7 @@ struct option longopts[] =
{ "help", no_argument, NULL, 'h'}, { "help", no_argument, NULL, 'h'},
{ "vty_addr", required_argument, NULL, 'A'}, { "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'}, { "vty_port", required_argument, NULL, 'P'},
{ "vty_socket", required_argument, NULL, OPTION_VTYSOCK },
{ "retain", no_argument, NULL, 'r'}, { "retain", no_argument, NULL, 'r'},
{ "dryrun", no_argument, NULL, 'C'}, { "dryrun", no_argument, NULL, 'C'},
#ifdef HAVE_NETLINK #ifdef HAVE_NETLINK
@ -152,6 +158,7 @@ usage (char *progname, int status)
"-C, --dryrun Check configuration for validity and exit\n"\ "-C, --dryrun Check configuration for validity and exit\n"\
"-A, --vty_addr Set vty's bind address\n"\ "-A, --vty_addr Set vty's bind address\n"\
"-P, --vty_port Set vty's port number\n"\ "-P, --vty_port Set vty's port number\n"\
" --vty_socket Override vty socket path\n"\
"-r, --retain When program terminates, retain added route "\ "-r, --retain When program terminates, retain added route "\
"by zebra.\n"\ "by zebra.\n"\
"-u, --user User to run as\n"\ "-u, --user User to run as\n"\
@ -339,6 +346,9 @@ main (int argc, char **argv)
if (vty_port <= 0 || vty_port > 0xffff) if (vty_port <= 0 || vty_port > 0xffff)
vty_port = ZEBRA_VTY_PORT; vty_port = ZEBRA_VTY_PORT;
break; break;
case OPTION_VTYSOCK:
set_socket_path(vty_sock_path, ZEBRA_VTYSH_PATH, optarg, sizeof (vty_sock_path));
break;
case 'r': case 'r':
retain_mode = 1; retain_mode = 1;
break; break;
@ -463,7 +473,7 @@ main (int argc, char **argv)
zebra_zserv_socket_init (zserv_path); zebra_zserv_socket_init (zserv_path);
/* Make vty server socket. */ /* Make vty server socket. */
vty_serv_sock (vty_addr, vty_port, ZEBRA_VTYSH_PATH); vty_serv_sock (vty_addr, vty_port, vty_sock_path);
/* Print banner. */ /* Print banner. */
zlog_notice ("Zebra %s starting: vty@%d", FRR_VERSION, vty_port); zlog_notice ("Zebra %s starting: vty@%d", FRR_VERSION, vty_port);

View File

@ -868,8 +868,10 @@ _netlink_route_build_singlepath(
if (nexthop->type == NEXTHOP_TYPE_IPV4 if (nexthop->type == NEXTHOP_TYPE_IPV4
|| nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX)
{ {
_netlink_route_nl_add_gateway_info (rtmsg->rtm_family, AF_INET, nlmsg, /* Send deletes to the kernel without specifying the next-hop */
req_size, bytelen, nexthop); if (cmd != RTM_DELROUTE)
_netlink_route_nl_add_gateway_info (rtmsg->rtm_family, AF_INET, nlmsg,
req_size, bytelen, nexthop);
if (cmd == RTM_NEWROUTE) if (cmd == RTM_NEWROUTE)
{ {

View File

@ -459,6 +459,7 @@ zebra_ptm_handle_bfd_msg(void *arg, void *in_ctxt, struct interface *ifp)
char vrf_str[64]; char vrf_str[64];
struct prefix dest_prefix; struct prefix dest_prefix;
struct prefix src_prefix; struct prefix src_prefix;
vrf_id_t vrf_id;
ptm_lib_find_key_in_msg(in_ctxt, ZEBRA_PTM_BFDSTATUS_STR, bfdst_str); ptm_lib_find_key_in_msg(in_ctxt, ZEBRA_PTM_BFDSTATUS_STR, bfdst_str);
@ -491,7 +492,8 @@ zebra_ptm_handle_bfd_msg(void *arg, void *in_ctxt, struct interface *ifp)
} }
if (IS_ZEBRA_DEBUG_EVENT) if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug("%s: Recv Port [%s] bfd status [%s] vrf [%s] peer [%s] local [%s]", zlog_debug("%s: Recv Port [%s] bfd status [%s] vrf [%s]"
" peer [%s] local [%s]",
__func__, ifp ? ifp->name : "N/A", bfdst_str, __func__, ifp ? ifp->name : "N/A", bfdst_str,
vrf_str, dest_str, src_str); vrf_str, dest_str, src_str);
@ -510,12 +512,18 @@ zebra_ptm_handle_bfd_msg(void *arg, void *in_ctxt, struct interface *ifp)
} }
} }
if (!strcmp(ZEBRA_PTM_INVALID_VRF, vrf_str) && ifp) {
vrf_id = ifp->vrf_id;
} else {
vrf_id = vrf_name_to_id(vrf_str);
}
if (!strcmp (bfdst_str, ZEBRA_PTM_BFDSTATUS_DOWN_STR)) { if (!strcmp (bfdst_str, ZEBRA_PTM_BFDSTATUS_DOWN_STR)) {
if_bfd_session_update(ifp, &dest_prefix, &src_prefix, BFD_STATUS_DOWN, if_bfd_session_update(ifp, &dest_prefix, &src_prefix, BFD_STATUS_DOWN,
vrf_name_to_id(vrf_str)); vrf_id);
} else { } else {
if_bfd_session_update(ifp, &dest_prefix, &src_prefix, BFD_STATUS_UP, if_bfd_session_update(ifp, &dest_prefix, &src_prefix, BFD_STATUS_UP,
vrf_name_to_id(vrf_str)); vrf_id);
} }
return 0; return 0;