zebra.patch 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. --- ripd/ripd.c
  2. +++ ripd/ripd.c
  3. @@ -51,6 +51,10 @@
  4. /* RIP queries. */
  5. long rip_global_queries = 0;
  6. +
  7. +/* Should we trust netmasks or rather apply_classful_mask_ipv4()
  8. + in rip_output_process() ? */
  9. +char rip_should_trust_netmasks = 0;
  10. /* Prototypes. */
  11. void rip_event (enum rip_event, int);
  12. @@ -1963,7 +1967,9 @@
  13. zlog_info("%s/%d before RIPv1 mask check ",
  14. inet_ntoa (classfull.prefix), classfull.prefixlen);
  15. - apply_classful_mask_ipv4 (&classfull);
  16. + if (!rip_should_trust_netmasks)
  17. + apply_classful_mask_ipv4 (&classfull);
  18. +
  19. p = &classfull;
  20. if (IS_RIP_DEBUG_PACKET)
  21. @@ -2705,6 +2711,26 @@
  22. return CMD_SUCCESS;
  23. }
  24. +
  25. +DEFUN (rip_trust_netmasks,
  26. + rip_trust_netmasks_cmd,
  27. + "trust netmasks",
  28. + "Tell Zebra to trust netmasks and not to recalculate them.\n"
  29. + "Netmasks will be trusted.\n")
  30. +{
  31. + rip_should_trust_netmasks = 1;
  32. + return CMD_SUCCESS;
  33. +}
  34. +
  35. +DEFUN (no_rip_trust_netmasks,
  36. + no_rip_trust_netmasks_cmd,
  37. + "no trust netmasks",
  38. + "Tell Zebra not to trust netmasks and recalculate them.\n"
  39. + "Netmasks will be recalculated.\n")
  40. +{
  41. + rip_should_trust_netmasks = 0;
  42. + return CMD_SUCCESS;
  43. +}
  44. struct route_table *rip_distance_table;
  45. @@ -3503,6 +3529,8 @@
  46. install_element (RIP_NODE, &no_rip_distance_source_cmd);
  47. install_element (RIP_NODE, &rip_distance_source_access_list_cmd);
  48. install_element (RIP_NODE, &no_rip_distance_source_access_list_cmd);
  49. + install_element (RIP_NODE, &rip_trust_netmasks_cmd);
  50. + install_element (RIP_NODE, &no_rip_trust_netmasks_cmd);
  51. /* Debug related init. */
  52. rip_debug_init ();
  53. --- zebra/ioctl.c.orig Tue Oct 23 11:31:29 2001
  54. +++ zebra/ioctl.c Fri Oct 4 19:45:04 2002
  55. @@ -349,6 +349,7 @@
  56. int ret;
  57. struct ifreq ifreq;
  58. + bzero(&ifreq, sizeof(struct ifreq));
  59. ifreq_set_name (&ifreq, ifp);
  60. ifreq.ifr_flags = ifp->flags;
  61. @@ -371,6 +372,7 @@
  62. int ret;
  63. struct ifreq ifreq;
  64. + bzero(&ifreq, sizeof(struct ifreq));
  65. ifreq_set_name (&ifreq, ifp);
  66. ifreq.ifr_flags = ifp->flags;
  67. @@ -473,6 +475,9 @@
  68. mask.sin6_len = sizeof (struct sockaddr_in6);
  69. #endif
  70. memcpy (&addreq.ifra_prefixmask, &mask, sizeof (struct sockaddr_in6));
  71. +
  72. + addreq.ifra_lifetime.ia6t_vltime = 0xffffffff;
  73. + addreq.ifra_lifetime.ia6t_pltime = 0xffffffff;
  74. addreq.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
  75. addreq.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
  76. --- lib/vty.h.orig Sun Aug 18 16:34:00 2002
  77. +++ lib/vty.h Wed Mar 12 11:10:05 2003
  78. @@ -128,7 +128,7 @@
  79. };
  80. /* Integrated configuration file. */
  81. -#define INTEGRATE_DEFAULT_CONFIG "Zebra.conf"
  82. +#define INTEGRATE_DEFAULT_CONFIG "zebra.conf.integrate"
  83. /* Small macro to determine newline is newline only or linefeed needed. */
  84. #define VTY_NEWLINE ((vty->type == VTY_TERM) ? "\r\n" : "\n")
  85. Index: bgpd/bgp_aspath.c
  86. --- bgpd/bgp_aspath.c 19 Jun 2002 09:04:48 -0000 1.63
  87. +++ bgpd/bgp_aspath.c 23 Oct 2002 09:24:47 -0000 1.64
  88. @@ -1117,13 +1117,16 @@
  89. {
  90. unsigned int key = 0;
  91. int length;
  92. - caddr_t pnt;
  93. + unsigned short *pnt;
  94. - length = aspath->length;
  95. - pnt = aspath->data;
  96. + length = aspath->length / 2;
  97. + pnt = (unsigned short *) aspath->data;
  98. while (length)
  99. - key += pnt[--length];
  100. + {
  101. + key += *pnt++;
  102. + length--;
  103. + }
  104. return key;
  105. }
  106. Index: bgpd/bgp_packet.c
  107. --- bgpd/bgp_packet.c 21 Aug 2002 03:44:34 -0000 1.163
  108. +++ bgpd/bgp_packet.c 19 Mar 2003 11:11:11 -0000 1.165
  109. @@ -238,7 +238,6 @@
  110. bgp_packet_set_size (s);
  111. packet = bgp_packet_dup (s);
  112. bgp_packet_add (peer, packet);
  113. - BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
  114. stream_reset (s);
  115. return packet;
  116. }
  117. Index: bgpd/bgp_route.c
  118. --- bgpd/bgp_route.c 21 Aug 2002 03:44:34 -0000 1.402
  119. +++ bgpd/bgp_route.c 28 Feb 2003 22:24:45 -0000 1.404
  120. @@ -620,7 +620,10 @@
  121. if (transparent || reflect
  122. || (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED)
  123. && ((p->family == AF_INET && attr->nexthop.s_addr)
  124. - || (p->family == AF_INET6 && ri->peer != bgp->peer_self))))
  125. +#ifdef HAVE_IPV6
  126. + || (p->family == AF_INET6 && ri->peer != bgp->peer_self)
  127. +#endif /* HAVE_IPV6 */
  128. + )))
  129. {
  130. /* NEXT-HOP Unchanged. */
  131. }
  132. @@ -2859,7 +2862,7 @@
  133. if ((aggregate = rn->info) != NULL && rn->p.prefixlen < p->prefixlen)
  134. {
  135. bgp_aggregate_delete (bgp, &rn->p, afi, safi, aggregate);
  136. - bgp_aggregate_route (bgp, &rn->p, ri, safi, safi, NULL, aggregate);
  137. + bgp_aggregate_route (bgp, &rn->p, ri, afi, safi, NULL, aggregate);
  138. }
  139. bgp_unlock_node (child);
  140. }
  141. @@ -2886,7 +2889,7 @@
  142. if ((aggregate = rn->info) != NULL && rn->p.prefixlen < p->prefixlen)
  143. {
  144. bgp_aggregate_delete (bgp, &rn->p, afi, safi, aggregate);
  145. - bgp_aggregate_route (bgp, &rn->p, NULL, safi, safi, del, aggregate);
  146. + bgp_aggregate_route (bgp, &rn->p, NULL, afi, safi, del, aggregate);
  147. }
  148. bgp_unlock_node (child);
  149. }
  150. Index: bgpd/bgpd.c
  151. --- bgpd/bgpd.c 18 Aug 2002 14:10:29 -0000 1.342
  152. +++ bgpd/bgpd.c 6 Feb 2003 15:47:50 -0000 1.345
  153. @@ -797,6 +797,13 @@
  154. type = peer_sort (peer);
  155. peer->as = as;
  156. + if (bgp_config_check (peer->bgp, BGP_CONFIG_CONFEDERATION)
  157. + && ! bgp_confederation_peers_check (peer->bgp, as)
  158. + && peer->bgp->as != as)
  159. + peer->local_as = peer->bgp->confed_id;
  160. + else
  161. + peer->local_as = peer->bgp->as;
  162. +
  163. /* Advertisement-interval reset */
  164. if (peer_sort (peer) == BGP_PEER_IBGP)
  165. peer->v_routeadv = BGP_DEFAULT_IBGP_ROUTEADV;
  166. Index: ospfd/ospf_packet.c
  167. --- ospfd/ospf_packet.c.orig Thu Jul 4 05:06:41 2002
  168. +++ ospfd/ospf_packet.c Fri Mar 28 00:05:26 2003
  169. @@ -276,7 +276,7 @@
  170. /* check crypto seqnum. */
  171. nbr = ospf_nbr_lookup_by_routerid (oi->nbrs, &ospfh->router_id);
  172. - if (nbr && ntohl(nbr->crypt_seqnum) >= ntohl(ospfh->u.crypt.crypt_seqnum))
  173. + if (nbr && ntohl(nbr->crypt_seqnum) > ntohl(ospfh->u.crypt.crypt_seqnum))
  174. return 0;
  175. /* Generate a digest for the ospf packet - their digest + our digest. */