On 22 May 2016 at 17:56, Laurent Vivier <laur...@vivier.eu> wrote: > rtnetlink is needed to use iproute package (ip addr, ip route) > and dhcp client. > > +static abi_long target_to_host_for_each_nlmsg(struct nlmsghdr *nlh, > + size_t len, > + abi_long > (*target_to_host_nlmsg) > + (struct nlmsghdr *)) > +{ > + int ret; > + > + while (len > sizeof(struct nlmsghdr)) { > + if (tswap32(nlh->nlmsg_len) < sizeof(struct nlmsghdr) || > + tswap32(nlh->nlmsg_len) > len) { > + break; > + } > + tswap_nlmsghdr(nlh); > + switch (nlh->nlmsg_type) { > + case NLMSG_DONE: > + return 0; > + case NLMSG_NOOP: > + break; > + case NLMSG_ERROR: > + { > + struct nlmsgerr *e = NLMSG_DATA(nlh); > + e->error = tswap32(e->error); > + tswap_nlmsghdr(&e->msg); > + } > + default: > + ret = target_to_host_nlmsg(nlh); > + if (ret < 0) { > + return ret; > + } > + }
Coverity points out that the NLMSG_ERROR case falls through into the default. Missing "break" or missing "/* fallthrough */" comment? thanks -- PMM