On Tue, 22 Dec 2015 17:31:34 +0900
Lorenzo Colitti <[email protected]> wrote:
>
> +static int kill_inet_sock(const struct sockaddr_nl *addr,
> + struct nlmsghdr *h, void *arg)
> +{
> + struct inet_diag_msg *d = NLMSG_DATA(h);
> + struct inet_diag_arg *diag_arg = arg;
> + struct rtnl_handle *rth = diag_arg->rth;
> + DIAG_REQUEST(req, struct inet_diag_req_v2 r);
> +
> + req.nlh.nlmsg_type = SOCK_DESTROY;
> + req.nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
> + req.nlh.nlmsg_seq = ++rth->seq;
> + req.r.sdiag_family = d->idiag_family;
> + req.r.sdiag_protocol = diag_arg->protocol;
> + req.r.id = d->id;
> +
> + return rtnl_send_check_ack(rth, &req.nlh, req.nlh.nlmsg_len, 1);
Just use rtnl_talk() instead, it does request/reply.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html