found = false; for (i = 0; i < addr_cnt; i++) {
ret = ceph_decode_entity_addr(p, end, &tmp_addr); if (ret) return ret;
dout("%s i %d addr %s\n", __func__, i, ceph_pr_addr(&tmp_addr)); if (tmp_addr.type == my_type) { if (found) {
pr_err("another match of type %d in addrvec\n",
le32_to_cpu(my_type)); return -EINVAL;
}
memcpy(addr, &tmp_addr, sizeof(*addr));
found = true;
}
}
if (found) return0;
if (!addr_cnt) return0; /* normal -- e.g. unused OSD id/slot */
if (addr_cnt == 1 && !memchr_inv(&tmp_addr, 0, sizeof(tmp_addr))) return0; /* weird but effectively the same as !addr_cnt */
pr_err("no match of type %d in addrvec\n", le32_to_cpu(my_type)); return -ENOENT;
switch (family) { case AF_INET: returnsizeof(u.sin); case AF_INET6: returnsizeof(u.sin6); default: returnsizeof(u);
}
}
int ceph_entity_addr_encoding_len(conststruct ceph_entity_addr *addr)
{
sa_family_t family = get_unaligned(&addr->in_addr.ss_family); int addr_len = get_sockaddr_encoding_len(family);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.