diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 3e74db8111..32b9763c56 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -1030,7 +1030,7 @@ static int zfpm_build_route_updates(void) */ return FPM_GOTO_NEXT_Q; } - } while (1); + } while (true); } /* @@ -1623,8 +1623,7 @@ static int zfpm_trigger_rmac_update(zebra_mac_t *rmac, zebra_l3vni_t *zl3vni, if (!fpm_mac) return 0; - memcpy(&fpm_mac->zebra_flags, &rmac->flags, sizeof(uint32_t)); - + fpm_mac->zebra_flags = rmac->flags; fpm_mac->vxlan_if = vxlan_if ? vxlan_if->ifindex : 0; fpm_mac->svi_if = svi_if ? svi_if->ifindex : 0; diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c index 4f2013585d..d5479bc627 100644 --- a/zebra/zebra_fpm_netlink.c +++ b/zebra/zebra_fpm_netlink.c @@ -594,14 +594,14 @@ int zfpm_netlink_encode_mac(struct fpm_mac_info_t *mac, char *in_buf, char buf1[ETHER_ADDR_STRLEN]; size_t buf_offset; - struct { + struct macmsg { struct nlmsghdr hdr; struct ndmsg ndm; char buf[0]; } *req; req = (void *)in_buf; - buf_offset = ((char *)req->buf) - ((char *)req); + buf_offset = offsetof(struct macmsg, buf); if (in_buf_len < buf_offset) return 0; memset(req, 0, buf_offset);