]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge remote-tracking branch 'origin/stable/2.0'
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 5 Jun 2017 12:19:11 +0000 (08:19 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 5 Jun 2017 12:19:11 +0000 (08:19 -0400)
1  2 
configure.ac
redhat/frr.spec.in
watchfrr/watchfrr.c

diff --cc configure.ac
Simple merge
index aef7a7cd2a5cca067151445fd38e204968d62573,41023dc35ff763873bae9f3988a4a4f380af56e4..d7cb517ea87538aab15bd5fa500de5965cafde23
@@@ -8,36 -8,34 +8,38 @@@
  # rpms again and again on the same day, so the newer rpms can be installed.
  # bumping the number each time.
  
- ####################### FRRouting (FRR) configure options #########################
+ #################### FRRouting (FRR) configure options #####################
  # with-feature options
 -%{!?with_tcp_zebra:     %global  with_tcp_zebra     0 }
 -%{!?with_pam:           %global  with_pam           0 }
 -%{!?with_ospfclient:    %global  with_ospfclient    1 }
 -%{!?with_ospfapi:       %global  with_ospfapi       1 }
 -%{!?with_irdp:          %global  with_irdp          1 }
 -%{!?with_rtadv:         %global  with_rtadv         1 }
 -%{!?with_ldpd:          %global  with_ldpd          1 }
 -%{!?with_shared:        %global  with_shared        1 }
 -%{!?with_multipath:     %global  with_multipath     256 }
 -%{!?frr_user:           %global  frr_user           frr }
 -%{!?vty_group:          %global  vty_group          frrvty }
 -%{!?with_fpm:           %global  with_fpm           0 }
 -%{!?with_watchfrr:      %global  with_watchfrr      1 }
 -%{!?with_bgp_vnc:       %global  with_bgp_vnc       0 }
 -%{!?with_pimd:          %global  with_pimd          1 }
++<<<<<<< HEAD
 +%{!?with_tcp_zebra:           %global with_tcp_zebra          0 }
 +%{!?with_pam:                 %global with_pam                0 }
 +%{!?with_ospfclient:          %global with_ospfclient         1 }
 +%{!?with_ospfapi:             %global with_ospfapi            1 }
 +%{!?with_irdp:                        %global with_irdp               1 }
 +%{!?with_rtadv:                       %global with_rtadv              1 }
- %{!?with_mpls:                        %global with_mpls               0 }
- %{!?with_ldpd:                        %global with_ldpd               0 }
++%{!?with_mpls:                        %global with_mpls               1 }
++%{!?with_ldpd:                        %global with_ldpd               1 }
 +%{!?with_nhrpd:                       %global with_nhrpd              1 }
 +%{!?with_shared:              %global with_shared             1 }
 +%{!?with_multipath:           %global with_multipath          256 }
 +%{!?frr_user:         %global frr_user                frr }
 +%{!?vty_group:                        %global vty_group               frrvty }
 +%{!?with_fpm:                 %global with_fpm                0 }
 +%{!?with_watchfrr:            %global with_watchfrr   1 }
 +%{!?with_bgp_vnc:             %global with_bgp_vnc            0 }
++%{!?with_pimd:                  %global with_pimd               1 }
  
  # path defines
 -%define     _sysconfdir   /etc/frr
 -%define     _sbindir      /usr/lib/frr
 -%define     zeb_src       %{_builddir}/%{name}-%{frrversion}
 -%define     zeb_rh_src    %{zeb_src}/redhat
 -%define     zeb_docs      %{zeb_src}/doc
 -%define     frr_tools     %{zeb_src}/tools
 +%define               _sysconfdir     /etc/frr
 +%define         _sbindir        /usr/lib/frr
 +%define               zeb_src         %{_builddir}/%{name}-%{frrversion}
 +%define               zeb_rh_src      %{zeb_src}/redhat
 +%define               zeb_docs        %{zeb_src}/doc
 +%define         frr_tools    %{zeb_src}/tools
 +%define         frr_tools_etc   %{frr_tools}/etc
  
  # defines for configure
- %define               _localstatedir  /var/run/frr
+ %define     _localstatedir  /var/run/frr
  ############################################################################
  
  #### Version String tweak
  %endif
  
  # misc internal defines
- %{!?frr_uid:          %global         frr_uid      92 }
- %{!?frr_gid:          %global         frr_gid      92 }
- %{!?vty_gid:          %global         vty_gid         85 }
+ %{!?frr_uid:            %global  frr_uid            92 }
+ %{!?frr_gid:            %global  frr_gid            92 }
+ %{!?vty_gid:            %global  vty_gid            85 }
  
 -%define     daemon_list zebra ripd ospfd bgpd isisd ripngd ospf6d
 +%define               daemon_list     zebra ripd ospfd bgpd isisd pimd ripngd ospf6d
  
  %if %{with_ldpd}
- %define         daemon_ldpd   ldpd
+ %define     daemon_ldpd ldpd
  %else
- %define               daemon_ldpd     ""
+ %define     daemon_ldpd ""
+ %endif
+ %if %{with_pimd}
+ %define     daemon_pimd pimd
+ %else
+ %define     daemon_pimd ""
  %endif
  
 +%if %{with_nhrpd}
 +%define         daemon_nhrpd  nhrpd
 +%else
 +%define               daemon_nhrpd    ""
 +%endif
 +
  %if %{with_watchfrr}
- %define         daemon_watchfrr       watchfrr
+ %define     daemon_watchfrr watchfrr
  %else
- %define               daemon_watchfrr ""
+ %define     daemon_watchfrr ""
  %endif
  
 -%define     all_daemons %{daemon_list} %{daemon_ldpd} %{daemon_pimd} %{daemon_watchfrr}
 +%define               all_daemons     %{daemon_list} %{daemon_ldpd} %{daemon_nhrpd} %{daemon_watchfrr}
  
  # allow build dir to be kept
- %{!?keep_build:               %global         keep_build      0 }
+ %{!?keep_build:         %global  keep_build         0 }
  
  #release sub-revision (the two digits after the CONFDATE)
- %{!?release_rev:      %global         release_rev     01 }
+ %{!?release_rev:        %global  release_rev        01 }
  
  Summary: Routing daemon
- Name:                 frr
- Version:              %{rpmversion}
- Release:              @CONFDATE@%{release_rev}%{?dist}
- License:              GPLv2+
- Group:                        System Environment/Daemons
- Source0:              http://www.frrouting.org/releases/frr/%{name}-%{frrversion}.tar.gz
- URL:                  http://www.frrouting.org
- Requires:             ncurses json-c
- Requires(pre):        /sbin/install-info
+ Name:           frr
+ Version:        %{rpmversion}
+ Release:        @CONFDATE@%{release_rev}%{?dist}
+ License:        GPLv2+
+ Group:          System Environment/Daemons
+ Source0:        http://www.frrouting.org/releases/frr/%{name}-%{frrversion}.tar.gz
+ URL:            http://www.frrouting.org
+ Requires(pre):  /sbin/install-info
  Requires(preun): /sbin/install-info
- Requires(post):       /sbin/install-info
- BuildRequires:        texi2html texinfo autoconf patch libcap-devel groff 
- BuildRequires:        readline readline-devel ncurses ncurses-devel
- BuildRequires:        json-c-devel bison flex
- Requires:             ncurses initscripts
+ Requires(post): /sbin/install-info
+ BuildRequires:  gcc texi2html texinfo patch libcap-devel groff
+ BuildRequires:  readline readline-devel ncurses ncurses-devel
+ BuildRequires:  json-c-devel bison >= 2.7 flex make
+ Requires:       ncurses json-c initscripts
  %if %{with_pam}
- BuildRequires:        pam-devel
- Requires:             pam
+ BuildRequires:  pam-devel
+ Requires:       pam
  %endif
  %if "%{initsystem}" == "systemd"
- BuildRequires:                systemd
- Requires(post):               systemd
- Requires(preun):      systemd
- Requires(postun):     systemd
+ BuildRequires:      systemd systemd-devel
+ Requires(post):     systemd
+ Requires(preun):    systemd
+ Requires(postun):   systemd
  %else
  # Initscripts > 5.60 is required for IPv6 support
- Requires(pre):                initscripts >= 5.60
+ Requires(pre):      initscripts >= 5.60
  %endif
- Provides:                     routingdaemon = %{version}-%{release}
- BuildRoot:                    %{_tmppath}/%{name}-%{version}-root
- Obsoletes:                    bird gated mrt zebra frr-sysvinit
+ Provides:           routingdaemon = %{version}-%{release}
+ BuildRoot:          %{_tmppath}/%{name}-%{version}-root
+ Obsoletes:          bird gated mrt zebra frr-sysvinit
  
  %description
  FRRouting is a free software that manages TCP/IP based routing
@@@ -181,81 -196,78 +206,83 @@@ developing OSPF-API and frr application
      --libdir=%{_libdir} \
      --libexecdir=%{_libexecdir} \
      --localstatedir=%{_localstatedir} \
-       --disable-werror \
+     --disable-werror \
  %if !%{with_shared}
-       --disable-shared \
+     --disable-shared \
  %endif
  %if %{with_multipath}
-       --enable-multipath=%{with_multipath} \
+     --enable-multipath=%{with_multipath} \
  %endif
  %if %{with_tcp_zebra}
-       --enable-tcp-zebra \
+     --enable-tcp-zebra \
  %endif
-       --enable-vtysh \
+     --enable-vtysh \
  %if %{with_ospfclient}
-       --enable-ospfclient=yes \
+     --enable-ospfclient \
  %else
-       --enable-ospfclient=no\
+     --disable-ospfclient\
  %endif
  %if %{with_ospfapi}
-       --enable-ospfapi=yes \
+     --enable-ospfapi=yes \
  %else
-       --enable-ospfapi=no \
+     --enable-ospfapi=no \
  %endif
  %if %{with_irdp}
-       --enable-irdp=yes \
+     --enable-irdp=yes \
  %else
-       --enable-irdp=no \
+     --enable-irdp=no \
  %endif
  %if %{with_rtadv}
-       --enable-rtadv=yes \
+     --enable-rtadv=yes \
  %else
-       --enable-rtadv=no \
+     --enable-rtadv=no \
  %endif
- %if %{with_mpls}
-       --enable-mpls=yes \
+ %if %{with_ldpd}
+     --enable-ldpd \
  %else
-       --disable-mpls \
+     --disable-ldpd \
  %endif
- %if %{with_ldpd}
-       --enable-ldpd \
+ %if %{with_pimd}
+     --enable-pimd \
  %else
-       --disable-ldpd \
+     --disable-pimd \
  %endif
 +%if %{with_nhrpd}
 +      --enable-nhrpd \
 +%else
 +      --disable-nhrpd \
 +%endif
  %if %{with_pam}
-       --with-libpam \
+     --with-libpam \
  %endif
  %if 0%{?frr_user:1}
-       --enable-user=%frr_user \
-       --enable-group=%frr_user \
+     --enable-user=%frr_user \
+     --enable-group=%frr_user \
  %endif
  %if 0%{?vty_group:1}
-       --enable-vty-group=%vty_group \
+     --enable-vty-group=%vty_group \
  %endif
  %if %{with_fpm}
-       --enable-fpm \
+     --enable-fpm \
  %else
-       --disable-fpm \
+     --disable-fpm \
  %endif
  %if %{with_watchfrr}
-       --enable-watchfrr \
+     --enable-watchfrr \
  %else
-       --disable-watchfrr \
+     --disable-watchfrr \
  %endif
  %if %{with_bgp_vnc}
-       --enable-bgp-vnc \
+     --enable-bgp-vnc \
  %else
-       --disable-bgp-vnc \
+     --disable-bgp-vnc \
+ %endif
+     --enable-gcc-rdynamic \
+     --enable-isisd=yes \
+ %if "%{initsystem}" == "systemd"
+     --enable-systemd=yes \
  %endif
-       --enable-gcc-rdynamic \
-       --enable-isisd=yes \
-       --enable-systemd=yes \
-       --enable-poll=yes
+     --enable-poll=yes
  
  make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
  
@@@ -279,25 -293,21 +308,23 @@@ rm -f %{buildroot}%{_sbindir}/fr
  # install /etc sources
  %if "%{initsystem}" == "systemd"
  mkdir -p %{buildroot}%{_unitdir}
- install %{frr_tools}/frr.service \
-       %{buildroot}%{_unitdir}/frr.service
+ install %{zeb_rh_src}/frr.service \
+     %{buildroot}%{_unitdir}/frr.service
+ install %{zeb_rh_src}/frr.init \
+     %{buildroot}%{_sbindir}/frr
  %else
  mkdir -p %{buildroot}/etc/rc.d/init.d
- for daemon in %{all_daemons} ; do
-       if [ x"${daemon}" != x"" ] ; then
-               install %{zeb_rh_src}/${daemon}.init \
-                       %{buildroot}/etc/rc.d/init.d/${daemon}
-       fi
- done
+ install %{zeb_rh_src}/frr.init \
+     %{buildroot}/etc/rc.d/init.d/frr
  %endif
  
 -install %{zeb_rh_src}/daemons %{buildroot}/etc/frr
 +install %{frr_tools_dir}/frr/daemons.conf %{buildroot}/etc/frr
 +install %{frr_tools_dir}/frr/daemons %{buildroot}/etc/frr
 +install -m644 %{frr_tools_dir}/default/frr %{buildroot}/etc/default
  install -m644 %{zeb_rh_src}/frr.pam \
-       %{buildroot}/etc/pam.d/frr
+     %{buildroot}/etc/pam.d/frr
  install -m644 %{zeb_rh_src}/frr.logrotate \
-       %{buildroot}/etc/logrotate.d/frr
+     %{buildroot}/etc/logrotate.d/frr
  install -d -m750  %{buildroot}/var/run/frr
  
  %pre
@@@ -348,10 -358,9 +375,12 @@@ zebra_spec_add_service ospf6d   2606/tc
  zebra_spec_add_service ospfapi  2607/tcp "OSPF-API"
  %endif
  zebra_spec_add_service isisd    2608/tcp "ISISd vty"
 +%if %{with_nhrpd}
 +zebra_spec_add_service nhrpd    2610/tcp "NHRPd vty"
 +%endif
+ %if %{with_pimd}
  zebra_spec_add_service pimd     2611/tcp "PIMd vty"
+ %endif
  %if %{with_ldpd}
  zebra_spec_add_service ldpd     2612/tcp "LDPd vty"
  %endif
@@@ -531,42 -489,27 +509,30 @@@ rm -rf %{buildroot
  %endif
  %{_sbindir}/ripngd
  %{_sbindir}/ospf6d
- %{_sbindir}/pimd
+ %if %{with_pimd}
+     %{_sbindir}/pimd
+ %endif
  %{_sbindir}/isisd
  %if %{with_ldpd}
- %{_sbindir}/ldpd
    %{_sbindir}/ldpd
  %endif
 +%if %{with_nhrpd}
 +%{_sbindir}/nhrpd
 +%endif
  %if %{with_shared}
- %attr(755,root,root) %{_libdir}/lib*.so
- %attr(755,root,root) %{_libdir}/lib*.so.*
+ %{_libdir}/lib*.so
+ %{_libdir}/lib*.so.0
+ %attr(755,root,root) %{_libdir}/lib*.so.0.*
  %endif
  %{_bindir}/*
- %config /etc/frr/[!v]*
+ %config(noreplace) /etc/frr/[!v]*.conf*
+ %config(noreplace) %attr(750,%frr_user,%frr_user) /etc/frr/daemons
  %if "%{initsystem}" == "systemd"
-       %config %{_unitdir}/frr.service
+     %config %{_unitdir}/frr.service
+     %{_sbindir}/frr
  %else
-       %config /etc/rc.d/init.d/zebra
-       %if %{with_watchfrr}
-               %config /etc/rc.d/init.d/watchfrr
-       %endif
-       %config /etc/rc.d/init.d/ripd
-       %config /etc/rc.d/init.d/ospfd
-       %config /etc/rc.d/init.d/bgpd
-       %config /etc/rc.d/init.d/ripngd
-       %config /etc/rc.d/init.d/ospf6d
-       %config /etc/rc.d/init.d/isisd
-       %config /etc/rc.d/init.d/pimd
-       %if %{with_ldpd}
-               %config /etc/rc.d/init.d/ldpd
-       %endif
-       %if %{with_nhrpd}
-               %config /etc/rc.d/init.d/nhrpd
-       %endif
- %endif
- %config(noreplace) /etc/default/frr
+     %config /etc/rc.d/init.d/frr
+ %endif
  %config(noreplace) /etc/pam.d/frr
  %config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
  
index 0b19a2ad232134e611f59775b1961620d3e30399,f6aa7eeab8c8f9f92bc607cd0ba5100961f0250d..3ff4a40965cb2fe4a4666140e87772020f9bfdb8
@@@ -662,73 -697,75 +662,71 @@@ static int handle_read(struct thread *t
   * Wait till we notice that all daemons are ready before
   * we send we are ready to systemd
   */
 -static void
 -daemon_send_ready (void)
 +static void daemon_send_ready(void)
  {
 -  static int sent = 0;
 -  if (!sent && gs.numdown == 0)
 -    {
 -      FILE *fp;
 -
 -      fp = fopen(DAEMON_VTY_DIR "/watchfrr.started", "w");
 -      fclose(fp);
 -      zlog_notice ("Watchfrr: Notifying Systemd we are up and running");
 -      systemd_send_started(master, 0);
 -      sent = 1;
 -    }
 +      static int sent = 0;
 +      if (!sent && gs.numdown == 0) {
- #if defined (HAVE_CUMULUS)
 +              FILE *fp;
 +
 +              fp = fopen(DAEMON_VTY_DIR "/watchfrr.started", "w");
 +              fclose(fp);
- #endif
 +              zlog_notice
 +                  ("Watchfrr: Notifying Systemd we are up and running");
 +              systemd_send_started(master, 0);
 +              sent = 1;
 +      }
  }
  
 -static void
 -daemon_up(struct daemon *dmn, const char *why)
 +static void daemon_up(struct daemon *dmn, const char *why)
  {
 -  dmn->state = DAEMON_UP;
 -  gs.numdown--;
 -  dmn->connect_tries = 0;
 -  zlog_notice("%s state -> up : %s",dmn->name,why);
 -  daemon_send_ready();
 -  if (gs.do_ping)
 -    SET_WAKEUP_ECHO(dmn);
 -  phase_check();
 +      dmn->state = DAEMON_UP;
 +      gs.numdown--;
 +      dmn->connect_tries = 0;
 +      zlog_notice("%s state -> up : %s", dmn->name, why);
 +      daemon_send_ready();
 +      if (gs.do_ping)
 +              SET_WAKEUP_ECHO(dmn);
 +      phase_check();
  }
  
 -static int
 -check_connect(struct thread *t_write)
 +static int check_connect(struct thread *t_write)
  {
 -  struct daemon *dmn = THREAD_ARG(t_write);
 -  int sockerr;
 -  socklen_t reslen = sizeof(sockerr);
 -
 -  dmn->t_write = NULL;
 -  if (getsockopt(dmn->fd,SOL_SOCKET,SO_ERROR,(char *)&sockerr,&reslen) < 0)
 -    {
 -      zlog_warn("%s: check_connect: getsockopt failed: %s",
 -              dmn->name,safe_strerror(errno));
 -      daemon_down(dmn,"getsockopt failed checking connection success");
 -      return 0;
 -    }
 -  if ((reslen == sizeof(sockerr)) && sockerr)
 -    {
 -      char why[100];
 -      snprintf(why,sizeof(why),
 -             "getsockopt reports that connection attempt failed: %s",
 -             safe_strerror(sockerr));
 -      daemon_down(dmn,why);
 -      return 0;
 -    }
 -
 -  daemon_up(dmn,"delayed connect succeeded");
 -  return 0;
 +      struct daemon *dmn = THREAD_ARG(t_write);
 +      int sockerr;
 +      socklen_t reslen = sizeof(sockerr);
 +
 +      dmn->t_write = NULL;
 +      if (getsockopt(dmn->fd, SOL_SOCKET, SO_ERROR, (char *)&sockerr, &reslen)
 +          < 0) {
 +              zlog_warn("%s: check_connect: getsockopt failed: %s", dmn->name,
 +                        safe_strerror(errno));
 +              daemon_down(dmn,
 +                          "getsockopt failed checking connection success");
 +              return 0;
 +      }
 +      if ((reslen == sizeof(sockerr)) && sockerr) {
 +              char why[100];
 +              snprintf(why, sizeof(why),
 +                       "getsockopt reports that connection attempt failed: %s",
 +                       safe_strerror(sockerr));
 +              daemon_down(dmn, why);
 +              return 0;
 +      }
 +
 +      daemon_up(dmn, "delayed connect succeeded");
 +      return 0;
  }
  
 -static int
 -wakeup_connect_hanging(struct thread *t_wakeup)
 +static int wakeup_connect_hanging(struct thread *t_wakeup)
  {
 -  struct daemon *dmn = THREAD_ARG(t_wakeup);
 -  char why[100];
 -
 -  dmn->t_wakeup = NULL;
 -  snprintf(why,sizeof(why),"connection attempt timed out after %ld seconds",
 -         gs.timeout);
 -  daemon_down(dmn,why);
 -  return 0;
 +      struct daemon *dmn = THREAD_ARG(t_wakeup);
 +      char why[100];
 +
 +      dmn->t_wakeup = NULL;
 +      snprintf(why, sizeof(why),
 +               "connection attempt timed out after %ld seconds", gs.timeout);
 +      daemon_down(dmn, why);
 +      return 0;
  }
  
  /* Making connection to protocol daemon. */