]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
only perform automatic sequence checking if auto-ack mode is enabled
authorThomas Graf <tgraf@suug.ch>
Thu, 18 Nov 2010 11:51:20 +0000 (12:51 +0100)
committerThomas Graf <tgraf@suug.ch>
Thu, 18 Nov 2010 11:51:20 +0000 (12:51 +0100)
lib/nl.c

index 13c0514abade7cfa6657e72537ac2736051bcbe4..d3fef04a2131877ca0a001649eab639ca0e99abb 100644 (file)
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -548,14 +548,18 @@ continue_reading:
                /* Sequence number checking. The check may be done by
                 * the user, otherwise a very simple check is applied
                 * enforcing strict ordering */
-               if (cb->cb_set[NL_CB_SEQ_CHECK])
+               if (cb->cb_set[NL_CB_SEQ_CHECK]) {
                        NL_CB_CALL(cb, NL_CB_SEQ_CHECK, msg);
-               else if (hdr->nlmsg_seq != sk->s_seq_expect) {
-                       if (cb->cb_set[NL_CB_INVALID])
-                               NL_CB_CALL(cb, NL_CB_INVALID, msg);
-                       else {
-                               err = -NLE_SEQ_MISMATCH;
-                               goto out;
+
+               /* Only do sequence checking if auto-ack mode is enabled */
+               } else if (!(sk->s_flags & NL_NO_AUTO_ACK)) {
+                       if (hdr->nlmsg_seq != sk->s_seq_expect) {
+                               if (cb->cb_set[NL_CB_INVALID])
+                                       NL_CB_CALL(cb, NL_CB_INVALID, msg);
+                               else {
+                                       err = -NLE_SEQ_MISMATCH;
+                                       goto out;
+                               }
                        }
                }