[OpenWrt-Devel] [PATCH] Quagga 0.99.23 CISCO EIGRP support

Lucian Cristian luci at createc.ro
Wed Nov 4 15:35:46 EST 2015


based on git: https://github.com/janovic/Quagga-EIGRP
tested with opennhrp (gre tunnels, no ipsec) and seems to work "as is 
per developer's readme"
the git is based on 0.99.23 should I try to backport it to the current 
openwrt quagga version ?

Regards

Lucian
-------------- next part --------------
--- a/eigrpd/eigrp_update.c
+++ b/eigrpd/eigrp_update.c
@@ -182,7 +182,7 @@ eigrp_update_receive (struct eigrp *eigr
 
 			  if (alist) {
 				  zlog_info ("ALIST:");
-				  zlog_info (alist->name);
+				  zlog_info ("%s", alist->name);
 			  } else {
 				  zlog_info("ALIST je prazdny");
 			  }
-------------- next part --------------
--- a/quagga/files/quagga	2015-11-04 17:12:46.000000000 +0200
+++ b/quagga/files/quagga	2015-11-04 21:18:20.000000000 +0200
@@ -29,7 +29,7 @@
 STATEDIR=/var/run/quagga
 RUNUSER=network
 RUNGROUP=$RUNUSER
-DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd"
+DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd eigrpd"
 DAEMON_FLAGS=-d
 WATCHQUAGGA_FLAGS="-d -z -T 60 -R"
 WATCHQUAGGA_CMD="$0 watchrestart"
--- a/quagga/Makefile	2015-11-04 17:12:46.000000000 +0200
+++ b/quagga/Makefile	2015-11-04 21:39:56.000000000 +0200
@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=quagga
-PKG_VERSION:=0.99.22.4
-PKG_RELEASE:=2
-PKG_MD5SUM:=03ef24a448be47beba80efa2152f8a28
+PKG_VERSION:=0.99.23
+PKG_RELEASE:=1
+PKG_MD5SUM:=75d4115223125367476186829efb9f22
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/quagga/
@@ -20,6 +20,8 @@
 	CONFIG_PACKAGE_quagga-zebra \
 	CONFIG_PACKAGE_quagga-libzebra \
 	CONFIG_PACKAGE_quagga-libospf \
+	CONFIG_PACKAGE_quagga-libeigrp \
+	CONFIG_PACKAGE_quagga-eigrpd \
 	CONFIG_PACKAGE_quagga-bgpd \
 	CONFIG_PACKAGE_quagga-isisd \
 	CONFIG_PACKAGE_quagga-ospf6d \
@@ -80,6 +82,17 @@
   TITLE:=OSPF library
 endef
 
+define Package/quagga-libeigrp
+  $(call Package/quagga/Default)
+  TITLE:=EIGRP library
+endef
+
+define Package/quagga-eigrpd
+  $(call Package/quagga/Default)
+  DEPENDS+=+quagga-libeigrp +quagga-libzebra
+  TITLE:=CISCO EIGRP routing engine
+endef
+
 define Package/quagga-bgpd
   $(call Package/quagga/Default)
   DEPENDS+=+quagga-libzebra
@@ -136,6 +149,10 @@
 /etc/quagga/bgpd.conf
 endef
 
+define Package/quagga-eigrpd/conffiles
+/etc/quagga/eigrp.conf
+endef
+
 define Package/quagga-isisd/conffiles
 /etc/quagga/isisd.conf
 endef
@@ -163,9 +180,11 @@
 ifneq ($(SDK),)
 CONFIG_PACKAGE_quagga-libzebra:=m
 CONFIG_PACKAGE_quagga-libospf:=m
+CONFIG_PACKAGE_quagga-libeigrp:=m
 CONFIG_PACKAGE_quagga-watchquagga:=m
 CONFIG_PACKAGE_quagga-zebra:=m
 CONFIG_PACKAGE_quagga-bgpd:=m
+CONFIG_PACKAGE_quagga-eigrpd:=m
 CONFIG_PACKAGE_quagga-isisd:=m
 CONFIG_PACKAGE_quagga-ospf6d:=m
 CONFIG_PACKAGE_quagga-ripd:=m
@@ -190,6 +209,7 @@
 	$(call autoconf_bool,CONFIG_PACKAGE_quagga-libospf,ospfd) \
 	$(call autoconf_bool,CONFIG_PACKAGE_quagga-bgpd,bgpd) \
 	$(call autoconf_bool,CONFIG_PACKAGE_quagga-isisd,isisd) \
+	$(call autoconf_bool,CONFIG_PACKAGE_quagga-libeigrp,eigrpd) \
 	$(call autoconf_bool,CONFIG_PACKAGE_quagga-ospf6d,ospf6d) \
 	$(call autoconf_bool,CONFIG_PACKAGE_quagga-ripd,ripd) \
 	$(call autoconf_bool,CONFIG_PACKAGE_quagga-ripngd,ripngd) \
@@ -243,6 +263,14 @@
 	$(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
 endef
 
+define Package/quagga-eigrpd/install
+	$(INSTALL_DIR) $(1)/usr/sbin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/eigrpd $(1)/usr/sbin/
+	$(INSTALL_DIR) $(1)/etc/quagga
+	chmod 0750 $(1)/etc/quagga
+	$(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/eigrpd.conf
+endef
+
 define Package/quagga-ospf6d/install
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
@@ -285,6 +313,11 @@
 	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
 endef
 
+define Package/quagga-libeigrp/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libeigrp.so.* $(1)/usr/lib/
+endef
+
 define Package/quagga-libzebra/install
 	$(INSTALL_DIR) $(1)/usr/lib
 	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
@@ -293,9 +326,11 @@
 $(eval $(call BuildPackage,quagga))
 $(eval $(call BuildPackage,quagga-libzebra))
 $(eval $(call BuildPackage,quagga-libospf))
+$(eval $(call BuildPackage,quagga-libeigrp))
 $(eval $(call BuildPackage,quagga-watchquagga))
 $(eval $(call BuildPackage,quagga-zebra))
 $(eval $(call BuildPackage,quagga-bgpd))
+$(eval $(call BuildPackage,quagga-eigrpd))
 $(eval $(call BuildPackage,quagga-isisd))
 $(eval $(call BuildPackage,quagga-ospfd))
 $(eval $(call BuildPackage,quagga-ospf6d))
Only in a/quagga/patches: 110-vtysh-fix-build-against-readline-6.3.patch
--- a/quagga/patches/120-quagga_manet.patch	2015-11-04 17:12:46.000000000 +0200
+++ b/quagga/patches/120-quagga_manet.patch	2015-11-04 18:07:55.000000000 +0200
@@ -1,13 +1,15 @@
 --- a/lib/log.c
 +++ b/lib/log.c
-@@ -925,13 +925,19 @@ proto_redistnum(int afi, const char *s)
+@@ -972,7 +972,7 @@ proto_redistnum(int afi, const char *s)
  	return ZEBRA_ROUTE_STATIC;
        else if (strncmp (s, "r", 1) == 0)
  	return ZEBRA_ROUTE_RIP;
 -      else if (strncmp (s, "o", 1) == 0)
 +      else if (strncmp (s, "os", 2) == 0)
  	return ZEBRA_ROUTE_OSPF;
-       else if (strncmp (s, "i", 1) == 0)
+       else if (strncmp (s, "e", 1) == 0)
+ 	return ZEBRA_ROUTE_EIGRP;
+@@ -980,7 +980,13 @@ proto_redistnum(int afi, const char *s)
  	return ZEBRA_ROUTE_ISIS;
        else if (strncmp (s, "bg", 2) == 0)
  	return ZEBRA_ROUTE_BGP;
@@ -22,7 +24,7 @@
  	return ZEBRA_ROUTE_BABEL;
      }
    if (afi == AFI_IP6)
-@@ -944,13 +950,19 @@ proto_redistnum(int afi, const char *s)
+@@ -993,13 +999,19 @@ proto_redistnum(int afi, const char *s)
  	return ZEBRA_ROUTE_STATIC;
        else if (strncmp (s, "r", 1) == 0)
  	return ZEBRA_ROUTE_RIPNG;
@@ -46,10 +48,11 @@
    return -1;
 --- a/lib/route_types.txt
 +++ b/lib/route_types.txt
-@@ -51,13 +51,9 @@ ZEBRA_ROUTE_OSPF,       ospf,      ospfd
- ZEBRA_ROUTE_OSPF6,      ospf6,     ospf6d, 'O', 0, 1, "OSPFv6"
+@@ -52,14 +52,10 @@
+ ZEBRA_ROUTE_EIGRP,      eigrp,     eigrpd, 'D', 1, 0, "EIGRP"
  ZEBRA_ROUTE_ISIS,       isis,      isisd,  'I', 1, 1, "IS-IS"
  ZEBRA_ROUTE_BGP,        bgp,       bgpd,   'B', 1, 1, "BGP"
+-ZEBRA_ROUTE_PIM,	pim,	   pimd,   'P', 1, 0, "PIM"
 -# HSLS and OLSR both are AFI independent (so: 1, 1), however
 -# we want to disable for them for general Quagga distribution.
 -# This at least makes it trivial for users of these protocols
@@ -57,15 +60,16 @@
 -# possible).
 -ZEBRA_ROUTE_HSLS,       hsls,      hslsd,  'H', 0, 0, "HSLS"
 -ZEBRA_ROUTE_OLSR,       olsr,      olsrd,  'o', 0, 0, "OLSR"
++ZEBRA_ROUTE_PIM,        pim,       pimd,   'P', 1, 0, "PIM"
 +ZEBRA_ROUTE_HSLS,       hsls,      hslsd,  'H', 1, 1, "HSLS"
 +ZEBRA_ROUTE_OLSR,       olsr,      olsrd,  'o', 1, 1, "OLSR"
 +ZEBRA_ROUTE_BATMAN,     batman,    batmand,'b', 1, 1, "BATMAN"
  ZEBRA_ROUTE_BABEL,      babel,     babeld, 'A', 1, 1, "Babel"
- 
+
  ## help strings
-@@ -72,5 +68,6 @@ ZEBRA_ROUTE_OSPF6,  "Open Shortest Path
- ZEBRA_ROUTE_ISIS,   "Intermediate System to Intermediate System (IS-IS)"
+@@ -76,5 +72,6 @@
  ZEBRA_ROUTE_BGP,    "Border Gateway Protocol (BGP)"
+ ZEBRA_ROUTE_PIM,    "Protocol Independent Multicast (PIM)"
  ZEBRA_ROUTE_HSLS,   "Hazy-Sighted Link State Protocol (HSLS)"
 -ZEBRA_ROUTE_OLSR,   "Optimised Link State Routing (OLSR)"
 +ZEBRA_ROUTE_OLSR,   "Optimized Link State Routing (OLSR)"
@@ -73,12 +77,13 @@
  ZEBRA_ROUTE_BABEL,  "Babel routing protocol (Babel)"
 --- a/ripd/rip_zebra.c
 +++ b/ripd/rip_zebra.c
-@@ -206,9 +206,12 @@ static struct {
+@@ -238,10 +238,13 @@ static struct {
    {ZEBRA_ROUTE_KERNEL,  1, "kernel"},
    {ZEBRA_ROUTE_CONNECT, 1, "connected"},
    {ZEBRA_ROUTE_STATIC,  1, "static"},
 -  {ZEBRA_ROUTE_OSPF,    1, "ospf"},
 +  {ZEBRA_ROUTE_OSPF,    2, "ospf"},
+   {ZEBRA_ROUTE_EIGRP,   1, "eigrp"},
    {ZEBRA_ROUTE_BGP,     2, "bgp"},
 -  {ZEBRA_ROUTE_BABEL,   2, "babel"},
 +  {ZEBRA_ROUTE_HSLS,    1, "hsls"},
@@ -107,21 +112,21 @@
  
 --- a/zebra/rt_netlink.c
 +++ b/zebra/rt_netlink.c
-@@ -1609,6 +1609,9 @@ netlink_route_multipath (int cmd, struct
-                         addattr_l (&req.n, sizeof req, RTA_PREFSRC,
- 				 &nexthop->src.ipv4, bytelen);
- 
-+		      if (rib->type == ZEBRA_ROUTE_OLSR)
-+			req.r.rtm_scope = RT_SCOPE_LINK;
+@@ -1808,6 +1808,9 @@ netlink_route_multipath (int cmd, struct
+       if (src)
+         addattr_l (&req.n, sizeof req, RTA_PREFSRC, &src->ipv4, bytelen);
+
++      if (rib->type == ZEBRA_ROUTE_OLSR)
++        req.r.rtm_scope = RT_SCOPE_LINK;
 +
- 		      if (IS_ZEBRA_DEBUG_KERNEL)
- 			zlog_debug("netlink_route_multipath() (single hop): "
- 				   "nexthop via if %u", nexthop->ifindex);
+       if (rta->rta_len > RTA_LENGTH (0))
+         addattr_l (&req.n, NL_PKT_BUF_SIZE, RTA_MULTIPATH, RTA_DATA (rta),
+                    RTA_PAYLOAD (rta));
 --- a/zebra/zebra_rib.c
 +++ b/zebra/zebra_rib.c
-@@ -68,6 +68,9 @@ static const struct
+@@ -69,6 +69,9 @@ static const struct
    [ZEBRA_ROUTE_OSPF6]   = {ZEBRA_ROUTE_OSPF6,   110},
-   [ZEBRA_ROUTE_ISIS]    = {ZEBRA_ROUTE_ISIS,    115},
+   [ZEBRA_ROUTE_EIGRP]   = {ZEBRA_ROUTE_EIGRP,    90},
    [ZEBRA_ROUTE_BGP]     = {ZEBRA_ROUTE_BGP,      20  /* IBGP is 200. */},
 +  [ZEBRA_ROUTE_HSLS]    = {ZEBRA_ROUTE_HSLS,      0},
 +  [ZEBRA_ROUTE_OLSR]    = {ZEBRA_ROUTE_OLSR,      0},
Only in b/quagga/patches: 190-eigrp-build.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quagga-0.99.23.tar.xz
Type: application/octet-stream
Size: 1468720 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20151104/b1701de0/attachment.obj>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list