-Wno-unused-parameter \
-Wno-sign-compare \
-Wno-missing-field-initializers \
+ -Wpointer-arith \
$(NULL)
###############################################################################
NL_DBG(2, "msg %p: attr <%p> %d: Reserved %d (%d) bytes at offset +%td "
"nlmsg_len=%d\n", msg, nla, nla->nla_type,
nla_total_size(attrlen), attrlen,
- (void *) nla - nlmsg_data(msg->nm_nlh),
+ (char *) nla - (char *) nlmsg_data(msg->nm_nlh),
msg->nm_nlh->nlmsg_len);
return nla;
memcpy(nla_data(nla), data, datalen);
NL_DBG(2, "msg %p: attr <%p> %d: Wrote %d bytes at offset +%td\n",
msg, nla, nla->nla_type, datalen,
- (void *) nla - nlmsg_data(msg->nm_nlh));
+ (char *) nla - (char *) nlmsg_data(msg->nm_nlh));
}
return 0;
{
size_t pad, len;
- len = (void *) nlmsg_tail(msg->nm_nlh) - (void *) start;
+ len = (char *) nlmsg_tail(msg->nm_nlh) - (char *) start;
if ( len > USHRT_MAX
|| (!keep_empty && len == NLA_HDRLEN)) {
{
ssize_t len;
- len = (void *) nlmsg_tail(msg->nm_nlh) - (void *) attr;
+ len = (char *) nlmsg_tail(msg->nm_nlh) - (char *) attr;
if (len < 0)
BUG();
else if (len > 0) {
int nl_data_append(struct nl_data *data, const void *buf, size_t size)
{
if (size > 0) {
- void *d_data = realloc(data->d_data, data->d_size + size);
+ char *d_data = realloc(data->d_data, data->d_size + size);
if (!d_data)
return -NLE_NOMEM;
*/
void *genlmsg_user_data(const struct genlmsghdr *gnlh, const int hdrlen)
{
- return genlmsg_user_hdr(gnlh) + NLMSG_ALIGN(hdrlen);
+ return (char *) genlmsg_user_hdr(gnlh) + NLMSG_ALIGN(hdrlen);
}
/**
NL_DBG(2, "msg %p: Added generic netlink header cmd=%d version=%d\n",
msg, cmd, version);
- return nlmsg_data(nlh) + GENL_HDRLEN;
+ return (char *) nlmsg_data(nlh) + GENL_HDRLEN;
}
/** @} */
uint32_t nl_hash(void *k, size_t length, uint32_t initval)
{
- return(__nl_hash(k, length, initval));
+ return(__nl_hash((char *) k, length, initval));
}
/** @} */
*/
void *nlmsg_reserve(struct nl_msg *n, size_t len, int pad)
{
- void *buf = n->nm_nlh;
+ char *buf = (char *) n->nm_nlh;
size_t nlmsg_len = n->nm_nlh->nlmsg_len;
size_t tlen;
static void *print_genl_msg(struct nl_msg *msg, FILE *ofd, struct nlmsghdr *hdr,
struct nl_cache_ops *ops, int *payloadlen)
{
- void *data = nlmsg_data(hdr);
+ char *data = nlmsg_data(hdr);
if (*payloadlen < GENL_HDRLEN)
return data;
prefix_line(ofd, prefix);
fprintf(ofd, " [PADDING] %d octets\n",
padlen);
- dump_hex(ofd, nla_data(nla) + alen,
+ dump_hex(ofd, (char *) nla_data(nla) + alen,
padlen, prefix);
}
}
new->ce_mask = obj->ce_mask;
if (size)
- memcpy((void *)new + doff, (void *)obj + doff, size);
+ memcpy((char *)new + doff, (char *)obj + doff, size);
if (ops->oo_clone) {
if (ops->oo_clone(new, obj) < 0) {
}
hdr = nla_data(a);
- data = nla_data(a) + NLA_ALIGN(sizeof(*hdr));
+ data = (char *) nla_data(a) + NLA_ALIGN(sizeof(*hdr));
len = nla_len(a) - NLA_ALIGN(sizeof(*hdr));
NL_DBG(3, "ematch attribute matchid=%u, kind=%u, flags=%u\n",
if (!(n->pattern = calloc(1, plen)))
return -NLE_NOMEM;
- memcpy(n->pattern, data + hdrlen, plen);
+ memcpy(n->pattern, (char *) data + hdrlen, plen);
}
return 0;
if (!(t->pattern = calloc(1, t->cfg.pattern_len)))
return -NLE_NOMEM;
- memcpy(t->pattern, data + hdrlen, t->cfg.pattern_len);
+ memcpy(t->pattern, (char *) data + hdrlen, t->cfg.pattern_len);
}
return 0;
peer->l_index = ifi->ifi_index;
peer->l_flags = ifi->ifi_flags;
peer->l_change = ifi->ifi_change;
- err = nla_parse(peer_tb, IFLA_MAX,
- nla_data(nla_peer) + sizeof(struct ifinfomsg),
+ err = nla_parse(peer_tb, IFLA_MAX, (struct nlattr *)
+ ((char *) nla_data(nla_peer) + sizeof(struct ifinfomsg)),
nla_len(nla_peer) - sizeof(struct ifinfomsg),
rtln_link_policy);
if (err < 0)
struct nlattr *tb[TCA_MQPRIO_MAX + 1];
err = nla_parse(tb, TCA_MQPRIO_MAX, (struct nlattr *)
- (tc->tc_opts->d_data + NLA_ALIGN(sizeof(*qopt))),
+ ((char *) tc->tc_opts->d_data + NLA_ALIGN(sizeof(*qopt))),
len, mqprio_policy);
if (err < 0)
return err;
struct nlattr *tb[TCA_NETEM_MAX+1];
err = nla_parse(tb, TCA_NETEM_MAX, (struct nlattr *)
- (tc->tc_opts->d_data + sizeof(*opts)),
+ ((char *) tc->tc_opts->d_data + sizeof(*opts)),
len, netem_policy);
if (err < 0) {
free(netem);
* remainder of the message. That's just the way that sch_netem expects it.
* Maybe there's a more succinct way to do this at a higher level.
*/
- head = (struct nlattr *)(NLMSG_DATA(msg->nm_nlh) +
+ head = (struct nlattr *)(((char *) NLMSG_DATA(msg->nm_nlh)) +
NLMSG_LENGTH(sizeof(struct tcmsg)) - NLMSG_ALIGNTO);
- tail = (struct nlattr *)(((void *) (msg->nm_nlh)) +
+ tail = (struct nlattr *)(((char *) (msg->nm_nlh)) +
NLMSG_ALIGN(msg->nm_nlh->nlmsg_len));
old_len = head->nla_len;
- head->nla_len = (void *)tail - (void *)head;
+ head->nla_len = (char *)tail - (char *)head;
msg->nm_nlh->nlmsg_len += (head->nla_len - old_len);
return err;
nh_encap_build_msg(msg, nh->rtnh_encap) < 0)
goto nla_put_failure;
- rtnh->rtnh_len = nlmsg_tail(msg->nm_nlh) -
- (void *) rtnh;
+ rtnh->rtnh_len = (char *) nlmsg_tail(msg->nm_nlh) -
+ (char *) rtnh;
}
nla_nest_end(msg, multipath);
}
else if (n->nlmsg_type == XFRM_MSG_DELSA)
{
- sa_info = (struct xfrm_usersa_info*)(nlmsg_data(n) + sizeof (struct xfrm_usersa_id) + NLA_HDRLEN);
+ sa_info = (struct xfrm_usersa_info*)((char *)nlmsg_data(n) + sizeof (struct xfrm_usersa_id) + NLA_HDRLEN);
}
else
{
sp->ce_msgtype = n->nlmsg_type;
if (n->nlmsg_type == XFRM_MSG_DELPOLICY)
{
- sp_info = (struct xfrm_userpolicy_info*)(nlmsg_data(n) + sizeof (struct xfrm_userpolicy_id) + NLA_HDRLEN);
+ sp_info = (struct xfrm_userpolicy_info*)((char *)nlmsg_data(n) + sizeof (struct xfrm_userpolicy_id) + NLA_HDRLEN);
}
else
{
leaf = rtnl_class_leaf_qdisc(class, qdisc_cache);
if (leaf)
- print_qdisc((struct nl_object *) leaf, arg + 2);
+ print_qdisc((struct nl_object *) leaf, (char *) arg + 2);
- print_tc_childs(TC_CAST(class), arg + 2);
+ print_tc_childs(TC_CAST(class), (char *) arg + 2);
if (rtnl_cls_alloc_cache(sock, ifindex, parent, &cls_cache) < 0)
return;
params.dp_prefix = (int)(long) arg;
nl_object_dump(obj, ¶ms);
- print_tc_childs(TC_CAST(qdisc), arg + 2);
+ print_tc_childs(TC_CAST(qdisc), (char *) arg + 2);
if (rtnl_cls_alloc_cache(sock, ifindex, parent, &cls_cache) < 0)
return;