@@ -2618,7 +2618,7 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk,
spin_lock(&sk->sk_receive_queue.lock);
- if (copied) {
+ if (copied && (!u->oob_skb || skb == u->oob_skb)) {
skb = NULL;
} else if (flags & MSG_PEEK) {
skb = skb_peek_next(skb, &sk->sk_receive_queue);
@@ -288,4 +288,20 @@ TEST_F(msg_oob, ex_oob_drop_2)
}
}
+TEST_F(msg_oob, ex_oob_ahead_break)
+{
+ sendpair("hello", 5, MSG_OOB);
+ sendpair("wor", 3, MSG_OOB);
+
+ recvpair("r", 1, 1, MSG_OOB);
+
+ sendpair("ld", 2, MSG_OOB);
+
+ tcp_incompliant {
+ recvpair("hellowol", 8, 10, 0); /* TCP recv()s "helloworl", why "r" ?? */
+ }
+
+ recvpair("d", 1, 1, MSG_OOB);
+}
+
TEST_HARNESS_MAIN