summaryrefslogtreecommitdiffstats
path: root/pimd/pim_igmp_mtrace.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@openbsd.org>2018-03-23 16:33:11 +0100
committerGitHub <noreply@github.com>2018-03-23 16:33:11 +0100
commit73b3323c371d600302147ec7a08da5580eca4d23 (patch)
treeb9f57da583e04c407bbdc4c14d9d3386b51510f6 /pimd/pim_igmp_mtrace.c
parentMerge pull request #1945 from qlyoung/fix-vrf-static-routes (diff)
parentpimd: fix unaligned pointer access (diff)
downloadfrr-73b3323c371d600302147ec7a08da5580eca4d23.tar.xz
frr-73b3323c371d600302147ec7a08da5580eca4d23.zip
Merge pull request #1957 from qlyoung/fix-mtrace-unaligned-pointer-access
pimd: fix unaligned pointer access
Diffstat (limited to 'pimd/pim_igmp_mtrace.c')
-rw-r--r--pimd/pim_igmp_mtrace.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/pimd/pim_igmp_mtrace.c b/pimd/pim_igmp_mtrace.c
index 5167aa049..b183492e3 100644
--- a/pimd/pim_igmp_mtrace.c
+++ b/pimd/pim_igmp_mtrace.c
@@ -101,6 +101,13 @@ static void mtrace_debug(struct pim_interface *pim_ifp,
char dst_str[INET_ADDRSTRLEN];
char rsp_str[INET_ADDRSTRLEN];
+ struct in_addr ga, sa, da, ra;
+
+ ga = mtracep->grp_addr;
+ sa = mtracep->src_addr;
+ da = mtracep->dst_addr;
+ ra = mtracep->rsp_addr;
+
zlog_debug(
"Rx mtrace packet incoming on %s: "
"hops=%d type=%d size=%d, grp=%s, src=%s,"
@@ -108,13 +115,13 @@ static void mtrace_debug(struct pim_interface *pim_ifp,
inet_ntop(AF_INET, &(pim_ifp->primary_address), inc_str,
sizeof(inc_str)),
mtracep->hops, mtracep->type, mtrace_len,
- inet_ntop(AF_INET, &(mtracep->grp_addr), grp_str,
+ inet_ntop(AF_INET, &ga, grp_str,
sizeof(grp_str)),
- inet_ntop(AF_INET, &(mtracep->src_addr), src_str,
+ inet_ntop(AF_INET, &sa, src_str,
sizeof(src_str)),
- inet_ntop(AF_INET, &(mtracep->dst_addr), dst_str,
+ inet_ntop(AF_INET, &da, dst_str,
sizeof(dst_str)),
- inet_ntop(AF_INET, &(mtracep->rsp_addr), rsp_str,
+ inet_ntop(AF_INET, &ra, rsp_str,
sizeof(rsp_str)),
mtracep->rsp_ttl, ntohl(mtracep->qry_id));
if (mtrace_len > (int)sizeof(struct igmp_mtrace)) {