summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2022-01-04 16:50:53 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2022-01-12 18:24:07 +0100
commitd51f8b0f1e06bf72a80be2f65e3e505892d5fb50 (patch)
tree9204c64a3b12856677e8ab5b1dd219d29fd42b68
parent10fe382b134e768f1b4d61c98938034d9cab39b2 (diff)
pimd: move `%pSG4` to `%pPSG4`
Since this is only used in very few places, moving it out of the way is reasonable. (`%pSG` will be pim_sgaddr) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--doc/developer/logging.rst4
-rw-r--r--lib/prefix.c2
-rw-r--r--lib/prefix.h2
-rw-r--r--pimd/pim_join.c6
-rw-r--r--pimd/pim_mlag.c8
-rw-r--r--pimd/pim_oil.c4
-rw-r--r--pimd/pim_register.c5
-rw-r--r--tests/lib/test_printfrr.c8
8 files changed, 20 insertions, 19 deletions
diff --git a/doc/developer/logging.rst b/doc/developer/logging.rst
index eaf8625efa..e608046820 100644
--- a/doc/developer/logging.rst
+++ b/doc/developer/logging.rst
@@ -153,11 +153,11 @@ Networking data types
- :c:struct:`prefix_ls`
- :c:struct:`prefix_rd`
- :c:struct:`prefix_ptr`
- - :c:struct:`prefix_sg` (use :frrfmt:`%pSG4`)
+ - :c:struct:`prefix_sg` (use :frrfmt:`%pPSG4`)
- :c:union:`prefixptr` (dereference to get :c:struct:`prefix`)
- :c:union:`prefixconstptr` (dereference to get :c:struct:`prefix`)
-.. frrfmt:: %pSG4 (struct prefix_sg *)
+.. frrfmt:: %pPSG4 (struct prefix_sg *)
:frrfmtout:`(*,1.2.3.4)`
diff --git a/lib/prefix.c b/lib/prefix.c
index df753fe10b..d3e8a612eb 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -1421,7 +1421,7 @@ static ssize_t printfrr_pfx(struct fbuf *buf, struct printfrr_eargs *ea,
return bputs(buf, cbuf);
}
-printfrr_ext_autoreg_p("SG4", printfrr_psg)
+printfrr_ext_autoreg_p("PSG4", printfrr_psg)
static ssize_t printfrr_psg(struct fbuf *buf, struct printfrr_eargs *ea,
const void *ptr)
{
diff --git a/lib/prefix.h b/lib/prefix.h
index c92f5cec5a..f2773240d2 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -602,7 +602,7 @@ static inline int is_default_host_route(const struct prefix *p)
#pragma FRR printfrr_ext "%pFX" (struct prefix_evpn *)
#pragma FRR printfrr_ext "%pFX" (struct prefix_fs *)
-#pragma FRR printfrr_ext "%pSG4" (struct prefix_sg *)
+#pragma FRR printfrr_ext "%pPSG4" (struct prefix_sg *)
#endif
#ifdef __cplusplus
diff --git a/pimd/pim_join.c b/pimd/pim_join.c
index 4606aec6a1..b2e1b1a28a 100644
--- a/pimd/pim_join.c
+++ b/pimd/pim_join.c
@@ -87,8 +87,8 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
struct pim_rpf *rp = RP(pim_ifp->pim, sg->grp);
if (!rp) {
- zlog_warn("%s: Lookup of RP failed for %pSG4", __func__,
- sg);
+ zlog_warn("%s: Lookup of RP failed for %pPSG4",
+ __func__, sg);
return;
}
/*
@@ -160,7 +160,7 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,
pim_inet4_dump("<received?>", sg->src, received_rp,
sizeof(received_rp));
- zlog_debug("%s: Prune received with RP(%s) for %pSG4",
+ zlog_debug("%s: Prune received with RP(%s) for %pPSG4",
__func__, received_rp, sg);
}
diff --git a/pimd/pim_mlag.c b/pimd/pim_mlag.c
index 55d6e7e0fd..4f1cab7d5a 100644
--- a/pimd/pim_mlag.c
+++ b/pimd/pim_mlag.c
@@ -743,11 +743,11 @@ static void pim_mlag_process_mroute_add(struct mlag_mroute_add msg)
sg.src.s_addr = ntohl(msg.source_ip);
zlog_debug(
- "%s: msg dump: vrf_name: %s, s.ip: 0x%x, g.ip: 0x%x (%pSG4) cost: %u",
+ "%s: msg dump: vrf_name: %s, s.ip: 0x%x, g.ip: 0x%x (%pPSG4) cost: %u",
__func__, msg.vrf_name, msg.source_ip, msg.group_ip,
&sg, msg.cost_to_rp);
zlog_debug(
- "(%pSG4)owner_id: %d, DR: %d, Dual active: %d, vrf_id: 0x%x intf_name: %s",
+ "(%pPSG4)owner_id: %d, DR: %d, Dual active: %d, vrf_id: 0x%x intf_name: %s",
&sg, msg.owner_id, msg.am_i_dr, msg.am_i_dual_active,
msg.vrf_id, msg.intf_name);
}
@@ -772,10 +772,10 @@ static void pim_mlag_process_mroute_del(struct mlag_mroute_del msg)
sg.grp.s_addr = ntohl(msg.group_ip);
sg.src.s_addr = ntohl(msg.source_ip);
zlog_debug(
- "%s: msg dump: vrf_name: %s, s.ip: 0x%x, g.ip: 0x%x(%pSG4)",
+ "%s: msg dump: vrf_name: %s, s.ip: 0x%x, g.ip: 0x%x(%pPSG4)",
__func__, msg.vrf_name, msg.source_ip, msg.group_ip,
&sg);
- zlog_debug("(%pSG4)owner_id: %d, vrf_id: 0x%x intf_name: %s",
+ zlog_debug("(%pPSG4)owner_id: %d, vrf_id: 0x%x intf_name: %s",
&sg, msg.owner_id, msg.vrf_id, msg.intf_name);
}
diff --git a/pimd/pim_oil.c b/pimd/pim_oil.c
index c6fd6c4905..83424c1b69 100644
--- a/pimd/pim_oil.c
+++ b/pimd/pim_oil.c
@@ -145,7 +145,7 @@ struct channel_oil *pim_channel_oil_add(struct pim_instance *pim,
if (PIM_DEBUG_MROUTE)
zlog_debug(
- "%s(%s): Existing oil for %pSG4 Ref Count: %d (Post Increment)",
+ "%s(%s): Existing oil for %pPSG4 Ref Count: %d (Post Increment)",
__func__, name, sg, c_oil->oil_ref_count);
return c_oil;
}
@@ -178,7 +178,7 @@ struct channel_oil *pim_channel_oil_del(struct channel_oil *c_oil,
.grp = c_oil->oil.mfcc_origin};
zlog_debug(
- "%s(%s): Del oil for %pSG4, Ref Count: %d (Predecrement)",
+ "%s(%s): Del oil for %pPSG4, Ref Count: %d (Predecrement)",
__func__, name, &sg, c_oil->oil_ref_count);
}
--c_oil->oil_ref_count;
diff --git a/pimd/pim_register.c b/pimd/pim_register.c
index cc0dace7c2..57449f816b 100644
--- a/pimd/pim_register.c
+++ b/pimd/pim_register.c
@@ -415,8 +415,9 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
pim_inet4_dump("<src?>", src_addr,
src_str,
sizeof(src_str));
- zlog_debug("%s: Sending register-stop to %s for %pSG4 due to prefix-list denial, dropping packet",
- __func__, src_str, &sg);
+ zlog_debug(
+ "%s: Sending register-stop to %s for %pPSG4 due to prefix-list denial, dropping packet",
+ __func__, src_str, &sg);
}
return 0;
diff --git a/tests/lib/test_printfrr.c b/tests/lib/test_printfrr.c
index 8413b7b372..7694077574 100644
--- a/tests/lib/test_printfrr.c
+++ b/tests/lib/test_printfrr.c
@@ -206,16 +206,16 @@ int main(int argc, char **argv)
struct prefix_sg sg;
sg.src.s_addr = INADDR_ANY;
sg.grp.s_addr = INADDR_ANY;
- printchk("(*,*)", "%pSG4", &sg);
+ printchk("(*,*)", "%pPSG4", &sg);
inet_aton("192.168.1.2", &sg.src);
- printchk("(192.168.1.2,*)", "%pSG4", &sg);
+ printchk("(192.168.1.2,*)", "%pPSG4", &sg);
inet_aton("224.1.2.3", &sg.grp);
- printchk("(192.168.1.2,224.1.2.3)", "%pSG4", &sg);
+ printchk("(192.168.1.2,224.1.2.3)", "%pPSG4", &sg);
sg.src.s_addr = INADDR_ANY;
- printchk("(*,224.1.2.3)", "%pSG4", &sg);
+ printchk("(*,224.1.2.3)", "%pPSG4", &sg);
uint8_t randhex[] = { 0x12, 0x34, 0x00, 0xca, 0xfe, 0x00, 0xaa, 0x55 };