diff options
Diffstat (limited to 'lib/nl.c')
-rw-r--r-- | lib/nl.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -559,7 +559,7 @@ do { \ static int recvmsgs(struct nl_sock *sk, struct nl_cb *cb) { - int n, err = 0, multipart = 0; + int n, err = 0, multipart = 0, interrupted = 0; unsigned char *buf = NULL; struct nlmsghdr *hdr; struct sockaddr_nl nla = {0}; @@ -631,6 +631,19 @@ continue_reading: if (hdr->nlmsg_flags & NLM_F_MULTI) multipart = 1; + + if (hdr->nlmsg_flags & NLM_F_DUMP_INTR) { + if (cb->cb_set[NL_CB_DUMP_INTR]) + NL_CB_CALL(cb, NL_CB_DUMP_INTR, msg); + else { + /* + * We have to continue reading to clear + * all messages until a NLMSG_DONE is + * received and report the inconsistency. + */ + interrupted = 1; + } + } /* Other side wishes to see an ack for this message */ if (hdr->nlmsg_flags & NLM_F_ACK) { @@ -738,6 +751,9 @@ out: free(buf); free(creds); + if (interrupted) + err = -NLE_DUMP_INTR; + return err; } |