diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-04-08 08:57:15 +0300 |
|---|---|---|
| committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-04-08 17:15:06 +0300 |
| commit | c4efd0f4235d1151a95add06ad5ccb42c7dcff21 (patch) | |
| tree | 9aaff71f3b3ae6c23457092f6c78a25deec6adb7 /pimd/pim_tlv.c | |
| parent | c446af503e10e6b976500af81aa159512430d0d6 (diff) | |
*: Do not cast to the same type
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'pimd/pim_tlv.c')
| -rw-r--r-- | pimd/pim_tlv.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/pimd/pim_tlv.c b/pimd/pim_tlv.c index 881a3e332a..633bb207bd 100644 --- a/pimd/pim_tlv.c +++ b/pimd/pim_tlv.c @@ -121,20 +121,19 @@ int pim_encode_addr_ucast(uint8_t *buf, struct prefix *p) { switch (p->family) { case AF_INET: - *(uint8_t *)buf = - PIM_MSG_ADDRESS_FAMILY_IPV4; /* notice: AF_INET != - PIM_MSG_ADDRESS_FAMILY_IPV4 - */ + *buf = PIM_MSG_ADDRESS_FAMILY_IPV4; /* notice: AF_INET != + PIM_MSG_ADDRESS_FAMILY_IPV4 + */ ++buf; - *(uint8_t *)buf = 0; /* ucast IPv4 native encoding type (RFC + *buf = 0; /* ucast IPv4 native encoding type (RFC 4601: 4.9.1) */ ++buf; memcpy(buf, &p->u.prefix4, sizeof(struct in_addr)); return ucast_ipv4_encoding_len; case AF_INET6: - *(uint8_t *)buf = PIM_MSG_ADDRESS_FAMILY_IPV6; + *buf = PIM_MSG_ADDRESS_FAMILY_IPV6; ++buf; - *(uint8_t *)buf = 0; + *buf = 0; ++buf; memcpy(buf, &p->u.prefix6, sizeof(struct in6_addr)); return ucast_ipv6_encoding_len; @@ -198,13 +197,13 @@ int pim_encode_addr_group(uint8_t *buf, afi_t afi, int bidir, int scope, switch (afi) { case AFI_IP: - *(uint8_t *)buf = PIM_MSG_ADDRESS_FAMILY_IPV4; + *buf = PIM_MSG_ADDRESS_FAMILY_IPV4; ++buf; - *(uint8_t *)buf = 0; + *buf = 0; ++buf; - *(uint8_t *)buf = flags; + *buf = flags; ++buf; - *(uint8_t *)buf = 32; + *buf = 32; ++buf; memcpy(buf, &group, sizeof(struct in_addr)); return group_ipv4_encoding_len; |
