aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-18 03:31:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-18 03:31:53 -0400
commit5211da9ca526a5adddee1ccd078e6e33a583ab36 (patch)
tree920969cb8b229aacf9115debb6bbe46e99a86679 /tools
parent3918c21eacb06e3d9d43f718354cbce6703f4812 (diff)
parent30bfd93062814d6767e452a8f5ddcd97f7e38c7e (diff)
Merge gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net
Dave writes: "Various fixes, all over the place: 1) OOB data generation fix in bluetooth, from Matias Karhumaa. 2) BPF BTF boundary calculation fix, from Martin KaFai Lau. 3) Don't bug on excessive frags, to be compatible in situations mixing older and newer kernels on each end. From Juergen Gross. 4) Scheduling in RCU fix in hv_netvsc, from Stephen Hemminger. 5) Zero keying information in TLS layer before freeing copies of them, from Sabrina Dubroca. 6) Fix NULL deref in act_sample, from Davide Caratti. 7) Orphan SKB before GRO in veth to prevent crashes with XDP, from Toshiaki Makita. 8) Fix use after free in ip6_xmit, from Eric Dumazet. 9) Fix VF mac address regression in bnxt_en, from Micahel Chan. 10) Fix MSG_PEEK behavior in TLS layer, from Daniel Borkmann. 11) Programming adjustments to r8169 which fix not being to enter deep sleep states on some machines, from Kai-Heng Feng and Hans de Goede. 12) Fix DST_NOCOUNT flag handling for ipv6 routes, from Peter Oskolkov." * gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net: (45 commits) net/ipv6: do not copy dst flags on rt init qmi_wwan: set DTR for modems in forced USB2 mode clk: x86: Stop marking clocks as CLK_IS_CRITICAL r8169: Get and enable optional ether_clk clock clk: x86: add "ether_clk" alias for Bay Trail / Cherry Trail r8169: enable ASPM on RTL8106E r8169: Align ASPM/CLKREQ setting function with vendor driver Revert "kcm: remove any offset before parsing messages" kcm: remove any offset before parsing messages net: ethernet: Fix a unused function warning. net: dsa: mv88e6xxx: Fix ATU Miss Violation tls: fix currently broken MSG_PEEK behavior hv_netvsc: pair VF based on serial number PCI: hv: support reporting serial number as slot information bnxt_en: Fix VF mac address regression. ipv6: fix possible use-after-free in ip6_xmit() net: hp100: fix always-true check for link up state ARM: dts: at91: add new compatibility string for macb on sama5d3 net: macb: disable scatter-gather for macb on sama5d3 net: mvpp2: let phylink manage the carrier state ...
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/net/tls.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index b3ebf2646e52..8fdfeafaf8c0 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -502,6 +502,55 @@ TEST_F(tls, recv_peek_multiple)
502 EXPECT_EQ(memcmp(test_str, buf, send_len), 0); 502 EXPECT_EQ(memcmp(test_str, buf, send_len), 0);
503} 503}
504 504
505TEST_F(tls, recv_peek_multiple_records)
506{
507 char const *test_str = "test_read_peek_mult_recs";
508 char const *test_str_first = "test_read_peek";
509 char const *test_str_second = "_mult_recs";
510 int len;
511 char buf[64];
512
513 len = strlen(test_str_first);
514 EXPECT_EQ(send(self->fd, test_str_first, len, 0), len);
515
516 len = strlen(test_str_second) + 1;
517 EXPECT_EQ(send(self->fd, test_str_second, len, 0), len);
518
519 len = sizeof(buf);
520 memset(buf, 0, len);
521 EXPECT_NE(recv(self->cfd, buf, len, MSG_PEEK), -1);
522
523 /* MSG_PEEK can only peek into the current record. */
524 len = strlen(test_str_first) + 1;
525 EXPECT_EQ(memcmp(test_str_first, buf, len), 0);
526
527 len = sizeof(buf);
528 memset(buf, 0, len);
529 EXPECT_NE(recv(self->cfd, buf, len, 0), -1);
530
531 /* Non-MSG_PEEK will advance strparser (and therefore record)
532 * however.
533 */
534 len = strlen(test_str) + 1;
535 EXPECT_EQ(memcmp(test_str, buf, len), 0);
536
537 /* MSG_MORE will hold current record open, so later MSG_PEEK
538 * will see everything.
539 */
540 len = strlen(test_str_first);
541 EXPECT_EQ(send(self->fd, test_str_first, len, MSG_MORE), len);
542
543 len = strlen(test_str_second) + 1;
544 EXPECT_EQ(send(self->fd, test_str_second, len, 0), len);
545
546 len = sizeof(buf);
547 memset(buf, 0, len);
548 EXPECT_NE(recv(self->cfd, buf, len, MSG_PEEK), -1);
549
550 len = strlen(test_str) + 1;
551 EXPECT_EQ(memcmp(test_str, buf, len), 0);
552}
553
505TEST_F(tls, pollin) 554TEST_F(tls, pollin)
506{ 555{
507 char const *test_str = "test_poll"; 556 char const *test_str = "test_poll";