summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Cherkashin2020-10-21 17:06:29 +0800
committerEvgeny Cherkashin2020-10-21 17:06:29 +0800
commit064392248f7a7991d38dce6ef6a2274777215d79 (patch)
tree703edf4ac439bb0c4fd66e0a8608f3c8c1fe2add
parenta6032dcb812cd35f39cecc0273dd4629a2b2fa70 (diff)
downloadaur-064392248f7a7991d38dce6ef6a2274777215d79.tar.gz
Patch stabilizing OSPFv3 ospf6d implementation.
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD5
-rw-r--r--ospf6d_ospf6_lsdb.pach272
3 files changed, 279 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 44d13122e545..102ca09c445c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = frr
pkgdesc = FRRouting (quagga fork) supports BGP4, OSPFv2, OSPFv3, ISIS, RIP, RIPng, PIM, LDP, BFD, VRRP, NHRP and EIGRP.
pkgver = 7.4
- pkgrel = 2
+ pkgrel = 6
url = https://frrouting.org/
arch = x86_64
license = GPL2
@@ -37,11 +37,13 @@ pkgbase = frr
source = frr.sysusers
source = frr.tmpfiles
source = frr_7.4_Archlinux.patch
+ source = ospf6d_ospf6_lsdb.pach
source = frr-init-functions
sha256sums = 3c8204fda1c9b178d8446562579bbbc49d134b98f3ad02aa56f68724a2f9e40a
sha256sums = 9371cc0522d13621c623b5da77719052bdebdceb7ffdbdc06fc32a2f07118e7e
sha256sums = 6f8dd86ef9c600763faead3052908531e8dc8ef67058e6f7f8da01bf0fe4eb89
sha256sums = 4662bcd384d40be42cc55182310cada2461c18f126f432dd31c9db286641bef8
+ sha256sums = cf5a042c78f9f32b68e9a3ec87e931a4916431a9392d5a8187407e8af4c8cef4
sha256sums = e6e2592a8b0b18f7f173186fb4ebf23e642b3d912179f0bb36251962ca64cd7a
pkgname = frr
diff --git a/PKGBUILD b/PKGBUILD
index ade8875caea6..042db2fafdb6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname='frr'
pkgver='7.4'
-pkgrel='2'
+pkgrel='6'
pkgdesc='FRRouting (quagga fork) supports BGP4, OSPFv2, OSPFv3, ISIS, RIP, RIPng, PIM, LDP, BFD, VRRP, NHRP and EIGRP.'
arch=('x86_64')
url="https://frrouting.org/"
@@ -23,15 +23,18 @@ source=("https://github.com/FRRouting/${pkgname}/archive/${pkgname}-${pkgver}.ta
"${pkgname}.sysusers"
"${pkgname}.tmpfiles"
"${pkgname}_${pkgver}_Archlinux.patch"
+ "ospf6d_ospf6_lsdb.pach"
"frr-init-functions")
sha256sums=('3c8204fda1c9b178d8446562579bbbc49d134b98f3ad02aa56f68724a2f9e40a'
'9371cc0522d13621c623b5da77719052bdebdceb7ffdbdc06fc32a2f07118e7e'
'6f8dd86ef9c600763faead3052908531e8dc8ef67058e6f7f8da01bf0fe4eb89'
'4662bcd384d40be42cc55182310cada2461c18f126f432dd31c9db286641bef8'
+ 'cf5a042c78f9f32b68e9a3ec87e931a4916431a9392d5a8187407e8af4c8cef4'
'e6e2592a8b0b18f7f173186fb4ebf23e642b3d912179f0bb36251962ca64cd7a')
prepare() {
cd "${srcdir}/${pkgname}-${pkgname}-${pkgver}"
+ patch -d ospf6d -i "${srcdir}/ospf6d_ospf6_lsdb.pach"
patch -p1 -i "${srcdir}/${pkgname}_${pkgver}_Archlinux.patch"
autoreconf -fvi
diff --git a/ospf6d_ospf6_lsdb.pach b/ospf6d_ospf6_lsdb.pach
new file mode 100644
index 000000000000..dba4401f9b2e
--- /dev/null
+++ b/ospf6d_ospf6_lsdb.pach
@@ -0,0 +1,272 @@
+diff --git ospf6d/ospf6_lsdb.c ospf6d/ospf6_lsdb.c
+index 0a9f1c6f7ce..b551dbdfa6e 100644
+--- ospf6d/ospf6_lsdb.c
++++ ospf6d/ospf6_lsdb.c
+@@ -298,17 +298,13 @@ struct ospf6_lsa *ospf6_lsdb_next(const struct route_node *iterend,
+
+ void ospf6_lsdb_remove_all(struct ospf6_lsdb *lsdb)
+ {
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+
+ if (lsdb == NULL)
+ return;
+
+- for (iterend = ospf6_lsdb_head(lsdb, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(lsdb, lsa))
+ ospf6_lsdb_remove(lsa, lsdb);
+- }
+ }
+
+ void ospf6_lsdb_lsa_unlock(struct ospf6_lsa *lsa)
+@@ -323,12 +319,9 @@ void ospf6_lsdb_lsa_unlock(struct ospf6_lsa *lsa)
+ int ospf6_lsdb_maxage_remover(struct ospf6_lsdb *lsdb)
+ {
+ int reschedule = 0;
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+
+- for (iterend = ospf6_lsdb_head(lsdb, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(lsdb, lsa)) {
+ if (!OSPF6_LSA_IS_MAXAGE(lsa))
+ continue;
+ if (lsa->retrans_count != 0) {
+diff --git ospf6d/ospf6_message.c ospf6d/ospf6_message.c
+index 31862a2298f..f891f548ae8 100644
+--- ospf6d/ospf6_message.c
++++ ospf6d/ospf6_message.c
+@@ -1859,8 +1859,7 @@ int ospf6_dbdesc_send(struct thread *thread)
+ int ospf6_dbdesc_send_newone(struct thread *thread)
+ {
+ struct ospf6_neighbor *on;
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+ unsigned int size = 0;
+
+ on = (struct ospf6_neighbor *)THREAD_ARG(thread);
+@@ -1870,10 +1869,7 @@ int ospf6_dbdesc_send_newone(struct thread *thread)
+ structure)
+ so that ospf6_send_dbdesc () can send those LSAs */
+ size = sizeof(struct ospf6_lsa_header) + sizeof(struct ospf6_dbdesc);
+-
+- for (iterend = ospf6_lsdb_head(on->summary_list, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(on->summary_list, lsa)) {
+ if (size + sizeof(struct ospf6_lsa_header)
+ > ospf6_packet_max(on->ospf6_if)) {
+ ospf6_lsdb_lsa_unlock(lsa);
+@@ -2016,8 +2012,7 @@ int ospf6_lsupdate_send_neighbor(struct thread *thread)
+ struct ospf6_lsupdate *lsupdate;
+ uint8_t *p;
+ int lsa_cnt;
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+
+ on = (struct ospf6_neighbor *)THREAD_ARG(thread);
+ on->thread_send_lsupdate = (struct thread *)NULL;
+@@ -2042,9 +2037,7 @@ int ospf6_lsupdate_send_neighbor(struct thread *thread)
+
+ /* lsupdate_list lists those LSA which doesn't need to be
+ retransmitted. remove those from the list */
+- for (iterend = ospf6_lsdb_head(on->lsupdate_list, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(on->lsupdate_list, lsa)) {
+ /* MTU check */
+ if ((p - sendbuf + (unsigned int)OSPF6_LSA_SIZE(lsa->header))
+ > ospf6_packet_max(on->ospf6_if)) {
+@@ -2074,7 +2067,7 @@ int ospf6_lsupdate_send_neighbor(struct thread *thread)
+ p += OSPF6_LSA_SIZE(lsa->header);
+ lsa_cnt++;
+
+- assert(lsa->lock == 1);
++ assert(lsa->lock == 2);
+ ospf6_lsdb_remove(lsa, on->lsupdate_list);
+ }
+
+@@ -2201,8 +2194,7 @@ int ospf6_lsupdate_send_interface(struct thread *thread)
+ struct ospf6_lsupdate *lsupdate;
+ uint8_t *p;
+ int lsa_cnt;
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+
+ oi = (struct ospf6_interface *)THREAD_ARG(thread);
+ oi->thread_send_lsupdate = (struct thread *)NULL;
+@@ -2228,9 +2220,7 @@ int ospf6_lsupdate_send_interface(struct thread *thread)
+ p = (uint8_t *)((caddr_t)lsupdate + sizeof(struct ospf6_lsupdate));
+ lsa_cnt = 0;
+
+- for (iterend = ospf6_lsdb_head(oi->lsupdate_list, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(oi->lsupdate_list, lsa)) {
+ /* MTU check */
+ if ((p - sendbuf + ((unsigned int)OSPF6_LSA_SIZE(lsa->header)))
+ > ospf6_packet_max(oi)) {
+@@ -2264,7 +2254,7 @@ int ospf6_lsupdate_send_interface(struct thread *thread)
+ p += OSPF6_LSA_SIZE(lsa->header);
+ lsa_cnt++;
+
+- assert(lsa->lock == 1);
++ assert(lsa->lock == 2);
+ ospf6_lsdb_remove(lsa, oi->lsupdate_list);
+ }
+
+@@ -2290,8 +2280,7 @@ int ospf6_lsack_send_neighbor(struct thread *thread)
+ struct ospf6_neighbor *on;
+ struct ospf6_header *oh;
+ uint8_t *p;
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+ int lsa_cnt = 0;
+
+ on = (struct ospf6_neighbor *)THREAD_ARG(thread);
+@@ -2314,9 +2303,7 @@ int ospf6_lsack_send_neighbor(struct thread *thread)
+
+ p = (uint8_t *)((caddr_t)oh + sizeof(struct ospf6_header));
+
+- for (iterend = ospf6_lsdb_head(on->lsack_list, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(on->lsack_list, lsa)) {
+ /* MTU check */
+ if (p - sendbuf + sizeof(struct ospf6_lsa_header)
+ > ospf6_packet_max(on->ospf6_if)) {
+@@ -2344,7 +2331,7 @@ int ospf6_lsack_send_neighbor(struct thread *thread)
+ memcpy(p, lsa->header, sizeof(struct ospf6_lsa_header));
+ p += sizeof(struct ospf6_lsa_header);
+
+- assert(lsa->lock == 1);
++ assert(lsa->lock == 2);
+ ospf6_lsdb_remove(lsa, on->lsack_list);
+ lsa_cnt++;
+ }
+@@ -2371,8 +2358,7 @@ int ospf6_lsack_send_interface(struct thread *thread)
+ struct ospf6_interface *oi;
+ struct ospf6_header *oh;
+ uint8_t *p;
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+ int lsa_cnt = 0;
+
+ oi = (struct ospf6_interface *)THREAD_ARG(thread);
+@@ -2396,9 +2382,7 @@ int ospf6_lsack_send_interface(struct thread *thread)
+
+ p = (uint8_t *)((caddr_t)oh + sizeof(struct ospf6_header));
+
+- for (iterend = ospf6_lsdb_head(oi->lsack_list, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(oi->lsack_list, lsa)) {
+ /* MTU check */
+ if (p - sendbuf + sizeof(struct ospf6_lsa_header)
+ > ospf6_packet_max(oi)) {
+@@ -2416,7 +2400,7 @@ int ospf6_lsack_send_interface(struct thread *thread)
+ memcpy(p, lsa->header, sizeof(struct ospf6_lsa_header));
+ p += sizeof(struct ospf6_lsa_header);
+
+- assert(lsa->lock == 1);
++ assert(lsa->lock == 2);
+ ospf6_lsdb_remove(lsa, oi->lsack_list);
+ lsa_cnt++;
+ }
+diff --git ospf6d/ospf6_neighbor.c ospf6d/ospf6_neighbor.c
+index 1e90d4b9b53..92a3c9e1adc 100644
+--- ospf6d/ospf6_neighbor.c
++++ ospf6d/ospf6_neighbor.c
+@@ -118,15 +118,11 @@ struct ospf6_neighbor *ospf6_neighbor_create(uint32_t router_id,
+
+ void ospf6_neighbor_delete(struct ospf6_neighbor *on)
+ {
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+
+ ospf6_lsdb_remove_all(on->summary_list);
+ ospf6_lsdb_remove_all(on->request_list);
+-
+- for (iterend = ospf6_lsdb_head(on->retrans_list, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(on->retrans_list, lsa)) {
+ ospf6_decrement_retrans_count(lsa);
+ ospf6_lsdb_remove(lsa, on->retrans_list);
+ }
+@@ -297,8 +293,7 @@ int twoway_received(struct thread *thread)
+ int negotiation_done(struct thread *thread)
+ {
+ struct ospf6_neighbor *on;
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+
+ on = (struct ospf6_neighbor *)THREAD_ARG(thread);
+ assert(on);
+@@ -312,10 +307,7 @@ int negotiation_done(struct thread *thread)
+ /* clear ls-list */
+ ospf6_lsdb_remove_all(on->summary_list);
+ ospf6_lsdb_remove_all(on->request_list);
+-
+- for (iterend = ospf6_lsdb_head(on->retrans_list, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(on->retrans_list, lsa)) {
+ ospf6_decrement_retrans_count(lsa);
+ ospf6_lsdb_remove(lsa, on->retrans_list);
+ }
+@@ -509,8 +501,7 @@ int seqnumber_mismatch(struct thread *thread)
+ int bad_lsreq(struct thread *thread)
+ {
+ struct ospf6_neighbor *on;
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+
+ on = (struct ospf6_neighbor *)THREAD_ARG(thread);
+ assert(on);
+@@ -529,10 +520,7 @@ int bad_lsreq(struct thread *thread)
+
+ ospf6_lsdb_remove_all(on->summary_list);
+ ospf6_lsdb_remove_all(on->request_list);
+-
+- for (iterend = ospf6_lsdb_head(on->retrans_list, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(on->retrans_list, lsa)) {
+ ospf6_decrement_retrans_count(lsa);
+ ospf6_lsdb_remove(lsa, on->retrans_list);
+ }
+@@ -550,8 +538,7 @@ int bad_lsreq(struct thread *thread)
+ int oneway_received(struct thread *thread)
+ {
+ struct ospf6_neighbor *on;
+- struct ospf6_lsa *lsa, *lsa_next;
+- const struct route_node *iterend;
++ struct ospf6_lsa *lsa;
+
+ on = (struct ospf6_neighbor *)THREAD_ARG(thread);
+ assert(on);
+@@ -568,9 +555,7 @@ int oneway_received(struct thread *thread)
+
+ ospf6_lsdb_remove_all(on->summary_list);
+ ospf6_lsdb_remove_all(on->request_list);
+- for (iterend = ospf6_lsdb_head(on->retrans_list, 0, 0, 0, &lsa); lsa;
+- lsa = lsa_next) {
+- lsa_next = ospf6_lsdb_next(iterend, lsa);
++ for (ALL_LSDB(on->retrans_list, lsa)) {
+ ospf6_decrement_retrans_count(lsa);
+ ospf6_lsdb_remove(lsa, on->retrans_list);
+ }