Browse Source

fix PR#176 set default daemon bind/listen address to 127.0.0.1

master
Thomas Lotterer 23 years ago committed by Ralf S. Engelschall
parent
commit
fd502411b0
  1. 14
      zebra/rc.zebra
  2. 35
      zebra/zebra.patch

14
zebra/rc.zebra

@ -6,6 +6,9 @@
%config
zebra_enable="$openpkg_rc_def"
zebra_protocols="rip ospf bgp"
zebra_flags=""
zebra_bind="127.0.0.1"
zebra_port="2601"
zebra_log_prolog="true"
zebra_log_epilog="true"
zebra_log_numfiles="10"
@ -28,8 +31,17 @@
%start -u @l_susr@
rcService zebra enable yes || exit 0
rcService zebra active yes && exit 0
flags="$zebra_flags"
echo $flags | grep -- -A >/dev/null
if [ $? -ne 0 -a ".$zebra_bind" != . ]; then
flags="$flags -A $zebra_bind"
fi
echo $flags | grep -- -P >/dev/null
if [ $? -ne 0 -a ".$zebra_port" != . ]; then
flags="$flags -P $zebra_port"
fi
cd @l_prefix@/etc/zebra
@l_prefix@/sbin/zebra -d
@l_prefix@/sbin/zebra -d $flags
for protocol in $zebra_protocols; do
if [ -f @l_prefix@/sbin/${protocol}d ]; then
@l_prefix@/sbin/${protocol}d -d

35
zebra/zebra.patch

@ -194,3 +194,38 @@ Index: ospfd/ospf_packet.c
return 0;
/* Generate a digest for the ospf packet - their digest + our digest. */
On systems which do not HAVE_IPV6 or where configure was run with
--disable-ipv6 zebra 0.93b ignores the hostname specified with the -A
option and only recognizes the port specified with the -P option. This
happens with FreeBSD as mentioned by Mike Tancsa in his posting
http://marc.theaimsgroup.com/?l=zebra&m=105118701805977 on the zebra
mailing list but the issue is not limited to this OS. This patch enables
the specification of hostname on systems which HAVE_GETADDRINFO
regardless of the IP version. This fixes the problem on FreeBSD and
possibly other OSs. Tested on FreeBSD 4.8, RedHat 9 and Solaris 9.
2003-07-24 thomas@lotterer.net
--- lib/vty.c.orig 2002-08-18 16:49:50.000000000 +0200
+++ lib/vty.c 2003-07-24 21:41:24.000000000 +0200
@@ -1700,7 +1700,7 @@
return 0;
}
-#if defined(HAVE_IPV6) && !defined(NRL)
+#if (defined(HAVE_IPV6) && !defined(NRL)) || defined (HAVE_GETADDRINFO)
void
vty_serv_sock_addrinfo (const char *hostname, unsigned short port)
{
@@ -1972,7 +1972,11 @@
vty_serv_sock_addrinfo (hostname, port);
#endif /* NRL*/
#else /* ! HAVE_IPV6 */
+#ifdef HAVE_GETADDRINFO
+ vty_serv_sock_addrinfo (hostname, port);
+#else /* ! HAVE_GETADDRINFO */
vty_serv_sock_family (port, AF_INET);
+#endif /* HAVE_GETADDRINFO */
#endif /* HAVE_IPV6 */
}

Loading…
Cancel
Save