From owner-freebsd-ports-bugs@FreeBSD.ORG Thu May 19 07:40:03 2005 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28BA516A4CE for ; Thu, 19 May 2005 07:40:03 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8689443D98 for ; Thu, 19 May 2005 07:40:02 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j4J7e21Q072737 for ; Thu, 19 May 2005 07:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j4J7e2g5072736; Thu, 19 May 2005 07:40:02 GMT (envelope-from gnats) Resent-Date: Thu, 19 May 2005 07:40:02 GMT Resent-Message-Id: <200505190740.j4J7e2g5072736@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, dikshie Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4739E16A4CE for ; Thu, 19 May 2005 07:30:12 +0000 (GMT) Received: from mx-itb.geoph.ITB.ac.id (mx7.ITB.ac.id [167.205.30.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8DC143D31 for ; Thu, 19 May 2005 07:30:03 +0000 (GMT) (envelope-from dikshie@linux.ocean.itb.ac.id) Received: from antivirus.itb.ac.id (antivirus.ITB.ac.id [167.205.108.137]) by mx-itb.geoph.ITB.ac.id (Postfix) with SMTP id 3073E20AA6 for ; Thu, 19 May 2005 14:29:59 +0700 (WIT) Received: from linux.ocean.itb.ac.id (linux.ocean.itb.ac.id [167.205.37.2]) by mx-itb.geoph.ITB.ac.id (Postfix) with ESMTP id E9D3420AA4 for ; Thu, 19 May 2005 14:29:58 +0700 (WIT) Received: from dikshie by linux.ocean.itb.ac.id with local (Exim 4.51 (FreeBSD)) id 1DYfTt-0003Po-Tk for FreeBSD-gnats-submit@freebsd.org; Thu, 19 May 2005 14:30:09 +0700 Message-Id: Date: Thu, 19 May 2005 14:30:09 +0700 From: dikshie Sender: dikshie To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/81247: [UPDATE] net/zebra from zebra-0.94 to zebra-0.95 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: dikshie List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2005 07:40:03 -0000 >Number: 81247 >Category: ports >Synopsis: [UPDATE] net/zebra from zebra-0.94 to zebra-0.95 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Thu May 19 07:40:02 GMT 2005 >Closed-Date: >Last-Modified: >Originator: dikshie >Release: FreeBSD 5.4-STABLE i386 >Organization: Institut Teknologi Bandung, Indonesia >Environment: System: FreeBSD linux.ocean.itb.ac.id 5.4-STABLE FreeBSD 5.4-STABLE #0: Tue May 10 11:21:51 WIT 2005 dikshie@linux.ocean.itb.ac.id:/usr/obj/usr/src/sys/OCEAN i386 >Description: >How-To-Repeat: >Fix: --- zebra-update-shar.txt begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # zebra # zebra/Makefile # zebra/pkg-descr # zebra/distinfo # zebra/pkg-plist # zebra/files # zebra/files/pkg-message.in # zebra/files/zebractl.sh # zebra/files/patch-configure # zebra/files/patch-ioctl # zebra/files/patch-zebra-Makefile.in # zebra/files/patch-ripd # zebra/files/patch-ospf # echo c - zebra mkdir -p zebra > /dev/null 2>&1 echo x - zebra/Makefile sed 's/^X//' >zebra/Makefile << 'END-of-zebra/Makefile' X# New ports collection makefile for: zebra X# Date created: So 31 Mai 1998 11:00:30 CEST X# Whom: Andreas Klemm X# X# $FreeBSD: ports/net/zebra/Makefile,v 1.80 2005/04/15 15:39:59 sumikawa Exp $ X# X XPORTNAME= zebra XPORTVERSION= 0.95 XPORTREVISION= 1 XCATEGORIES= net ipv6 XMASTER_SITES= ftp://ftp.zebra.org/pub/zebra/ \ X ftp://ftp.ripe.net/mirrors/sites/ftp.zebra.org/pub/zebra/ \ X ftp://ftp.sunet.se/pub/network/zebra/ \ X ftp://6bone.informatik.uni-leipzig.de/pub/ftp.zebra.org/pub/zebra/ \ X ftp://ftp.pop-pr.rnp.br/pub/GNU/ftp.zebra.org/zebra/ X XMAINTAINER= sumikawa@FreeBSD.org XCOMMENT= Free RIPv1, RIPv2, OSPFv2, BGP4 route software (server/reflector) X XPKGMESSAGE= ${WRKDIR}/pkg-message XSUB_FILES= pkg-message XUSE_SUBMAKE= yes XGNU_CONFIGURE= yes XCONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc/zebra XSCRIPTS_ENV= WRKDIRPREFIX=${WRKDIRPREFIX} X XOPTIONS= IPV6 "enable IPv6 support" on \ X LIBPAM "enable PAM authentication for vtysh" off \ X OSPFNSSA "turn on undergoing NSSA feature" off \ X SNMP "enable SNMP support" off \ X TCPZEBRA "enable TCP/IP socket connection" off \ X BGPD "enable BGPD" on \ X OSPF6D "enable OSPF6D" on \ X OSPFD "enable OSPFD" on \ X RIPD "enable RIPD" on \ X RIPNGD "enable RIPNGD" on \ X VTYSH "enable VTYSH" on X XMAN1= vtysh.1 XMAN8= bgpd.8 ospf6d.8 ospfd.8 ripd.8 ripngd.8 zebra.8 XINFO= zebra X X.include X X.if defined (WITHOUT_IPV6) XCONFIGURE_ARGS+=--disable-ipv6 XWITHOUT_OSPF6D= yes XWITHOUT_RIPNGD= yes X.endif X X.if defined (WITH_LIBPAM) XCONFIGURE_ARGS+=--with-libpam X.endif X X.if defined (WITH_OSPFNSSA) XCONFIGURE_ARGS+=--enable-nssa X.endif X X.if defined (WITH_SNMP) XCONFIGURE_ARGS+=--enable-snmp XLIB_DEPENDS+=snmp.4:${PORTSDIR}/net-mgmt/net-snmp4:install X.endif X X.if defined (WITH_TCPZEBRA) XCONFIGURE_ARGS+=--enable-tcp-zebra X.endif X X.if !defined(WITHOUT_BGPD) XPLIST_SUB+= BGPD="" X.else XCONFIGURE_ARGS+=--disable-bgpd XPLIST_SUB+= BGPD="@comment " X.endif X X.if !defined(WITHOUT_OSPF6D) XPLIST_SUB+= OSPF6D="" X.else XCONFIGURE_ARGS+=--disable-ospf6d XPLIST_SUB+= OSPF6D="@comment " X.endif X X.if !defined(WITHOUT_OSPFD) XPLIST_SUB+= OSPF6D="" XPLIST_SUB+= OSPFD="" X.else XCONFIGURE_ARGS+=--disable-ospfd XPLIST_SUB+= OSPFD="@comment " X.endif X X.if !defined(WITHOUT_RIPD) XPLIST_SUB+= RIPD="" X.else XCONFIGURE_ARGS+=--disable-ripd XPLIST_SUB+= RIPD="@comment " X.endif X X.if !defined(WITHOUT_RIPNGD) XPLIST_SUB+= RIPNGD="" X.else XCONFIGURE_ARGS+=--disable-ripngd XPLIST_SUB+= RIPNGD="@comment " X.endif X X.if !defined(WITHOUT_VTYSH) XPLIST_SUB+= VTYSH="" XCONFIGURE_ARGS+=--enable-vtysh X.else XPLIST_SUB+= VTYSH="@comment " X.endif X Xpost-install: X @( cd ${WRKSRC}/doc; ${RM} -f zebra*info*; ${MAKE} zebra.info install ) X @${ECHO} "===> installing zebra startup file..." X @${SED} -e "s=!!PREFIX!!=${PREFIX}=" \ X < ${FILESDIR}/zebractl.sh \ X > ${PREFIX}/sbin/zebractl X @${CHMOD} 555 ${PREFIX}/sbin/zebractl X @${ECHO} "done." X @${CAT} ${PKGMESSAGE} X X.include END-of-zebra/Makefile echo x - zebra/pkg-descr sed 's/^X//' >zebra/pkg-descr << 'END-of-zebra/pkg-descr' XGNU Zebra is a free software (distributed under GNU Generic Public XLicense) which manages TCP/IP based routing protocols. X XIt supports BGP-4 protocol as described in RFC1771 (A Border Gateway XProtocol 4) and RIPv1, RIPv2 and OSPFv2. X XZebra uses multithread technology under multithread supported UNIX Xkernels. However it can be run under not-multithread supported XUNIX kernels. X XZebra is intended to be used as a Route Server and a Route Reflector. XZebra is not a toolkit, it provides full routing power under a new Xarchitecture. X XWWW: http://www.zebra.org/ END-of-zebra/pkg-descr echo x - zebra/distinfo sed 's/^X//' >zebra/distinfo << 'END-of-zebra/distinfo' XMD5 (zebra-0.95.tar.gz) = 44f402c90fd353b2c6a6ecb70ee70ba1 XSIZE (zebra-0.95.tar.gz) = 1379369 END-of-zebra/distinfo echo x - zebra/pkg-plist sed 's/^X//' >zebra/pkg-plist << 'END-of-zebra/pkg-plist' X%%BGPD%%sbin/bgpd X%%OSPF6D%%sbin/ospf6d X%%OSPFD%%sbin/ospfd X%%RIPD%%sbin/ripd X%%RIPNGD%%sbin/ripngd Xsbin/zebra Xsbin/zebractl X%%VTYSH%%bin/vtysh X%%BGPD%%etc/zebra/bgpd.conf.sample X%%BGPD%%etc/zebra/bgpd.conf.sample2 X%%OSPF6D%%etc/zebra/ospf6d.conf.sample X%%OSPFD%%etc/zebra/ospfd.conf.sample X%%RIPD%%etc/zebra/ripd.conf.sample X%%RIPNGD%%etc/zebra/ripngd.conf.sample X%%VTYSH%%etc/zebra/vtysh.conf.sample Xetc/zebra/zebra.conf.sample X@dirrm etc/zebra END-of-zebra/pkg-plist echo c - zebra/files mkdir -p zebra/files > /dev/null 2>&1 echo x - zebra/files/pkg-message.in sed 's/^X//' >zebra/files/pkg-message.in << 'END-of-zebra/files/pkg-message.in' XTo run zebra you should add in your /etc/rc.conf these lines: X Xdefaultrouter="NO" Xrouter_enable="YES" Xrouter="%%PREFIX%%/sbin/zebractl" Xrouter_flags="start" END-of-zebra/files/pkg-message.in echo x - zebra/files/zebractl.sh sed 's/^X//' >zebra/files/zebractl.sh << 'END-of-zebra/files/zebractl.sh' X#! /bin/sh X# X# $FreeBSD: ports/net/zebra/files/zebractl.sh,v 1.8 2002/08/04 20:04:50 sumikawa Exp $ X# X# zebra start/stop script by "Andreas Klemm " X# X Xusage() X{ X echo "$0: usage: $0 [ start | stop | restart ]" X exit 1 X} X Xif [ $# -lt 1 ]; then X echo "$0: error: one argument needed"; usage Xelif [ $# -gt 1 ]; then X echo "$0: error: only one argument needed"; usage Xfi X Xcase $1 in X start) X if [ ! -f !!PREFIX!!/etc/zebra/zebra.conf ]; then X echo "error: zebra.conf config file is mandatory" X exit 1 X fi X [ -f !!PREFIX!!/etc/zebra/zebra.conf ] \ X && !!PREFIX!!/sbin/zebra -d && echo -n ' zebra' X [ -f !!PREFIX!!/etc/zebra/ripd.conf ] \ X && !!PREFIX!!/sbin/ripd -d && echo -n ' ripd' X [ -f !!PREFIX!!/etc/zebra/ripngd.conf ] \ X && !!PREFIX!!/sbin/ripngd -d && echo -n ' ripngd' X [ -f !!PREFIX!!/etc/zebra/ospfd.conf ] \ X && !!PREFIX!!/sbin/ospfd -d && echo -n ' ospfd' X [ -f !!PREFIX!!/etc/zebra/ospf6d.conf ] \ X && !!PREFIX!!/sbin/ospf6d -d && echo -n ' ospf6d' X [ -f !!PREFIX!!/etc/zebra/bgpd.conf ] \ X && !!PREFIX!!/sbin/bgpd -d && echo -n ' bgpd' X ;; X X stop) X [ -f !!PREFIX!!/etc/zebra/ripd.conf ] && killall ripd X [ -f !!PREFIX!!/etc/zebra/ripngd.conf ] && killall ripngd X [ -f !!PREFIX!!/etc/zebra/ospfd.conf ] && killall ospfd X [ -f !!PREFIX!!/etc/zebra/ospf6d.conf ] && killall ospf6d X [ -f !!PREFIX!!/etc/zebra/bgpd.conf ] && killall bgpd X [ -f !!PREFIX!!/etc/zebra/zebra.conf ] && killall zebra X ;; X restart) X $0 stop X $0 start X ;; X X *) echo "$0: error: unknown option $1" X usage X ;; Xesac Xexit 0 END-of-zebra/files/zebractl.sh echo x - zebra/files/patch-configure sed 's/^X//' >zebra/files/patch-configure << 'END-of-zebra/files/patch-configure' X--- configure.orig Thu May 19 11:13:47 2005 X+++ configure Thu May 19 11:15:55 2005 X@@ -436,7 +436,7 @@ X -host | --host | --hos | --ho) X ac_prev=host_alias ;; X -host=* | --host=* | --hos=* | --ho=*) X- host_alias=$ac_optarg ;; X+ Host_alias=$ac_optarg ;; X X -includedir | --includedir | --includedi | --included | --include \ X | --includ | --inclu | --incl | --inc) X@@ -5772,6 +5772,8 @@ X zebra_ipforward_path="proc";; X "/dev/ip") X case "$host" in X+ *-freebsd-*) IPFORWARD=ipforward_sysctl.o X+ zebra_ipforward_path="sysctl";; X *-linux-*) IPFORWARD=ipforward_proc.o X zebra_ipforward_path="proc";; X *-nec-sysv4*) IPFORWARD=ipforward_ews.o END-of-zebra/files/patch-configure echo x - zebra/files/patch-ioctl sed 's/^X//' >zebra/files/patch-ioctl << 'END-of-zebra/files/patch-ioctl' X--- zebra/ioctl.c.original Thu May 19 11:19:30 2005 X+++ zebra/ioctl.c Thu May 19 11:22:11 2005 X@@ -349,6 +349,7 @@ X int ret; X struct ifreq ifreq; X X+ bzero(&ifreq, sizeof(struct ifreq)); X ifreq_set_name (&ifreq, ifp); X X ifreq.ifr_flags = ifp->flags; X@@ -370,7 +371,8 @@ X { X int ret; X struct ifreq ifreq; X- X+ X+ bzero(&ifreq, sizeof(struct ifreq)); X ifreq_set_name (&ifreq, ifp); X X ifreq.ifr_flags = ifp->flags; X@@ -473,7 +475,10 @@ X mask.sin6_len = sizeof (struct sockaddr_in6); X #endif X memcpy (&addreq.ifra_prefixmask, &mask, sizeof (struct sockaddr_in6)); X- X+ X+ addreq.ifra_lifetime.ia6t_vltime = 0xffffffff; X+ addreq.ifra_lifetime.ia6t_pltime = 0xffffffff; X+ X addreq.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; X addreq.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME; X END-of-zebra/files/patch-ioctl echo x - zebra/files/patch-zebra-Makefile.in sed 's/^X//' >zebra/files/patch-zebra-Makefile.in << 'END-of-zebra/files/patch-zebra-Makefile.in' X--- zebra/Makefile.in.original Thu May 19 11:25:15 2005 X+++ zebra/Makefile.in Thu May 19 11:26:02 2005 X@@ -411,7 +411,7 @@ X X X #client : client_main.o ../lib/libzebra.a X-# $(CC) -g -o client client_main.o ../lib/libzebra.a $(LIBS) $(LIB_IPV6) X+# $(CC) -o client client_main.o ../lib/libzebra.a $(LIBS) $(LIB_IPV6) X X install-sysconfDATA: $(sysconf_DATA) X @$(NORMAL_INSTALL) END-of-zebra/files/patch-zebra-Makefile.in echo x - zebra/files/patch-ripd sed 's/^X//' >zebra/files/patch-ripd << 'END-of-zebra/files/patch-ripd' X--- lib/if.c.original Thu May 19 14:05:16 2005 X+++ lib/if.c Thu May 19 13:19:42 2005 X@@ -553,6 +553,65 @@ X return NULL; X } X X+/* Find the IPv4 address on our side that will be used when packets X+ are sent to dst. */ X+struct connected * X+connected_lookup_address (struct interface *ifp, struct in_addr dst) X+{ X+ struct prefix addr; X+ struct prefix best; X+ listnode cnode; X+ struct prefix *p; X+ struct connected *c; X+ struct connected *match; X+ X+ /* Zero structures - get rid of rubbish from stack */ X+ memset(&addr, 0, sizeof(addr)); X+ memset(&best, 0, sizeof(best)); X+ X+ addr.family = AF_INET; X+ addr.u.prefix4 = dst; X+ addr.prefixlen = IPV4_MAX_BITLEN; X+ X+ match = NULL; X+ X+ for (cnode = listhead (ifp->connected); cnode; nextnode (cnode)) X+ { X+ c = getdata (cnode); X+ X+ if (if_is_pointopoint (ifp)) X+ { X+ p = c->address; X+ X+ if (p && p->family == AF_INET) X+ { X+#ifdef OLD_RIB /* PTP links are conventionally identified X+ by the address of the far end - MAG */ X+ if (IPV4_ADDR_SAME (&p->u.prefix4, &dst)) X+ return c; X+#endif X+ p = c->destination; X+ if (p && IPV4_ADDR_SAME (&p->u.prefix4, &dst)) X+ return c; X+ } X+ } X+ else X+ { X+ p = c->address; X+ X+ if (p->family == AF_INET) X+ { X+ if (prefix_match (p, &addr) && p->prefixlen > best.prefixlen) X+ { X+ best = *p; X+ match = c; X+ } X+ } X+ } X+ } X+ return match; X+} X+ X /* Check the connected information is PtP style or not. */ X int X ifc_pointopoint (struct connected *ifc) X--- lib/if.h.original Thu May 19 13:20:01 2005 X+++ lib/if.h Thu May 19 13:21:48 2005 X@@ -202,6 +202,7 @@ X void connected_free (struct connected *); X void connected_add (struct interface *, struct connected *); X struct connected *connected_delete_by_prefix (struct interface *, struct prefix *); X+struct connected *connected_lookup_address (struct interface *, struct in_addr); X int ifc_pointopoint (struct connected *); X X #ifndef HAVE_IF_NAMETOINDEX X--- ripd/ripd.c.original Thu May 19 13:22:50 2005 X+++ ripd/ripd.c Thu May 19 14:03:39 2005 X@@ -51,12 +51,13 @@ X X /* RIP queries. */ X long rip_global_queries = 0; X- X+ X /* Prototypes. */ X void rip_event (enum rip_event, int); X X-void rip_output_process (struct interface *, struct sockaddr_in *, X- int, u_char); X+void rip_output_process (struct interface *, struct prefix *, X+ struct sockaddr_in *, int, u_char); X+ X X /* RIP output routes type. */ X enum X@@ -971,7 +972,14 @@ X { X caddr_t lim; X struct rte *rte; X- X+ struct prefix_ipv4 ifaddr; X+ struct prefix_ipv4 ifaddrclass; X+ struct connected *c; X+ int subnetted; X+ X+ /* We don't know yet. */ X+ subnetted = -1; X+ X /* The Response must be ignored if it is not from the RIP X port. (RFC2453 - Sec. 3.9.2)*/ X if (ntohs (from->sin_port) != RIP_PORT_DEFAULT) X@@ -1124,25 +1132,52 @@ X { X u_int32_t destination; X X- destination = ntohl (rte->prefix.s_addr); X- X- if (destination & 0xff) X- { X- masklen2ip (32, &rte->mask); X- } X- else if ((destination & 0xff00) || IN_CLASSC (destination)) X+ if (subnetted == -1) X { X- masklen2ip (24, &rte->mask); X- } X- else if ((destination & 0xff0000) || IN_CLASSB (destination)) X- { X- masklen2ip (16, &rte->mask); X- } X+ c = connected_lookup_address (ifp, from->sin_addr); X+ if (c != NULL) X+ { X+ memcpy (&ifaddr, c->address, sizeof (struct prefix_ipv4)); X+ memcpy (&ifaddrclass, &ifaddr, sizeof (struct prefix_ipv4)); X+ apply_classful_mask_ipv4 (&ifaddrclass); X+ subnetted = 0; X+ if (ifaddr.prefixlen > ifaddrclass.prefixlen) X+ subnetted = 1; X+ } X+ } X+ destination = ntohl (rte->prefix.s_addr); X+ X+ if (IN_CLASSA (destination)) X+ masklen2ip (8, &rte->mask); X+ else if (IN_CLASSB (destination)) X+ masklen2ip (16, &rte->mask); X+ else if (IN_CLASSC (destination)) X+ masklen2ip (24, &rte->mask); X+ X+ if (subnetted == 1) X+ masklen2ip (ifaddrclass.prefixlen, X+ (struct in_addr *) &destination); X+ if ((subnetted == 1) && ((rte->prefix.s_addr & destination) == X+ ifaddrclass.prefix.s_addr)) X+ { X+ masklen2ip (ifaddr.prefixlen, &rte->mask); X+ if ((rte->prefix.s_addr & rte->mask.s_addr) != rte->prefix.s_addr) X+ masklen2ip (32, &rte->mask); X+ if (IS_RIP_DEBUG_EVENT) X+ zlog_info ("Subnetted route %s", inet_ntoa (rte->prefix)); X+ } X else X { X- masklen2ip (8, &rte->mask); X+ if ((rte->prefix.s_addr & rte->mask.s_addr) != rte->prefix.s_addr) X+ continue; X } X- } X+ X+ if (IS_RIP_DEBUG_EVENT) X+ { X+ zlog_info ("Resultant route %s", inet_ntoa (rte->prefix)); X+ zlog_info ("Resultant mask %s", inet_ntoa (rte->mask)); X+ } X+ } X X /* In case of RIPv2, if prefix in RTE is not netmask applied one X ignore the entry. */ X@@ -1371,7 +1406,7 @@ X ntohl (rte->metric) == RIP_METRIC_INFINITY) X { X /* All route with split horizon */ X- rip_output_process (ifp, from, rip_all_route, packet->version); X+ rip_output_process (ifp, NULL, from, rip_all_route, packet->version); X } X else X { X@@ -1903,8 +1938,9 @@ X X /* Send update to the ifp or spcified neighbor. */ X void X-rip_output_process (struct interface *ifp, struct sockaddr_in *to, X- int route_type, u_char version) X+rip_output_process (struct interface *ifp, struct prefix *ifaddr, X+ struct sockaddr_in *to, int route_type, u_char version) X+ X { X int ret; X struct stream *s; X@@ -1913,8 +1949,11 @@ X struct rip_interface *ri; X struct prefix_ipv4 *p; X struct prefix_ipv4 classfull; X+ struct prefix_ipv4 ifaddrclass; X+ struct connected *c; X int num; X int rtemax; X+ int subnetted; X X /* Logging output event. */ X if (IS_RIP_DEBUG_EVENT) X@@ -1962,32 +2001,64 @@ X } X else X if (ri->auth_str) X- rtemax -=1; X+ rtemax -=1; X } X X+ if (version == RIPv1) X+ { X+ if (ifaddr == NULL) X+ { X+ c = connected_lookup_address (ifp, to->sin_addr); X+ if (c != NULL) X+ ifaddr = c->address; X+ } X+ if (ifaddr == NULL) X+ { X+ zlog_warn ("cannot find source address for packets to neighbor %s", X+ inet_ntoa (to->sin_addr)); X+ return; X+ } X+ memcpy (&ifaddrclass, ifaddr, sizeof (struct prefix_ipv4)); X+ apply_classful_mask_ipv4 (&ifaddrclass); X+ subnetted = 0; X+ if (ifaddr->prefixlen > ifaddrclass.prefixlen) X+ subnetted = 1; X+ } X+ X for (rp = route_top (rip->table); rp; rp = route_next (rp)) X if ((rinfo = rp->info) != NULL) X { X- /* Some inheritance stuff: */ X- /* Before we process with ipv4 prefix we should mask it */ X- /* with Classful mask if we send RIPv1 packet.That's because */ X- /* user could set non-classful mask or we could get it by RIPv2 */ X- /* or other protocol. checked with Cisco's way of life :) */ X- X+ /* For RIPv1, if we are subnetted, output subnets in our network */ X+ /* that have the same mask as the output "interface". For other */ X+ /* networks, only the classfull version is output. */ X+ X if (version == RIPv1) X { X- memcpy (&classfull, &rp->p, sizeof (struct prefix_ipv4)); X+ p = (struct prefix_ipv4 *) &rp->p; X X if (IS_RIP_DEBUG_PACKET) X- zlog_info("%s/%d before RIPv1 mask check ", X- inet_ntoa (classfull.prefix), classfull.prefixlen); X+ zlog_info("RIPv1 mask check, %s/%d considered for output", X+ inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen); X X- apply_classful_mask_ipv4 (&classfull); X- p = &classfull; X+ if (subnetted && X+ prefix_match ((struct prefix *) &ifaddrclass, &rp->p)) X+ { X+ if ((ifaddr->prefixlen != rp->p.prefixlen) && X+ (rp->p.prefixlen != 32)) X+ continue; X+ } X+ else X+ { X+ memcpy (&classfull, &rp->p, sizeof(struct prefix_ipv4)); X+ apply_classful_mask_ipv4(&classfull); X+ if (rp->p.u.prefix4.s_addr != 0 && X+ classfull.prefixlen != rp->p.prefixlen) X+ continue; X+ } X X if (IS_RIP_DEBUG_PACKET) X- zlog_info("%s/%d after RIPv1 mask check", X- inet_ntoa (p->prefix), p->prefixlen); X+ zlog_info("RIPv1 mask check, %s/%d made it through", X+ inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen); X } X else X p = (struct prefix_ipv4 *) &rp->p; X@@ -2128,7 +2199,7 @@ X if (IS_RIP_DEBUG_EVENT) X zlog_info ("multicast announce on %s ", ifp->name); X X- rip_output_process (ifp, NULL, route_type, version); X+ rip_output_process (ifp, NULL, NULL, route_type, version); X return; X } X X@@ -2155,7 +2226,8 @@ X if_is_pointopoint (ifp) ? "unicast" : "broadcast", X inet_ntoa (to.sin_addr), ifp->name); X X- rip_output_process (ifp, &to, route_type, version); X+ rip_output_process (ifp, connected->address, &to, route_type, X+ version); X } X } X } X@@ -2244,6 +2316,7 @@ X X /* RIP version is rip's configuration. */ X rip_output_process (ifp, &to, route_type, rip->version); X+ rip_output_process (ifp, NULL, &to, route_type, rip->version); X } X } X END-of-zebra/files/patch-ripd echo x - zebra/files/patch-ospf sed 's/^X//' >zebra/files/patch-ospf << 'END-of-zebra/files/patch-ospf' X--- ospfd/ospf_packet.c.original Thu May 19 14:22:55 2005 X+++ ospfd/ospf_packet.c Thu May 19 14:23:32 2005 X@@ -270,7 +270,7 @@ X ospfh = (struct ospf_header *) ibuf; X X /* Get pointer to the end of the packet. */ X- pdigest = ibuf + length; X+ pdigest = (unsigned char *)ibuf + length; X X /* Get secret key. */ X ck = ospf_crypt_key_lookup (OSPF_IF_PARAM (oi, auth_crypt), END-of-zebra/files/patch-ospf exit --- zebra-update-shar.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted: