Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net
authorDavid S. Miller <davem@davemloft.net>
Tue, 18 Sep 2018 16:33:27 +0000 (09:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Sep 2018 16:33:27 +0000 (09:33 -0700)
Two new tls tests added in parallel in both net and net-next.

Used Stephen Rothwell's linux-next resolution.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 files changed:
1  2 
MAINTAINERS
drivers/net/ethernet/cadence/macb_main.c
drivers/net/ethernet/microchip/lan743x_main.c
drivers/net/veth.c
include/net/tls.h
kernel/bpf/verifier.c
net/core/filter.c
net/core/rtnetlink.c
net/ipv6/ip6_output.c
net/ipv6/route.c
net/sched/act_sample.c
net/tls/tls_sw.c
tools/include/uapi/linux/if_link.h
tools/testing/selftests/net/Makefile
tools/testing/selftests/net/tls.c

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index f4aa7cdb01cab8e45b3069ae55edc96a6ae8b655,b9c6ecfbcfea722b71c7c048cf19388527e00bb7..5ff51bac8b469903b70ec9304ef06cf60d265ed0
@@@ -1106,9 -930,14 +1106,16 @@@ pick_next_record
                                msg->msg_flags |= MSG_EOR;
                                if (control != TLS_RECORD_TYPE_DATA)
                                        goto recv_end;
 +                      } else {
 +                              break;
                        }
+               } else {
+                       /* MSG_PEEK right now cannot look beyond current skb
+                        * from strparser, meaning we cannot advance skb here
+                        * and thus unpause strparser since we'd loose original
+                        * one.
+                        */
+                       break;
                }
  
                /* If we have a new message from strparser, continue now. */
Simple merge
Simple merge
index 96fc6fe702939032af922cc34059d07ae4f11487,8fdfeafaf8c00b4b327c33e7eeac02a42979d3dc..11d54c36ae49a019d940d1902ce5632c7282a7a2
@@@ -502,28 -502,55 +502,78 @@@ TEST_F(tls, recv_peek_multiple
        EXPECT_EQ(memcmp(test_str, buf, send_len), 0);
  }
  
+ TEST_F(tls, recv_peek_multiple_records)
+ {
+       char const *test_str = "test_read_peek_mult_recs";
+       char const *test_str_first = "test_read_peek";
+       char const *test_str_second = "_mult_recs";
+       int len;
+       char buf[64];
+       len = strlen(test_str_first);
+       EXPECT_EQ(send(self->fd, test_str_first, len, 0), len);
+       len = strlen(test_str_second) + 1;
+       EXPECT_EQ(send(self->fd, test_str_second, len, 0), len);
+       len = sizeof(buf);
+       memset(buf, 0, len);
+       EXPECT_NE(recv(self->cfd, buf, len, MSG_PEEK), -1);
+       /* MSG_PEEK can only peek into the current record. */
+       len = strlen(test_str_first) + 1;
+       EXPECT_EQ(memcmp(test_str_first, buf, len), 0);
+       len = sizeof(buf);
+       memset(buf, 0, len);
+       EXPECT_NE(recv(self->cfd, buf, len, 0), -1);
+       /* Non-MSG_PEEK will advance strparser (and therefore record)
+        * however.
+        */
+       len = strlen(test_str) + 1;
+       EXPECT_EQ(memcmp(test_str, buf, len), 0);
+       /* MSG_MORE will hold current record open, so later MSG_PEEK
+        * will see everything.
+        */
+       len = strlen(test_str_first);
+       EXPECT_EQ(send(self->fd, test_str_first, len, MSG_MORE), len);
+       len = strlen(test_str_second) + 1;
+       EXPECT_EQ(send(self->fd, test_str_second, len, 0), len);
+       len = sizeof(buf);
+       memset(buf, 0, len);
+       EXPECT_NE(recv(self->cfd, buf, len, MSG_PEEK), -1);
+       len = strlen(test_str) + 1;
+       EXPECT_EQ(memcmp(test_str, buf, len), 0);
+ }
 +TEST_F(tls, recv_peek_large_buf_mult_recs)
 +{
 +      char const *test_str = "test_read_peek_mult_recs";
 +      char const *test_str_first = "test_read_peek";
 +      char const *test_str_second = "_mult_recs";
 +      int len;
 +      char buf[64];
 +
 +      len = strlen(test_str_first);
 +      EXPECT_EQ(send(self->fd, test_str_first, len, 0), len);
 +
 +      len = strlen(test_str_second) + 1;
 +      EXPECT_EQ(send(self->fd, test_str_second, len, 0), len);
 +
 +      len = sizeof(buf);
 +      memset(buf, 0, len);
 +      EXPECT_NE(recv(self->cfd, buf, len, MSG_PEEK), -1);
 +
 +      len = strlen(test_str) + 1;
 +      EXPECT_EQ(memcmp(test_str, buf, len), 0);
 +}
 +
++
  TEST_F(tls, pollin)
  {
        char const *test_str = "test_poll";