|
|
--- ripd/ripd.c |
|
|
+++ ripd/ripd.c |
|
|
@@ -51,6 +51,10 @@ |
|
|
|
|
|
/* RIP queries. */ |
|
|
long rip_global_queries = 0; |
|
|
+ |
|
|
+/* Should we trust netmasks or rather apply_classful_mask_ipv4() |
|
|
+ in rip_output_process() ? */ |
|
|
+char rip_should_trust_netmasks = 0; |
|
|
|
|
|
/* Prototypes. */ |
|
|
void rip_event (enum rip_event, int); |
|
|
@@ -1963,7 +1967,9 @@ |
|
|
zlog_info("%s/%d before RIPv1 mask check ", |
|
|
inet_ntoa (classfull.prefix), classfull.prefixlen); |
|
|
|
|
|
- apply_classful_mask_ipv4 (&classfull); |
|
|
+ if (!rip_should_trust_netmasks) |
|
|
+ apply_classful_mask_ipv4 (&classfull); |
|
|
+ |
|
|
p = &classfull; |
|
|
|
|
|
if (IS_RIP_DEBUG_PACKET) |
|
|
@@ -2705,6 +2711,26 @@ |
|
|
|
|
|
return CMD_SUCCESS; |
|
|
} |
|
|
+ |
|
|
+DEFUN (rip_trust_netmasks, |
|
|
+ rip_trust_netmasks_cmd, |
|
|
+ "trust netmasks", |
|
|
+ "Tell Zebra to trust netmasks and not to recalculate them.\n" |
|
|
+ "Netmasks will be trusted.\n") |
|
|
+{ |
|
|
+ rip_should_trust_netmasks = 1; |
|
|
+ return CMD_SUCCESS; |
|
|
+} |
|
|
+ |
|
|
+DEFUN (no_rip_trust_netmasks, |
|
|
+ no_rip_trust_netmasks_cmd, |
|
|
+ "no trust netmasks", |
|
|
+ "Tell Zebra not to trust netmasks and recalculate them.\n" |
|
|
+ "Netmasks will be recalculated.\n") |
|
|
+{ |
|
|
+ rip_should_trust_netmasks = 0; |
|
|
+ return CMD_SUCCESS; |
|
|
+} |
|
|
|
|
|
struct route_table *rip_distance_table; |
|
|
|
|
|
@@ -3503,6 +3529,8 @@ |
|
|
install_element (RIP_NODE, &no_rip_distance_source_cmd); |
|
|
install_element (RIP_NODE, &rip_distance_source_access_list_cmd); |
|
|
install_element (RIP_NODE, &no_rip_distance_source_access_list_cmd); |
|
|
+ install_element (RIP_NODE, &rip_trust_netmasks_cmd); |
|
|
+ install_element (RIP_NODE, &no_rip_trust_netmasks_cmd); |
|
|
|
|
|
/* Debug related init. */ |
|
|
rip_debug_init (); |
|
|
--- zebra/ioctl.c.orig Tue Oct 23 11:31:29 2001 |
|
|
+++ zebra/ioctl.c Fri Oct 4 19:45:04 2002 |
|
|
@@ -349,6 +349,7 @@ |
|
|
int ret; |
|
|
struct ifreq ifreq; |
|
|
|
|
|
+ bzero(&ifreq, sizeof(struct ifreq)); |
|
|
ifreq_set_name (&ifreq, ifp); |
|
|
|
|
|
ifreq.ifr_flags = ifp->flags; |
|
|
@@ -371,6 +372,7 @@ |
|
|
int ret; |
|
|
struct ifreq ifreq; |
|
|
|
|
|
+ bzero(&ifreq, sizeof(struct ifreq)); |
|
|
ifreq_set_name (&ifreq, ifp); |
|
|
|
|
|
ifreq.ifr_flags = ifp->flags; |
|
|
@@ -473,6 +475,9 @@ |
|
|
mask.sin6_len = sizeof (struct sockaddr_in6); |
|
|
#endif |
|
|
memcpy (&addreq.ifra_prefixmask, &mask, sizeof (struct sockaddr_in6)); |
|
|
+ |
|
|
+ addreq.ifra_lifetime.ia6t_vltime = 0xffffffff; |
|
|
+ addreq.ifra_lifetime.ia6t_pltime = 0xffffffff; |
|
|
|
|
|
addreq.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; |
|
|
addreq.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME; |
|
|
--- lib/vty.h.orig Sun Aug 18 16:34:00 2002 |
|
|
+++ lib/vty.h Wed Mar 12 11:10:05 2003 |
|
|
@@ -128,7 +128,7 @@ |
|
|
}; |
|
|
|
|
|
/* Integrated configuration file. */ |
|
|
-#define INTEGRATE_DEFAULT_CONFIG "Zebra.conf" |
|
|
+#define INTEGRATE_DEFAULT_CONFIG "zebra.conf.integrate" |
|
|
|
|
|
/* Small macro to determine newline is newline only or linefeed needed. */ |
|
|
#define VTY_NEWLINE ((vty->type == VTY_TERM) ? "\r\n" : "\n") |
|
|
Index: bgpd/bgp_aspath.c |
|
|
--- bgpd/bgp_aspath.c 19 Jun 2002 09:04:48 -0000 1.63 |
|
|
+++ bgpd/bgp_aspath.c 23 Oct 2002 09:24:47 -0000 1.64 |
|
|
@@ -1117,13 +1117,16 @@ |
|
|
{ |
|
|
unsigned int key = 0; |
|
|
int length; |
|
|
- caddr_t pnt; |
|
|
+ unsigned short *pnt; |
|
|
|
|
|
- length = aspath->length; |
|
|
- pnt = aspath->data; |
|
|
+ length = aspath->length / 2; |
|
|
+ pnt = (unsigned short *) aspath->data; |
|
|
|
|
|
while (length) |
|
|
- key += pnt[--length]; |
|
|
+ { |
|
|
+ key += *pnt++; |
|
|
+ length--; |
|
|
+ } |
|
|
|
|
|
return key; |
|
|
} |
|
|
Index: bgpd/bgp_packet.c |
|
|
--- bgpd/bgp_packet.c 21 Aug 2002 03:44:34 -0000 1.163 |
|
|
+++ bgpd/bgp_packet.c 19 Mar 2003 11:11:11 -0000 1.165 |
|
|
@@ -238,7 +238,6 @@ |
|
|
bgp_packet_set_size (s); |
|
|
packet = bgp_packet_dup (s); |
|
|
bgp_packet_add (peer, packet); |
|
|
- BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); |
|
|
stream_reset (s); |
|
|
return packet; |
|
|
} |
|
|
Index: bgpd/bgp_route.c |
|
|
--- bgpd/bgp_route.c 21 Aug 2002 03:44:34 -0000 1.402 |
|
|
+++ bgpd/bgp_route.c 28 Feb 2003 22:24:45 -0000 1.404 |
|
|
@@ -620,7 +620,10 @@ |
|
|
if (transparent || reflect |
|
|
|| (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED) |
|
|
&& ((p->family == AF_INET && attr->nexthop.s_addr) |
|
|
- || (p->family == AF_INET6 && ri->peer != bgp->peer_self)))) |
|
|
+#ifdef HAVE_IPV6 |
|
|
+ || (p->family == AF_INET6 && ri->peer != bgp->peer_self) |
|
|
+#endif /* HAVE_IPV6 */ |
|
|
+ ))) |
|
|
{ |
|
|
/* NEXT-HOP Unchanged. */ |
|
|
} |
|
|
@@ -2859,7 +2862,7 @@ |
|
|
if ((aggregate = rn->info) != NULL && rn->p.prefixlen < p->prefixlen) |
|
|
{ |
|
|
bgp_aggregate_delete (bgp, &rn->p, afi, safi, aggregate); |
|
|
- bgp_aggregate_route (bgp, &rn->p, ri, safi, safi, NULL, aggregate); |
|
|
+ bgp_aggregate_route (bgp, &rn->p, ri, afi, safi, NULL, aggregate); |
|
|
} |
|
|
bgp_unlock_node (child); |
|
|
} |
|
|
@@ -2886,7 +2889,7 @@ |
|
|
if ((aggregate = rn->info) != NULL && rn->p.prefixlen < p->prefixlen) |
|
|
{ |
|
|
bgp_aggregate_delete (bgp, &rn->p, afi, safi, aggregate); |
|
|
- bgp_aggregate_route (bgp, &rn->p, NULL, safi, safi, del, aggregate); |
|
|
+ bgp_aggregate_route (bgp, &rn->p, NULL, afi, safi, del, aggregate); |
|
|
} |
|
|
bgp_unlock_node (child); |
|
|
} |
|
|
Index: bgpd/bgpd.c |
|
|
--- bgpd/bgpd.c 18 Aug 2002 14:10:29 -0000 1.342 |
|
|
+++ bgpd/bgpd.c 6 Feb 2003 15:47:50 -0000 1.345 |
|
|
@@ -797,6 +797,13 @@ |
|
|
type = peer_sort (peer); |
|
|
peer->as = as; |
|
|
|
|
|
+ if (bgp_config_check (peer->bgp, BGP_CONFIG_CONFEDERATION) |
|
|
+ && ! bgp_confederation_peers_check (peer->bgp, as) |
|
|
+ && peer->bgp->as != as) |
|
|
+ peer->local_as = peer->bgp->confed_id; |
|
|
+ else |
|
|
+ peer->local_as = peer->bgp->as; |
|
|
+ |
|
|
/* Advertisement-interval reset */ |
|
|
if (peer_sort (peer) == BGP_PEER_IBGP) |
|
|
peer->v_routeadv = BGP_DEFAULT_IBGP_ROUTEADV; |
|
|
Index: ospfd/ospf_packet.c |
|
|
--- ospfd/ospf_packet.c.orig Thu Jul 4 05:06:41 2002 |
|
|
+++ ospfd/ospf_packet.c Fri Mar 28 00:05:26 2003 |
|
|
@@ -276,7 +276,7 @@ |
|
|
|
|
|
/* check crypto seqnum. */ |
|
|
nbr = ospf_nbr_lookup_by_routerid (oi->nbrs, &ospfh->router_id); |
|
|
- if (nbr && ntohl(nbr->crypt_seqnum) >= ntohl(ospfh->u.crypt.crypt_seqnum)) |
|
|
+ if (nbr && ntohl(nbr->crypt_seqnum) > ntohl(ospfh->u.crypt.crypt_seqnum)) |
|
|
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 */ |
|
|
} |
|
|
|
|
|
|