1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Fix bugs in OSPF MD5 authentication. First bug is that default

values for MD5 password ID changed during reconfigure, Second
bug is that BIRD chooses password in first-fit manner, but RFC
says that it should use the one with the latest generate-from.

It also modifies the syntax for multiple passwords.
Now it is possible to just add more 'password' statements
to the interface section and it is not needed to use
'passwords' section. Old syntax can be used too.
This commit is contained in:
Ondrej Zajicek
2008-11-08 17:24:23 +01:00
parent 08cca48a14
commit b21f68b4cd
8 changed files with 56 additions and 59 deletions

View File

@@ -14,19 +14,26 @@
struct password_item *last_password_item = NULL;
struct password_item *
password_find(list *l)
password_find(list *l, int first_fit)
{
struct password_item *pi;
struct password_item *pf = NULL;
if (l)
{
WALK_LIST(pi, *l)
{
if ((pi->genfrom < now_real) && (pi->gento > now_real))
return pi;
{
if (first_fit)
return pi;
if (!pf || pf->genfrom < pi->genfrom)
pf = pi;
}
}
}
return NULL;
return pf;
}
void password_cpy(char *dst, char *src, int size)