Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ripd/ripd.c - rip_auth_md5 : Change the start value of sequence 1 to 0 #16233

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

T-Nicolas
Copy link
Contributor

Start the sequence at zero to make md5 authentication compatible with bird

@@ -1051,7 +1051,7 @@ static size_t rip_auth_md5_ah_write(struct stream *s, struct rip_interface *ri,
/* RFC2080: The value used in the sequence number is
arbitrary, but two suggestions are the time of the
message's creation or a simple message counter. */
stream_putl(s, ++seq);
stream_putl(s, seq++);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain to me how what we are doing is wrong or incompatible(the rfc is 2082 actually )? This seems like a bug in bird not frr. The rfc states that the sequence number must increase. It is arbitrary and the two suggestions are a simple counter or the time of the message. If we implemented a time based count how would this also not break bird?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

The RFC does not actually define a starting value.

For simplicity's sake, starting from scratch doesn't seem like a bad idea.

Bird expects to have an increasing sequence or zero value when losing connectivity.

It is also possible to go back to the commit for time management

Copy link
Member

@ton31337 ton31337 Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rfc2082 says:

When connectivity to the
neighbor has been lost, the receiver SHOULD be ready to accept
either:

  • a message with a sequence number of zero
  • a message with a higher sequence number than the last received
    sequence number.

To me is sounds valid starting from zero (0), not 1. Where another side can accept it. (using a time solves a second bullet)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, this is something that needs to be addressed in bird not FRR. It's valid to send a 0 value to a neighbor and the receiving entity should accept it..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While starting from 0 is valid, I think it'd be better to start from time(NULL), and then move incrementally from there. That would be a simple way of solving the problem of the sequence number going backwards after restarting the daemon (#15049).

Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@T-Nicolas T-Nicolas changed the title ripd.c - rip_auth_md5 : Start sequence at 0 ripd/ripd.c - rip_auth_md5 : Change the start value of sequence 1 to 0 Jun 20, 2024
@ton31337
Copy link
Member

@frrbot rereview

Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups, please change the commit message to be:

ripd: Change the start value of sequence 1 to 0

@frrbot frrbot bot added the rip label Jun 25, 2024
@github-actions github-actions bot added the rebase PR needs rebase label Jun 25, 2024
@ton31337
Copy link
Member

Please sign the commit (more details: https://github.com/FRRouting/frr/pull/16233/checks?check_run_id=26663033876)

@ton31337
Copy link
Member

@Mergifyio backport dev/10.1 stable/10.0 stable/9.1 stable/9.0

Copy link

mergify bot commented Jun 30, 2024

backport dev/10.1 stable/10.0 stable/9.1 stable/9.0

✅ Backports have been created

@ton31337 ton31337 merged commit 0995964 into FRRouting:master Jul 1, 2024
11 checks passed
riw777 added a commit that referenced this pull request Jul 2, 2024
ripd/ripd.c - rip_auth_md5 : Change the start value of sequence 1 to 0 (backport #16233)
riw777 added a commit that referenced this pull request Jul 2, 2024
ripd/ripd.c - rip_auth_md5 : Change the start value of sequence 1 to 0 (backport #16233)
donaldsharp added a commit that referenced this pull request Jul 2, 2024
ripd/ripd.c - rip_auth_md5 : Change the start value of sequence 1 to 0 (backport #16233)
donaldsharp added a commit that referenced this pull request Jul 2, 2024
ripd/ripd.c - rip_auth_md5 : Change the start value of sequence 1 to 0 (backport #16233)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants