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

nhrpd: fix passphrase handling, add topotest for resolution request #17115

Conversation

jmuthiilabn
Copy link
Contributor

Modified nhrp_topo topotest to test for newly added resolution request retry feature

Modified nhrp_connection_authorized() function so that debugging messages don't read into NHRP authentication extension as if it were a null-terminated string - which can lead to printing of non ASCII-compliant bytes.

Moved CISCO_PASS_LENGTH_LEN from nhrp_vty.c to nhrp_protocol.h for easier access to the macro in other files

@donaldsharp
Copy link
Member

Looks like frrbot and verify source are finding some issues that need to be cleaned up in the commit. Please take a second and do so.

@donaldsharp
Copy link
Member

Can we also rewrite the commit message to first discuss the code change and then the topotest change especially in more detail. When I started looking at the subject line I thought I was going to be looking at topotest changes only and frankly it's a bit confusing

@jmuthiilabn jmuthiilabn force-pushed the jmuthii/nhrpd-retry-resolution-topotest branch from 32ddfd1 to c4c2808 Compare October 21, 2024 16:57
@github-actions github-actions bot added the rebase PR needs rebase label Oct 21, 2024
@jmuthiilabn jmuthiilabn force-pushed the jmuthii/nhrpd-retry-resolution-topotest branch 3 times, most recently from ce91fd8 to c644d59 Compare October 21, 2024 23:45
@jmuthiilabn
Copy link
Contributor Author

@donaldsharp How's the commit message now? I tried to be a little more descriptive but don't mind changing it again if it's still a little vague.

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

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

looks good

@riw777
Copy link
Member

riw777 commented Oct 22, 2024

I don't think these lint errors need to be fixed, but I'd like @donaldsharp or @ton31337 to make certain before pushing

@jmuthiilabn jmuthiilabn force-pushed the jmuthii/nhrpd-retry-resolution-topotest branch from c644d59 to a3fb903 Compare October 22, 2024 16:46
@jmuthiilabn
Copy link
Contributor Author

@donaldsharp @ton31337 Do these changes look good to you guys? I tried to fix up the commit message and fix up any of the lint errors. Of course I'll try to be receptive to anything other changes you guys recommend.

@Jafaral
Copy link
Member

Jafaral commented Oct 28, 2024

I really like to see topotest changes split into their own commit. Can you please do that?

@Jafaral
Copy link
Member

Jafaral commented Oct 28, 2024

Also, can you change the topic of the PR to reflect the added feature. The main addition is the the feature, the topotest is there just to make sure the new feature works.

@jmuthiilabn
Copy link
Contributor Author

@Jafaral Yeah, I can split the commits up for the bug fix and the topotest, no problem. Just to be clear though, this PR is for a topotest for a feature that has already been merged: #16788 . The code change mentioned in this PR is just a bug I came across while writing the topotest. It's a bug that was causing issues with the topotest (as in the topotest doesn't run with this bug present) so I figured it makes sense to both fix the bug and add the topotest in the same PR. But the main thing I was going for here was the topotest.

Do you still think I should change it? I'm sure it wouldn't be hard to make the PR focus on the code change if that's what you want.

@jmuthiilabn jmuthiilabn force-pushed the jmuthii/nhrpd-retry-resolution-topotest branch from a3fb903 to c410aec Compare October 29, 2024 17:13
Modified nhrp_topo topotest to test for newly added resolution
request retry feature. Changes to the topotest include adding a spoke to the
existing nhrp_topo topotest so that a topology with two spokes and hub
can be used to create shortcuts and test the sending/resending of
resolution requests and responses between spoke and hub. The resolution
request retry feature was tested by blocking incoming resolution requests on a
receiving nodes to stop the creation of a successful shortcut - which
then triggered the sending spoke to retry sending resolution requests

Signed-off-by: Joshua Muthii <[email protected]>
Modified nhrp_connection_authorized(). Initially, when writing debug
information about incoming NHRP packets with authentication enabled,
the nhrp_connection_authorized() function would print the
passphrase of the incoming packet as if it were a null terminated
string. This meant that if the passphrase on the incoming packet
had non ASCII-complient bytes in it, it would attempt to print those
bytes anyway. There was also no check that the size of the passphrase in
the incoming packet matched the size of the passphrase on the interface.
The changes in this commit log the passphrase on the incoming packet as
well as the passphrase on interface in HEX to avoid issues with ASCII.
It also performs a check that accounts for the sizes of the two different
passphrases

Moved CISCO_PASS_LENGTH_LEN from nhrp_vty.c to nhrp_protocol.h
for easier access  to the macro in other files

Signed-off-by: Joshua Muthii <[email protected]>
@jmuthiilabn jmuthiilabn force-pushed the jmuthii/nhrpd-retry-resolution-topotest branch from c410aec to 5718ee3 Compare October 29, 2024 17:16
@Jafaral Jafaral changed the title nhrpd: Add topotest for retrying resolution request nhrpd: fix passphrase handling, add topotest for resolution request Oct 29, 2024
@Jafaral
Copy link
Member

Jafaral commented Oct 29, 2024

Thanks @jmuthiilabn. I did change the title to capture the scope of the changes. Feel free to change as you see fit.

@Jafaral
Copy link
Member

Jafaral commented Oct 29, 2024

@Mergifyio backport dev/10.2

Copy link

mergify bot commented Oct 29, 2024

backport dev/10.2

✅ Backports have been created

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

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

looks good

@riw777 riw777 merged commit ab2117d into FRRouting:master Nov 5, 2024
11 checks passed
donaldsharp added a commit that referenced this pull request Nov 5, 2024
nhrpd: fix passphrase handling, add topotest for resolution request (backport #17115)
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