[packages] quagga{,-unstable}: Merge quagga-unstable package with quagga package

* Switch to quagga 0.99.x for stable version
 * Add menuconfig option to allow selection of old 0.98.6 version
 * Makefile cleanups

git-svn-id: svn+ssh://svn.openwrt.org/openwrt@23464 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
acinonyx 2010-10-15 21:43:27 +00:00
parent 70a93509f5
commit 98a6f72ce9
19 changed files with 1743 additions and 434 deletions

17
Config.in Normal file
View file

@ -0,0 +1,17 @@
# Quagga configuration
choice
prompt "Quagga version"
depends on PACKAGE_quagga
default QUAGGA_STABLE
help
This option allows you to select the version of Quagga to be built.
config QUAGGA_STABLE
bool "Use the latest stable version of Quagga"
config QUAGGA_OLD
depends BROKEN
bool "Use the old release version 0.98.6"
endchoice

View file

@ -8,20 +8,27 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=quagga
PKG_VERSION:=0.98.6
PKG_RELEASE:=5
PKG_MD5SUM:=b0d4132039953a0214256873b7d23d68
ifneq ($(CONFIG_QUAGGA_OLD),)
PKG_VERSION:=0.98.6
PKG_RELEASE:=5
PKG_MD5SUM:=b0d4132039953a0214256873b7d23d68
PATCH_DIR:=./patches-old
else
PKG_VERSION:=0.99.17
PKG_RELEASE:=1
PKG_MD5SUM:=37b9022adca04b03863d2d79787e643f
endif
PKG_SOURCE:=quagga-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.quagga.net/download/ \
http://www.de.quagga.net/download/ \
http://www.uk.quagga.net/download/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_CONFIG_DEPENDS:= \
CONFIG_QUAGGA_STABLE \
CONFIG_IPV6 \
CONFIG_PACKAGE_quagga-unstable-isisd \
CONFIG_PACKAGE_quagga-unstable-ripngd
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=libtool
PKG_INSTALL:=1
@ -38,7 +45,7 @@ endef
define Package/quagga
$(call Package/quagga/Default)
DEPENDS:=
DEPENDS:=+QUAGGA_STABLE:librt
MENU:=1
endef
@ -48,6 +55,10 @@ define Package/quagga/description
OSPFv3, BGP-4, and BGP-4+
endef
define Package/quagga/config
source "$(SOURCE)/Config.in"
endef
define Package/quagga-libzebra
$(call Package/quagga/Default)
TITLE:=zebra library
@ -60,7 +71,7 @@ endef
define Package/quagga-bgpd
$(call Package/quagga/Default)
DEPENDS += quagga-libzebra
DEPENDS+=+quagga-libzebra
TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
endef
@ -71,31 +82,31 @@ endef
define Package/quagga-ospfd
$(call Package/quagga/Default)
DEPENDS += quagga-libospf quagga-libzebra
DEPENDS+=+quagga-libospf +quagga-libzebra
TITLE:=OSPFv2 routing engine
endef
define Package/quagga-ospf6d
$(call Package/quagga/Default)
DEPENDS += quagga-libospf quagga-libzebra @IPV6
DEPENDS+=+quagga-libospf +quagga-libzebra @IPV6
TITLE:=OSPFv3 routing engine
endef
define Package/quagga-ripd
$(call Package/quagga/Default)
DEPENDS += quagga-libzebra
DEPENDS+=+quagga-libzebra
TITLE:=RIP routing engine
endef
define Package/quagga-ripngd
$(call Package/quagga/Default)
DEPENDS += quagga-libzebra @BROKEN
DEPENDS+=+quagga-libzebra @BROKEN
TITLE:=RIPNG routing engine
endef
define Package/quagga-vtysh
$(call Package/quagga/Default)
DEPENDS += quagga-libzebra +libreadline +libncurses
DEPENDS+=quagga-libzebra +libreadline +libncurses
TITLE:=integrated shell for Quagga routing software
endef
@ -135,6 +146,7 @@ CONFIGURE_ARGS+= \
--enable-vtysh \
--enable-user=quagga \
--enable-group=quagga \
--enable-pie=no \
--enable-multipath=8 \
ifneq ($(CONFIG_PACKAGE_quagga-isisd),)

View file

@ -0,0 +1,855 @@
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -3,6 +3,9 @@
This file is part of GNU Zebra.
+This file was modified from the original on 30/12/2007
+by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
+
GNU Zebra is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
@@ -7793,8 +7796,12 @@ bgp_str2route_type (int afi, const char
return ZEBRA_ROUTE_STATIC;
else if (strncmp (str, "r", 1) == 0)
return ZEBRA_ROUTE_RIP;
- else if (strncmp (str, "o", 1) == 0)
+ else if (strncmp (str, "ol", 2) == 0)
+ return ZEBRA_ROUTE_OLSR;
+ else if (strncmp (str, "os", 2) == 0)
return ZEBRA_ROUTE_OSPF;
+ else if (strncmp (str, "ba", 2) == 0)
+ return ZEBRA_ROUTE_BATMAN;
}
if (afi == AFI_IP6)
{
@@ -7806,21 +7813,28 @@ bgp_str2route_type (int afi, const char
return ZEBRA_ROUTE_STATIC;
else if (strncmp (str, "r", 1) == 0)
return ZEBRA_ROUTE_RIPNG;
- else if (strncmp (str, "o", 1) == 0)
+ else if (strncmp (str, "os", 2) == 0)
return ZEBRA_ROUTE_OSPF6;
+ else if (strncmp (str, "ol", 2) == 0)
+ return ZEBRA_ROUTE_OLSR;
+ else if (strncmp (str, "ba", 2) == 0)
+ return ZEBRA_ROUTE_BATMAN;
}
return 0;
}
DEFUN (bgp_redistribute_ipv4,
bgp_redistribute_ipv4_cmd,
- "redistribute (connected|kernel|ospf|rip|static)",
+ "redistribute (connected|kernel|ospf|rip|static|olsr|batman)",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
- "Static routes\n")
+ "Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ )
{
int type;
@@ -7835,13 +7849,15 @@ DEFUN (bgp_redistribute_ipv4,
DEFUN (bgp_redistribute_ipv4_rmap,
bgp_redistribute_ipv4_rmap_cmd,
- "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
+ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
@@ -7860,13 +7876,15 @@ DEFUN (bgp_redistribute_ipv4_rmap,
DEFUN (bgp_redistribute_ipv4_metric,
bgp_redistribute_ipv4_metric_cmd,
- "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
+ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295>",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n")
{
@@ -7887,13 +7905,15 @@ DEFUN (bgp_redistribute_ipv4_metric,
DEFUN (bgp_redistribute_ipv4_rmap_metric,
bgp_redistribute_ipv4_rmap_metric_cmd,
- "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
+ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD metric <0-4294967295>",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
@@ -7917,13 +7937,15 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric
DEFUN (bgp_redistribute_ipv4_metric_rmap,
bgp_redistribute_ipv4_metric_rmap_cmd,
- "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
+ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295> route-map WORD",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
@@ -7947,14 +7969,17 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap
DEFUN (no_bgp_redistribute_ipv4,
no_bgp_redistribute_ipv4_cmd,
- "no redistribute (connected|kernel|ospf|rip|static)",
+ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman)",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
- "Static routes\n")
+ "Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ )
{
int type;
@@ -7970,7 +7995,7 @@ DEFUN (no_bgp_redistribute_ipv4,
DEFUN (no_bgp_redistribute_ipv4_rmap,
no_bgp_redistribute_ipv4_rmap_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
+ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
@@ -7978,6 +8003,8 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
@@ -7996,7 +8023,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
DEFUN (no_bgp_redistribute_ipv4_metric,
no_bgp_redistribute_ipv4_metric_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
+ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295>",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
@@ -8004,6 +8031,8 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n")
{
@@ -8022,7 +8051,7 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
DEFUN (no_bgp_redistribute_ipv4_rmap_metric,
no_bgp_redistribute_ipv4_rmap_metric_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
+ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD metric <0-4294967295>",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
@@ -8030,6 +8059,8 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
@@ -8051,7 +8082,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
ALIAS (no_bgp_redistribute_ipv4_rmap_metric,
no_bgp_redistribute_ipv4_metric_rmap_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
+ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295> route-map WORD",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
@@ -8059,6 +8090,8 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
@@ -8067,13 +8100,16 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
#ifdef HAVE_IPV6
DEFUN (bgp_redistribute_ipv6,
bgp_redistribute_ipv6_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static)",
+ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman)",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
- "Static routes\n")
+ "Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ )
{
int type;
@@ -8089,13 +8125,15 @@ DEFUN (bgp_redistribute_ipv6,
DEFUN (bgp_redistribute_ipv6_rmap,
bgp_redistribute_ipv6_rmap_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
+ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
@@ -8114,13 +8152,15 @@ DEFUN (bgp_redistribute_ipv6_rmap,
DEFUN (bgp_redistribute_ipv6_metric,
bgp_redistribute_ipv6_metric_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
+ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295>",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n")
{
@@ -8141,13 +8181,15 @@ DEFUN (bgp_redistribute_ipv6_metric,
DEFUN (bgp_redistribute_ipv6_rmap_metric,
bgp_redistribute_ipv6_rmap_metric_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
+ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD metric <0-4294967295>",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
@@ -8171,13 +8213,15 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric
DEFUN (bgp_redistribute_ipv6_metric_rmap,
bgp_redistribute_ipv6_metric_rmap_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
+ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295> route-map WORD",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
@@ -8201,14 +8245,17 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap
DEFUN (no_bgp_redistribute_ipv6,
no_bgp_redistribute_ipv6_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static)",
+ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman)",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
- "Static routes\n")
+ "Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ )
{
int type;
@@ -8224,7 +8271,7 @@ DEFUN (no_bgp_redistribute_ipv6,
DEFUN (no_bgp_redistribute_ipv6_rmap,
no_bgp_redistribute_ipv6_rmap_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
+ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
@@ -8232,6 +8279,8 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
@@ -8250,7 +8299,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
DEFUN (no_bgp_redistribute_ipv6_metric,
no_bgp_redistribute_ipv6_metric_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
+ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295>",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
@@ -8258,6 +8307,8 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n")
{
@@ -8276,7 +8327,7 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
DEFUN (no_bgp_redistribute_ipv6_rmap_metric,
no_bgp_redistribute_ipv6_rmap_metric_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
+ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD metric <0-4294967295>",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
@@ -8284,6 +8335,8 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
@@ -8305,7 +8358,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
ALIAS (no_bgp_redistribute_ipv6_rmap_metric,
no_bgp_redistribute_ipv6_metric_rmap_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
+ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295> route-map WORD",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
@@ -8313,6 +8366,8 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_met
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
@@ -8325,7 +8380,7 @@ bgp_config_write_redistribute (struct vt
{
int i;
const char *str[] = { "system", "kernel", "connected", "static", "rip",
- "ripng", "ospf", "ospf6", "isis", "bgp"};
+ "ripng", "ospf", "ospf6", "isis", "bgp", "hsls", "olsr", "batman"};
/* Unicast redistribution only. */
if (safi != SAFI_UNICAST)
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -3,6 +3,9 @@
This file is part of GNU Zebra.
+This file was modified from the original on 30/12/2007
+by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
+
GNU Zebra is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
@@ -378,7 +381,9 @@ struct in_pktinfo
#define ZEBRA_ROUTE_ISIS 8
#define ZEBRA_ROUTE_BGP 9
#define ZEBRA_ROUTE_HSLS 10
-#define ZEBRA_ROUTE_MAX 11
+#define ZEBRA_ROUTE_OLSR 11
+#define ZEBRA_ROUTE_BATMAN 12
+#define ZEBRA_ROUTE_MAX 13
/* Zebra's family types. */
#define ZEBRA_FAMILY_IPV4 1
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -3,6 +3,9 @@
*
* This file is part of GNU Zebra.
*
+ * This file was modified from the original on 30/12/2007
+ * by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
+ *
* GNU Zebra is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
@@ -106,11 +109,15 @@ str2distribute_source (const char *str,
*source = ZEBRA_ROUTE_STATIC;
else if (strncmp (str, "r", 1) == 0)
*source = ZEBRA_ROUTE_RIP;
- else if (strncmp (str, "b", 1) == 0)
+ else if (strncmp (str, "bg", 2) == 0)
*source = ZEBRA_ROUTE_BGP;
+ else if (strncmp (str, "ol", 2) == 0)
+ *source = ZEBRA_ROUTE_OLSR;
+ else if (strncmp (str, "ba", 2) == 0)
+ *source = ZEBRA_ROUTE_BATMAN;
else
return 0;
-
+
return 1;
}
@@ -5302,13 +5309,15 @@ ALIAS (no_ip_ospf_transmit_delay,
DEFUN (ospf_redistribute_source_metric_type,
ospf_redistribute_source_metric_type_routemap_cmd,
- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2) route-map WORD",
+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> metric-type (1|2) route-map WORD",
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
"Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"OSPF default metric\n"
"OSPF exterior metric type for redistributed routes\n"
@@ -5346,13 +5355,15 @@ DEFUN (ospf_redistribute_source_metric_t
ALIAS (ospf_redistribute_source_metric_type,
ospf_redistribute_source_metric_type_cmd,
- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2)",
+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> metric-type (1|2)",
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
"Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"OSPF default metric\n"
"OSPF exterior metric type for redistributed routes\n"
@@ -5361,25 +5372,29 @@ ALIAS (ospf_redistribute_source_metric_t
ALIAS (ospf_redistribute_source_metric_type,
ospf_redistribute_source_metric_cmd,
- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214>",
+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214>",
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
"Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"OSPF default metric\n")
DEFUN (ospf_redistribute_source_type_metric,
ospf_redistribute_source_type_metric_routemap_cmd,
- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214> route-map WORD",
+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) metric <0-16777214> route-map WORD",
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
"Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"OSPF exterior metric type for redistributed routes\n"
"Set OSPF External Type 1 metrics\n"
"Set OSPF External Type 2 metrics\n"
@@ -5417,13 +5432,15 @@ DEFUN (ospf_redistribute_source_type_met
ALIAS (ospf_redistribute_source_type_metric,
ospf_redistribute_source_type_metric_cmd,
- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214>",
+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) metric <0-16777214>",
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
"Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"OSPF exterior metric type for redistributed routes\n"
"Set OSPF External Type 1 metrics\n"
"Set OSPF External Type 2 metrics\n"
@@ -5432,7 +5449,7 @@ ALIAS (ospf_redistribute_source_type_met
ALIAS (ospf_redistribute_source_type_metric,
ospf_redistribute_source_type_cmd,
- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)",
+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2)",
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
@@ -5440,28 +5457,35 @@ ALIAS (ospf_redistribute_source_type_met
"Routing Information Protocol (RIP)\n"
"Border Gateway Protocol (BGP)\n"
"OSPF exterior metric type for redistributed routes\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Set OSPF External Type 1 metrics\n"
"Set OSPF External Type 2 metrics\n")
ALIAS (ospf_redistribute_source_type_metric,
ospf_redistribute_source_cmd,
- "redistribute (kernel|connected|static|rip|bgp)",
+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman)",
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n")
+ "Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ )
DEFUN (ospf_redistribute_source_metric_routemap,
ospf_redistribute_source_metric_routemap_cmd,
- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> route-map WORD",
+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> route-map WORD",
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
"Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"OSPF default metric\n"
"Route map reference\n"
@@ -5490,13 +5514,15 @@ DEFUN (ospf_redistribute_source_metric_r
DEFUN (ospf_redistribute_source_type_routemap,
ospf_redistribute_source_type_routemap_cmd,
- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map WORD",
+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) route-map WORD",
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
"Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"OSPF exterior metric type for redistributed routes\n"
"Set OSPF External Type 1 metrics\n"
"Set OSPF External Type 2 metrics\n"
@@ -5526,13 +5552,15 @@ DEFUN (ospf_redistribute_source_type_rou
DEFUN (ospf_redistribute_source_routemap,
ospf_redistribute_source_routemap_cmd,
- "redistribute (kernel|connected|static|rip|bgp) route-map WORD",
+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) route-map WORD",
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
"Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
@@ -5553,14 +5581,17 @@ DEFUN (ospf_redistribute_source_routemap
DEFUN (no_ospf_redistribute_source,
no_ospf_redistribute_source_cmd,
- "no redistribute (kernel|connected|static|rip|bgp)",
+ "no redistribute (kernel|connected|static|rip|bgp|olsr|batman)",
NO_STR
"Redistribute information from another routing protocol\n"
"Kernel routes\n"
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n")
+ "Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ )
{
struct ospf *ospf = vty->index;
int source;
@@ -5574,7 +5605,7 @@ DEFUN (no_ospf_redistribute_source,
DEFUN (ospf_distribute_list_out,
ospf_distribute_list_out_cmd,
- "distribute-list WORD out (kernel|connected|static|rip|bgp)",
+ "distribute-list WORD out (kernel|connected|static|rip|bgp|olsr|batman)",
"Filter networks in routing updates\n"
"Access-list name\n"
OUT_STR
@@ -5582,7 +5613,10 @@ DEFUN (ospf_distribute_list_out,
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n")
+ "Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+)
{
struct ospf *ospf = vty->index;
int source;
@@ -5596,7 +5630,7 @@ DEFUN (ospf_distribute_list_out,
DEFUN (no_ospf_distribute_list_out,
no_ospf_distribute_list_out_cmd,
- "no distribute-list WORD out (kernel|connected|static|rip|bgp)",
+ "no distribute-list WORD out (kernel|connected|static|rip|bgp|olsr|batman)",
NO_STR
"Filter networks in routing updates\n"
"Access-list name\n"
@@ -5605,7 +5639,10 @@ DEFUN (no_ospf_distribute_list_out,
"Connected\n"
"Static routes\n"
"Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n")
+ "Border Gateway Protocol (BGP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+)
{
struct ospf *ospf = vty->index;
int source;
@@ -7121,7 +7158,8 @@ config_write_virtual_link (struct vty *v
const char *distribute_str[] = { "system", "kernel", "connected", "static",
- "rip", "ripng", "ospf", "ospf6", "isis", "bgp"};
+ "rip", "ripng", "ospf", "ospf6", "isis", "bgp",
+ "hsls","olsr","batman"};
int
config_write_ospf_redistribute (struct vty *vty, struct ospf *ospf)
{
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -3,6 +3,9 @@
*
* This file is part of GNU Zebra.
*
+ * This file was modified from the original on 30/12/2007
+ * by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
+ *
* GNU Zebra is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
@@ -253,6 +256,8 @@ zebra_redistribute_add (int command, str
case ZEBRA_ROUTE_OSPF:
case ZEBRA_ROUTE_OSPF6:
case ZEBRA_ROUTE_BGP:
+ case ZEBRA_ROUTE_OLSR:
+ case ZEBRA_ROUTE_BATMAN:
if (! client->redist[type])
{
client->redist[type] = 1;
@@ -281,6 +286,8 @@ zebra_redistribute_delete (int command,
case ZEBRA_ROUTE_OSPF:
case ZEBRA_ROUTE_OSPF6:
case ZEBRA_ROUTE_BGP:
+ case ZEBRA_ROUTE_OLSR:
+ case ZEBRA_ROUTE_BATMAN:
client->redist[type] = 0;
break;
default:
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -53,6 +53,10 @@ route_type_str (u_char type)
return "isis";
case ZEBRA_ROUTE_BGP:
return "bgp";
+ case ZEBRA_ROUTE_OLSR:
+ return "olsr";
+ case ZEBRA_ROUTE_BATMAN:
+ return "batman";
default:
return "unknown";
}
@@ -84,6 +88,12 @@ route_type_char (u_char type)
return 'I';
case ZEBRA_ROUTE_BGP:
return 'B';
+ case ZEBRA_ROUTE_HSLS:
+ return 'H';
+ case ZEBRA_ROUTE_OLSR:
+ return 'L';
+ case ZEBRA_ROUTE_BATMAN:
+ return 'M';
default:
return '?';
}
@@ -755,8 +765,8 @@ vty_show_ip_route (struct vty *vty, stru
}
#define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, " \
- "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, " \
- "> - selected route, * - FIB route%s%s"
+ "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, H - HSLS, " \
+ "L - OLSR, M - BATMAN, > - selected route, * - FIB route%s%s"
DEFUN (show_ip_route,
show_ip_route_cmd,
@@ -874,7 +884,7 @@ DEFUN (show_ip_route_supernets,
DEFUN (show_ip_route_protocol,
show_ip_route_protocol_cmd,
- "show ip route (bgp|connected|isis|kernel|ospf|rip|static)",
+ "show ip route (bgp|connected|isis|kernel|ospf|rip|olsr|batman|static)",
SHOW_STR
IP_STR
"IP routing table\n"
@@ -884,6 +894,8 @@ DEFUN (show_ip_route_protocol,
"Kernel\n"
"Open Shortest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Static routes\n")
{
int type;
@@ -892,13 +904,13 @@ DEFUN (show_ip_route_protocol,
struct rib *rib;
int first = 1;
- if (strncmp (argv[0], "b", 1) == 0)
+ if (strncmp (argv[0], "bg", 2) == 0)
type = ZEBRA_ROUTE_BGP;
else if (strncmp (argv[0], "c", 1) == 0)
type = ZEBRA_ROUTE_CONNECT;
else if (strncmp (argv[0], "k", 1) ==0)
type = ZEBRA_ROUTE_KERNEL;
- else if (strncmp (argv[0], "o", 1) == 0)
+ else if (strncmp (argv[0], "os", 2) == 0)
type = ZEBRA_ROUTE_OSPF;
else if (strncmp (argv[0], "i", 1) == 0)
type = ZEBRA_ROUTE_ISIS;
@@ -906,6 +918,10 @@ DEFUN (show_ip_route_protocol,
type = ZEBRA_ROUTE_RIP;
else if (strncmp (argv[0], "s", 1) == 0)
type = ZEBRA_ROUTE_STATIC;
+ else if (strncmp (argv[0], "ol", 2) == 0)
+ type = ZEBRA_ROUTE_OLSR;
+ else if (strncmp (argv[0], "ba", 2) == 0)
+ type = ZEBRA_ROUTE_BATMAN;
else
{
vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
@@ -1732,7 +1748,7 @@ DEFUN (show_ipv6_route_prefix_longer,
DEFUN (show_ipv6_route_protocol,
show_ipv6_route_protocol_cmd,
- "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|static)",
+ "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|olsr|batman|static)",
SHOW_STR
IP_STR
"IP routing table\n"
@@ -1742,6 +1758,8 @@ DEFUN (show_ipv6_route_protocol,
"Kernel\n"
"Open Shortest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Static routes\n")
{
int type;
@@ -1750,13 +1768,13 @@ DEFUN (show_ipv6_route_protocol,
struct rib *rib;
int first = 1;
- if (strncmp (argv[0], "b", 1) == 0)
+ if (strncmp (argv[0], "bg", 2) == 0)
type = ZEBRA_ROUTE_BGP;
else if (strncmp (argv[0], "c", 1) == 0)
type = ZEBRA_ROUTE_CONNECT;
else if (strncmp (argv[0], "k", 1) ==0)
type = ZEBRA_ROUTE_KERNEL;
- else if (strncmp (argv[0], "o", 1) == 0)
+ else if (strncmp (argv[0], "os", 2) == 0)
type = ZEBRA_ROUTE_OSPF6;
else if (strncmp (argv[0], "i", 1) == 0)
type = ZEBRA_ROUTE_ISIS;
@@ -1764,7 +1782,11 @@ DEFUN (show_ipv6_route_protocol,
type = ZEBRA_ROUTE_RIPNG;
else if (strncmp (argv[0], "s", 1) == 0)
type = ZEBRA_ROUTE_STATIC;
- else
+ else if (strncmp (argv[0], "ol", 2) == 0)
+ type = ZEBRA_ROUTE_OLSR;
+ else if (strncmp (argv[0], "ba", 2) == 0)
+ type = ZEBRA_ROUTE_BATMAN;
+ else
{
vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
return CMD_WARNING;

View file

@ -0,0 +1,20 @@
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -109,6 +109,7 @@ bgp_accept (struct thread *thread)
peer->fd = bgp_sock;
peer->status = Active;
peer->local_id = peer1->local_id;
+ peer->v_holdtime = BGP_LARGE_HOLDTIME;
/* Make peer's address string. */
sockunion2str (&su, buf, SU_ADDRSTRLEN);
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -656,6 +656,7 @@ struct bgp_nlri
/* BGP timers default value. */
#define BGP_INIT_START_TIMER 5
#define BGP_ERROR_START_TIMER 30
+#define BGP_LARGE_HOLDTIME 240
#define BGP_DEFAULT_HOLDTIME 180
#define BGP_DEFAULT_KEEPALIVE 60
#define BGP_DEFAULT_ASORIGINATE 15

View file

@ -0,0 +1,40 @@
--- a/lib/command.c
+++ b/lib/command.c
@@ -2567,6 +2567,13 @@
unlink (config_file_tmp);
return CMD_WARNING;
}
+
+#if 0
+ /* This code fails on UNION MOUNTs and similar filesystems if the
+ * config file is still on the RO layer. Hardlinks across layers
+ * will not work and cause quagga to fail saving the configuration...
+ * should use rename() to move files around...
+ */
if (link (config_file, config_file_sav) != 0)
{
vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
@@ -2586,7 +2593,23 @@
unlink (config_file_tmp);
return CMD_WARNING;
}
+#else
+ /* And this is the code that hopefully does work */
+ if (rename (config_file, config_file_sav) != 0)
+ {
+ vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ sync ();
+#endif
+
+#if 0
+ /* same here. Please no cross-filesystem hardlinks... */
if (link (config_file_tmp, config_file) != 0)
+#else
+ if (rename (config_file_tmp, config_file) != 0)
+#endif
{
vty_out (vty, "Can't save configuration file %s.%s", config_file,
VTY_NEWLINE);

View file

@ -0,0 +1,11 @@
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -451,7 +451,7 @@ zsend_route_multipath (int cmd, struct zserv *client, struct prefix *p,
}
/* Metric */
- if (cmd == ZEBRA_IPV4_ROUTE_ADD || ZEBRA_IPV6_ROUTE_ADD)
+ if (cmd == ZEBRA_IPV4_ROUTE_ADD || cmd == ZEBRA_IPV6_ROUTE_ADD)
{
SET_FLAG (zapi_flags, ZAPI_MESSAGE_DISTANCE);
stream_putc (s, rib->distance);

View file

@ -0,0 +1,11 @@
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -250,7 +250,7 @@ vty_hello (struct vty *vty)
vty_out (vty, "MOTD file not found%s", VTY_NEWLINE);
}
else if (host.motd)
- vty_out (vty, host.motd);
+ vty_out (vty, "%s", host.motd);
}
/* Put out prompt and wait input from user. */

View file

@ -0,0 +1,16 @@
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -177,10 +177,11 @@ bgp_update_packet (struct peer *peer, afi_t afi, safi_t safi)
if (rn->prn)
prd = (struct prefix_rd *) &rn->prn->p;
- if (binfo && binfo->extra)
+ if (binfo)
{
- tag = binfo->extra->tag;
from = binfo->peer;
+ if (binfo->extra)
+ tag = binfo->extra->tag;
}
bgp_packet_set_marker (s, BGP_MSG_UPDATE);

View file

@ -0,0 +1,27 @@
Add definitions for IPCTL_FORWARDING and IP6CTL_FORWARDING.
Inspired from
http://svn.gnumonks.org/trunk/grouter/build/src/quagga/quagga/quagga-0.99.1-forward_sysctl-2.6.14.patch
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: quagga-0.99.16/zebra/ipforward_sysctl.c
===================================================================
--- quagga-0.99.16.orig/zebra/ipforward_sysctl.c 2010-06-20 23:40:45.000000000 +0200
+++ quagga-0.99.16/zebra/ipforward_sysctl.c 2010-06-20 23:41:37.000000000 +0200
@@ -31,6 +31,15 @@
#define MIB_SIZ 4
+/* Fix for recent (2.6.14) kernel headers */
+#ifndef IPCTL_FORWARDING
+#define IPCTL_FORWARDING NET_IPV4_FORWARD
+#endif
+
+#ifndef IP6CTL_FORWARDING
+#define IP6CTL_FORWARDING NET_IPV6_FORWARDING
+#endif
+
extern struct zebra_privs_t zserv_privs;
/* IPv4 forwarding control MIB. */

File diff suppressed because it is too large Load diff

11
patches/010-fix_cpp.patch Normal file
View file

@ -0,0 +1,11 @@
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
@@ -62,7 +62,7 @@ $ignore{'"show history"'} = "ignore";
foreach (@ARGV) {
$file = $_;
- open (FH, "cpp -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_srcdir@/isisd/topology @SNMP_INCLUDES@ $file |");
+ open (FH, "@CPP@ @CPPFLAGS@ -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_srcdir@/isisd/topology @SNMP_INCLUDES@ $file |");
local $/; undef $/;
$line = <FH>;
close (FH);

View file

@ -0,0 +1,297 @@
--- a/configure.ac
+++ b/configure.ac
@@ -397,7 +397,7 @@ dnl -------------------------
AC_CHECK_HEADERS([stropts.h sys/ksym.h sys/times.h sys/select.h \
sys/types.h linux/version.h netdb.h asm/types.h \
sys/param.h limits.h signal.h libutil.h \
- sys/socket.h netinet/in.h time.h sys/time.h])
+ sys/socket.h netinet/in.h time.h sys/time.h linux/ip_mp_alg.h])
dnl Utility macro to avoid retyping includes all the time
m4_define([QUAGGA_INCLUDES],
@@ -779,6 +779,17 @@ AC_SUBST(RT_METHOD)
AC_SUBST(KERNEL_METHOD)
AC_SUBST(OTHER_METHOD)
+dnl ----------
+dnl Check for RTA_MP_ALGO in linux/rtnetlink.h
+dnl ----------
+AC_MSG_CHECKING(for support of multipath alg. in netlink)
+ if grep RTA_MP_ALGO linux/rtnetlink.h >/dev/null 2>&1; then
+ AC_DEFINE(HAVE_RT_MP_ALGO,,RTA_MP exist in rtnetlink)
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+
dnl --------------------------
dnl Determine IS-IS I/O method
dnl --------------------------
--- a/lib/command.h
+++ b/lib/command.h
@@ -101,6 +101,7 @@ enum node_type
DUMP_NODE, /* Packet dump node. */
FORWARDING_NODE, /* IP forwarding node. */
PROTOCOL_NODE, /* protocol filtering node */
+ MULTIPATH_NODE, /* Multipath policy node */
VTY_NODE, /* Vty node. */
};
@@ -272,6 +273,7 @@ struct desc
/* Common descriptions. */
#define SHOW_STR "Show running system information\n"
#define IP_STR "IP information\n"
+#define MULTIPATH_STR "Configure multipath policy\n"
#define IPV6_STR "IPv6 information\n"
#define NO_STR "Negate a command or set its defaults\n"
#define REDIST_STR "Redistribute information from another routing protocol\n"
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -176,6 +176,10 @@ typedef int socklen_t;
#define RT_TABLE_MAIN 0
#endif /* HAVE_NETLINK */
+#ifdef HAVE_LINUX_IP_MP_ALG_H
+#include <linux/ip_mp_alg.h>
+#endif /* HAVE_LINUX_IP_MP_ALG_H */
+
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif /* HAVE_NETDB_H */
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -44,6 +44,7 @@
struct zebra_t zebrad =
{
.rtm_table_default = 0,
+ .mpath = 0,
};
/* process id. */
--- /dev/null
+++ b/zebra/multipath.h
@@ -0,0 +1,37 @@
+/*
+ * multipath policy names.
+ *
+ * This file is part of Quagga routing suite.
+ *
+ * Quagga is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * Quagga is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Zebra; see the file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef ZEBRA_MULTIPATH_H
+#define ZEBRA_MULTIPATH_H
+#include <zebra.h>
+
+#ifdef HAVE_LINUX_IP_MP_ALG_H
+
+static char *mp_alg_names[IP_MP_ALG_MAX+1] = {
+ [IP_MP_ALG_NONE] = "none",
+ [IP_MP_ALG_RR] = "rr",
+ [IP_MP_ALG_DRR] = "drr",
+ [IP_MP_ALG_RANDOM] = "random",
+ [IP_MP_ALG_WRANDOM] = "wrandom"
+ };
+#endif
+#endif
+
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -36,6 +36,7 @@
#include "thread.h"
#include "privs.h"
+#include "multipath.h"
#include "zebra/zserv.h"
#include "zebra/rt.h"
#include "zebra/redistribute.h"
@@ -1694,6 +1695,16 @@ netlink_route_multipath (int cmd, struct
if (src)
addattr_l (&req.n, sizeof req, RTA_PREFSRC, &src->ipv4, bytelen);
+#ifdef HAVE_RT_MP_ALGO
+ if (zebrad.mpath != IP_MP_ALG_NONE)
+ {
+ if (IS_ZEBRA_DEBUG_KERNEL)
+ zlog_debug("netlink_route_multipath() (multihop): "
+ "multipath policy : %s",mp_alg_names[zebrad.mpath]);
+
+ addattr_l (&req.n, 1024, RTA_MP_ALGO, &zebrad.mpath, sizeof(zebrad.mpath));
+ }
+#endif
if (rta->rta_len > RTA_LENGTH (0))
addattr_l (&req.n, 1024, RTA_MULTIPATH, RTA_DATA (rta),
RTA_PAYLOAD (rta));
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -36,6 +36,7 @@
#include "privs.h"
#include "network.h"
#include "buffer.h"
+#include "multipath.h"
#include "zebra/zserv.h"
#include "zebra/router-id.h"
@@ -1120,6 +1121,9 @@ zebra_client_create (int sock)
/* Set table number. */
client->rtm_table = zebrad.rtm_table_default;
+ /* Set multipath policy */
+ client->mpath = zebrad.mpath;
+
/* Add this client to linked list. */
listnode_add (zebrad.client_list, client);
@@ -1697,6 +1701,91 @@ static struct cmd_node forwarding_node =
};
+#ifdef HAVE_RT_MP_ALGO
+DEFUN (multipath_rr,
+ multipath_rr_cmd,
+ "multipath rr",
+ MULTIPATH_STR
+ "Round Robin multipath policy")
+{
+ zebrad.mpath=IP_MP_ALG_RR;
+ return CMD_SUCCESS;
+}
+
+DEFUN (multipath_drr,
+ multipath_drr_cmd,
+ "multipath drr",
+ MULTIPATH_STR
+ "Device round robin multipath policy")
+{
+ zebrad.mpath=IP_MP_ALG_DRR;
+ return CMD_SUCCESS;
+}
+
+DEFUN (multipath_random,
+ multipath_random_cmd,
+ "multipath random",
+ MULTIPATH_STR
+ "Random multipath policy")
+{
+ zebrad.mpath=IP_MP_ALG_RANDOM;
+ return CMD_SUCCESS;
+}
+
+DEFUN (multipath_wrandom,
+ multipath_wrandom_cmd,
+ "multipath wrandom",
+ MULTIPATH_STR
+ "Weighted random multipath policy")
+{
+ zebrad.mpath=IP_MP_ALG_WRANDOM;
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_multipath,
+ no_multipath_cmd,
+ "no multipath",
+ NO_STR
+ MULTIPATH_STR
+ "Remove multipath policy")
+{
+ zebrad.mpath=IP_MP_ALG_NONE;
+ return CMD_SUCCESS;
+}
+
+DEFUN (show_multipath,
+ show_multipath_cmd,
+ "show multipath",
+ SHOW_STR
+ "Show multipath policy")
+{
+ vty_out (vty, "multipath %s%s", mp_alg_names[zebrad.mpath],
+ VTY_NEWLINE);
+ return CMD_SUCCESS;
+}
+
+/* multipath policy configuration write function. */
+static int
+config_write_multipath (struct vty *vty)
+{
+
+
+ if (zebrad.mpath)
+ vty_out (vty, "multipath %s%s", mp_alg_names[zebrad.mpath],
+ VTY_NEWLINE);
+ return 0;
+}
+
+/* table node for multipath policy. */
+struct cmd_node multipath_node =
+{
+ MULTIPATH_NODE,
+ "",
+ 1
+};
+
+#endif /* HAVE_RT_MP_ALGO */
+
/* Initialisation of zebra and installation of commands. */
void
zebra_init (void)
@@ -1708,6 +1797,10 @@ zebra_init (void)
install_node (&table_node, config_write_table);
install_node (&forwarding_node, config_write_forwarding);
+#ifdef HAVE_RT_MP_ALGO
+ install_node (&multipath_node, config_write_multipath);
+#endif
+
install_element (VIEW_NODE, &show_ip_forwarding_cmd);
install_element (ENABLE_NODE, &show_ip_forwarding_cmd);
install_element (CONFIG_NODE, &ip_forwarding_cmd);
@@ -1718,6 +1811,14 @@ zebra_init (void)
install_element (VIEW_NODE, &show_table_cmd);
install_element (ENABLE_NODE, &show_table_cmd);
install_element (CONFIG_NODE, &config_table_cmd);
+#ifdef HAVE_RT_MP_ALGO
+ install_element (CONFIG_NODE, &multipath_rr_cmd);
+ install_element (CONFIG_NODE, &multipath_drr_cmd);
+ install_element (CONFIG_NODE, &multipath_random_cmd);
+ install_element (CONFIG_NODE, &multipath_wrandom_cmd);
+ install_element (CONFIG_NODE, &no_multipath_cmd);
+ install_element (ENABLE_NODE, &show_multipath_cmd);
+#endif /* HAVE_RT_MP_ALGO */
#endif /* HAVE_NETLINK */
#ifdef HAVE_IPV6
--- a/zebra/zserv.h
+++ b/zebra/zserv.h
@@ -55,6 +55,9 @@ struct zserv
/* default routing table this client munges */
int rtm_table;
+ /* multipath policy */
+ u_int32_t mpath;
+
/* This client's redistribute flag. */
u_char redist[ZEBRA_ROUTE_MAX];
@@ -78,6 +81,9 @@ struct zebra_t
/* default table */
int rtm_table_default;
+ /* multipath policy */
+ u_int32_t mpath;
+
/* rib work queue */
struct work_queue *ribq;
struct meta_queue *mq;

View file

@ -1,16 +1,18 @@
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -109,6 +109,7 @@ bgp_accept (struct thread *thread)
@@ -188,8 +188,7 @@ bgp_accept (struct thread *thread)
peer->fd = bgp_sock;
peer->status = Active;
peer->local_id = peer1->local_id;
- peer->v_holdtime = peer1->v_holdtime;
- peer->v_keepalive = peer1->v_keepalive;
+ peer->v_holdtime = BGP_LARGE_HOLDTIME;
/* Make peer's address string. */
sockunion2str (&su, buf, SU_ADDRSTRLEN);
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -656,6 +656,7 @@ struct bgp_nlri
@@ -709,6 +709,7 @@ struct bgp_nlri
/* BGP timers default value. */
#define BGP_INIT_START_TIMER 5
#define BGP_ERROR_START_TIMER 30

View file

@ -1,8 +1,8 @@
--- a/lib/command.c
+++ b/lib/command.c
@@ -2567,6 +2567,13 @@
unlink (config_file_tmp);
return CMD_WARNING;
@@ -2601,6 +2601,13 @@ DEFUN (config_write_file,
VTY_NEWLINE);
goto finished;
}
+
+#if 0
@ -14,9 +14,9 @@
if (link (config_file, config_file_sav) != 0)
{
vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
@@ -2586,7 +2593,23 @@
unlink (config_file_tmp);
return CMD_WARNING;
@@ -2614,7 +2621,23 @@ DEFUN (config_write_file,
VTY_NEWLINE);
goto finished;
}
+#else
+ /* And this is the code that hopefully does work */
@ -24,7 +24,7 @@
+ {
+ vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ goto finished;
+ }
+ sync ();
+#endif