diff options
author | Maria Matejka <mq@ucw.cz> | 2022-11-07 10:24:56 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-11-07 10:24:56 +0100 |
commit | 54179a1ab38542e7087db37bfe3de9d32886c78e (patch) | |
tree | ca4238a2046bd5b6be90dab52b5b0cd3ab8663c0 /nest/rt-table.c | |
parent | 96d380405701bb01d792ff1c867a607d7fefa001 (diff) | |
parent | 8f79e6b93e32a4eb7e4dda9bd4a9d04400b79d45 (diff) |
Merge commit '8f79e6b9' into thread-next
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r-- | nest/rt-table.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c index 8980f147..f4ca9170 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -4740,6 +4740,7 @@ rt_update_hostcache(void *data) static struct hostentry * rt_get_hostentry(struct rtable_private *tab, ip_addr a, ip_addr ll, rtable *dep) { + ip_addr link = ipa_zero(ll) ? a : ll; struct hostentry *he; if (!tab->hostcache) @@ -4748,10 +4749,10 @@ rt_get_hostentry(struct rtable_private *tab, ip_addr a, ip_addr ll, rtable *dep) u32 k = hc_hash(a, dep); struct hostcache *hc = tab->hostcache; for (he = hc->hash_table[k >> hc->hash_shift]; he != NULL; he = he->next) - if (ipa_equal(he->addr, a) && (he->tab == dep)) + if (ipa_equal(he->addr, a) && ipa_equal(he->link, link) && (he->tab == dep)) return he; - he = hc_new_hostentry(hc, tab->rp, a, ipa_zero(ll) ? a : ll, dep, k); + he = hc_new_hostentry(hc, tab->rp, a, link, dep, k); rt_update_hostentry(tab, he); return he; } |