Skip to content

Commit

Permalink
nhrpd: fixes duplicate auth extension
Browse files Browse the repository at this point in the history
When an NHRP peer was forwarding a message, it was copying all
extensions from the originally received packet. The authentication
extension must be regenerated hop by hop per RFC2332.
This fix checks for the auth extension when copying extensions
and omits the original packet auth and instead regenerates a new auth extension.

Fix bug FRRouting#16507

Signed-off-by: Denys Haryachyy <[email protected]>
  • Loading branch information
garyachy committed Sep 12, 2024
1 parent bf1fa1b commit 8e3c278
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nhrpd/nhrp_peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,12 @@ static void nhrp_handle_resolution_req(struct nhrp_packet_parser *pp)
nhrp_ext_complete(zb, ext);
}
break;
case NHRP_EXTENSION_AUTHENTICATION:
/* Extensions can be copied from original packet except
* authentication extension which must be regenerated
* hop by hop.
*/
break;
default:
if (nhrp_ext_reply(zb, hdr, ifp, ext, &payload) < 0)
goto err;
Expand Down

0 comments on commit 8e3c278

Please sign in to comment.