]> git.puffer.fish Git - mirror/frr.git/commitdiff
nhrpd: fixes duplicate auth extension 16820/head
authorDenys Haryachyy <garyachy@gmail.com>
Thu, 12 Sep 2024 07:28:28 +0000 (07:28 +0000)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Fri, 13 Sep 2024 14:52:34 +0000 (14:52 +0000)
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 #16507

Signed-off-by: Denys Haryachyy <garyachy@gmail.com>
(cherry picked from commit 8e3c278bbcd0ced1d4058cc7a2c9aebdfbc8b651)

nhrpd/nhrp_peer.c

index 6e7857c777a033e250a6ccaf0c587bbf9030fd0b..1e149a1674a4347c57a8f566c39fe20c51b0e984 100644 (file)
@@ -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;