]> git.puffer.fish Git - matthieu/frr.git/commitdiff
nhrpd: Make some debug prints more informative
authorPhilippe Guibert <philippe.guibert@6wind.com>
Sun, 28 Mar 2021 21:21:16 +0000 (10:21 +1300)
committerReuben Dowle <reuben.dowle@4rf.com>
Sun, 28 Mar 2021 21:21:16 +0000 (10:21 +1300)
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
nhrpd/nhrp_peer.c
nhrpd/nhrp_shortcut.c
nhrpd/nhrp_vty.c

index 50de251b55a393cdd9e5581a8ec83d9896f941f6..2819a6632fcbe7251e64dacc6be6c88971d7d4d4 100644 (file)
@@ -412,7 +412,7 @@ static void nhrp_process_nat_extension(struct nhrp_packet_parser *pp,
                                 * since it is behind a NAT device
                                 */
                                debugf(NHRP_DEBUG_COMMON,
-                                      "Processing NAT Extension for %pSU",
+                                      "shortcut res_resp: Processing NAT Extension for %pSU",
                                       proto);
                                while (nhrp_cie_pull(&payload, pp->hdr,
                                                     cie_nbma, &cie_proto)) {
@@ -422,7 +422,7 @@ static void nhrp_process_nat_extension(struct nhrp_packet_parser *pp,
 
                                        if (!sockunion_cmp(proto, &cie_proto)) {
                                                debugf(NHRP_DEBUG_COMMON,
-                                                      "cie_nbma for proto %pSU is %pSU",
+                                                      "\tcie_nbma for proto %pSU is %pSU",
                                                       proto, cie_nbma);
                                                break;
                                        }
@@ -507,18 +507,16 @@ static void nhrp_handle_resolution_req(struct nhrp_packet_parser *pp)
                         * coming directly from NATTED Spoke and there is not
                         * NAT Extension present
                         */
-                       debugf(NHRP_DEBUG_COMMON, "No NAT Extension for %pSU",
+                       debugf(NHRP_DEBUG_COMMON, "shortcut res_rep: No NAT Extension for %pSU",
                               proto_addr);
 
                        if (!sockunion_same(&pp->src_nbma,
                                            &pp->peer->vc->remote.nbma)
                            && !nhrp_nhs_match_ip(&pp->peer->vc->remote.nbma,
                                                  nifp)) {
-                               debugf(NHRP_DEBUG_COMMON,
-                                      "Remote Device is NATTED");
                                cie_nbma_nat = pp->peer->vc->remote.nbma;
                                debugf(NHRP_DEBUG_COMMON,
-                                      "Device is natted using %pSU as cie_nbma",
+                                      "shortcut res_rep: NAT detected using %pSU as cie_nbma",
                                       &cie_nbma_nat);
                        }
                }
index dfa2fe633352386e8b75cdcfe3623f7e10acd686..8ca217e5ffba96ec95a16c5a2e6fec998426dc61 100644 (file)
@@ -301,7 +301,7 @@ static void nhrp_shortcut_recv_resolution_rep(struct nhrp_reqid *reqid,
        /* Update cache entry for the protocol to nbma binding */
        if (sockunion_family(&nat_nbma) != AF_UNSPEC) {
                debugf(NHRP_DEBUG_COMMON,
-                      "Remote Device is NATed (NAT extension) proto %pSU NBMA %pSU claimed-NBMA %pSU",
+                      "Shortcut: NAT detected (NAT extension) proto %pSU NBMA %pSU claimed-NBMA %pSU",
                       proto, &nat_nbma, &cie_nbma);
                nbma = &nat_nbma;
        }
@@ -311,7 +311,7 @@ static void nhrp_shortcut_recv_resolution_rep(struct nhrp_reqid *reqid,
        else if (!sockunion_same(&cie_nbma, &pp->peer->vc->remote.nbma)
                 && !nhrp_nhs_match_ip(&pp->peer->vc->remote.nbma, nifp)) {
                debugf(NHRP_DEBUG_COMMON,
-                      "Remote Device is NATed (no NAT Extension) proto %pSU NBMA %pSU claimed-NBMA %pSU",
+                      "Shortcut: NAT detected (no NAT Extension) proto %pSU NBMA %pSU claimed-NBMA %pSU",
                       proto, &pp->peer->vc->remote.nbma, &cie_nbma);
                nbma = &pp->peer->vc->remote.nbma;
                nat_nbma = *nbma;
index a634d2df156dd96fc4c9cfcf829477abf80b3121..b91c97f3b6b2e976c460fe60f5ba0a8a0d334280 100644 (file)
@@ -669,7 +669,7 @@ static void show_ip_nhrp_cache(struct nhrp_cache *c, void *pctx)
 
                if (c->cur.peer
                    && sockunion_family(&c->cur.remote_nbma_claimed)
-                              != AF_UNSPEC)
+                   != AF_UNSPEC)
                        sockunion2str(&c->cur.remote_nbma_claimed,
                                      buf[2], sizeof(buf[2]));
                else