fix address assigment
diff --git a/pimd/pim_tlv.c b/pimd/pim_tlv.c
index 4ce9a3d..962c2b8 100644
--- a/pimd/pim_tlv.c
+++ b/pimd/pim_tlv.c
@@ -148,7 +148,7 @@
++curr;
*(uint8_t *) curr = 0; /* ucast IPv4 native encoding type (RFC 4601: 4.9.1) */
++curr;
- *(struct in_addr *) curr = p->u.prefix4;
+ memcpy(curr, &p->u.prefix4, sizeof(struct in_addr));
curr += sizeof(struct in_addr);
option_len += ucast_ipv4_encoding_len;
@@ -404,7 +404,8 @@
}
p->family = AF_INET; /* notice: AF_INET != PIM_MSG_ADDRESS_FAMILY_IPV4 */
- p->u.prefix4 = *(const struct in_addr *) addr;
+ memcpy(&p->u.prefix4, addr, sizeof(struct in_addr));
+
addr += sizeof(struct in_addr);
break;
@@ -475,7 +476,7 @@
}
p->family = AF_INET; /* notice: AF_INET != PIM_MSG_ADDRESS_FAMILY_IPV4 */
- p->u.prefix4 = *(const struct in_addr *) addr;
+ memcpy(&p->u.prefix4, addr, sizeof(struct in_addr));
p->prefixlen = mask_len;
addr += sizeof(struct in_addr);
@@ -549,7 +550,7 @@
}
p->family = AF_INET; /* notice: AF_INET != PIM_MSG_ADDRESS_FAMILY_IPV4 */
- p->u.prefix4 = *(const struct in_addr *) addr;
+ memcpy(&p->u.prefix4, addr, sizeof(struct in_addr));
p->prefixlen = mask_len;
/*