1. 06 Nov, 2018 2 commits
  2. 02 Nov, 2018 2 commits
    • uhei's avatar
      icmp: fix InterfaceIdent.Index handling · c10e9556
      uhei authored
      RFC 7223, Section 3 defines 32 bits for if-index.
      RFC 8335, Section 2.1 defines
      "If the Interface Identification Object identifies the probed
      interface by index, the length is equal to 8 and the payload contains
      the if-index [RFC7223]."
      The object should be comprised of a 4-byte object header and a 4-byte interface index.
      
      Fixes golang/go#28530
      
      Change-Id: Ib3ac729b7ec738a90a8c76ef984da0d5b28fa9c9
      GitHub-Last-Rev: eba6714ed4c7af61e89f6e54d6a7544c570acebb
      GitHub-Pull-Request: golang/net#23
      Reviewed-on: https://go-review.googlesource.com/c/146637
      Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
      Reviewed-by: 's avatarMikio Hara <mikioh.public.networking@gmail.com>
      c10e9556
    • Mikio Hara's avatar
      Revert "icmp: fix ExtendedEchoRequest extension object" · b7e29687
      Mikio Hara authored
      This reverts commit e1173011.
      
      Reason for revert: The reverted test case is one of typical wrong wire
      format test cases. The exposed API intentionally doesn't provide any
      extenion object validation because the API is also used to construct
      wire format compliance test tools. The API is extesion object-agnostic
      and should be able to transmit and receive payload containing extension
      objects in wrong wire format. Please preserve such test cases for now.
      
      If you want to drop such test case, please add 1) extension object
      validation, 2) a control knob for skipping validation, then drop all of
      them.
      
      Change-Id: I5c488c95523488e511e7a91e29a2f24f08448415
      Reviewed-on: https://go-review.googlesource.com/c/146877Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      b7e29687
  3. 01 Nov, 2018 2 commits
  4. 29 Oct, 2018 1 commit
  5. 23 Oct, 2018 1 commit
  6. 17 Oct, 2018 1 commit
  7. 11 Oct, 2018 1 commit
    • Arthur Fabre's avatar
      bpf: support JumpIf on RegX instead of K · 49bb7cea
      Arthur Fabre authored
      Add a JumpIfX instruction which implements conditional jumps using
      RegA and RegX. This is in addition to the pre-existing JumpIf
      instruction which uses RegA and K.
      
      This instruction / addressing mode is not mentionned in the original BPF
      paper, but is supported by tools like bpf_asm, and has recently been
      added to the kernel's filter.txt.
      
      Simplify some of the parsing logic, and add a separate helper for
      checking for "fake" JumpIfs.
      
      Add JumpIfX support to the BPF vm.
      
      Update testdata with JumpIfX instructions, and add tests
      for both the assembler/disassembler and vm.
      
      Fixes golang/go#27814
      
      Change-Id: I0c3f6ac7eb5b4cd4d9c5af8784ee2e8d25195a0a
      GitHub-Last-Rev: 39a88165b2d3253c37db4b0e303d862b60dc37c9
      GitHub-Pull-Request: golang/net#20
      Reviewed-on: https://go-review.googlesource.com/c/136895Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      49bb7cea
  8. 05 Oct, 2018 1 commit
  9. 04 Oct, 2018 1 commit
  10. 03 Oct, 2018 1 commit
  11. 26 Sep, 2018 1 commit
  12. 25 Sep, 2018 2 commits
  13. 21 Sep, 2018 1 commit
  14. 11 Sep, 2018 1 commit
  15. 06 Sep, 2018 1 commit
  16. 26 Aug, 2018 1 commit
  17. 24 Aug, 2018 2 commits
  18. 21 Aug, 2018 1 commit
  19. 16 Aug, 2018 1 commit
  20. 11 Aug, 2018 1 commit
  21. 08 Aug, 2018 2 commits
  22. 07 Aug, 2018 1 commit
  23. 01 Aug, 2018 3 commits
    • Jean de Klerk's avatar
      trace: better error message for double init · f4c29de7
      Jean de Klerk authored
      Fixes golang/go#24137
      
      Change-Id: Ifcf6449aed32071cdb643028347ec814bffd8d06
      Reviewed-on: https://go-review.googlesource.com/127121Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      f4c29de7
    • Brad Fitzpatrick's avatar
      http2/hpack: lazily build huffman table on first use · 22bb95c5
      Brad Fitzpatrick authored
      This generated 120 kB on the heap before at init, regardless of
      whether somebody used http2. Worse, because we vendored it into std,
      users would have two copies, for about 256 kB of memory. After CL
      127235 that went down to 60 kB per copy, so 120 kB for a binary using
      golang.org/x/net/http2 explicitly.
      
      With this, it goes to 0 until one of the two copies in the binary
      actually uses one of the http2 packages.
      
      I wasn't able to measure any difference with the Once.Do in the decode
      path:
      
      name             old time/op    new time/op    delta
      HuffmanDecode-4     732ns ± 8%     707ns ± 3%   ~            (p=0.268 n=10+9)
      
      (admittedly noisy)
      
      Change-Id: I6c1065abc0c3458f3cb69e0f678978267ff35ea2
      Reviewed-on: https://go-review.googlesource.com/127275
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      22bb95c5
    • Brad Fitzpatrick's avatar
      http2/hpack: reduce memory for huffman decoding table · 32f9bdbd
      Brad Fitzpatrick authored
      Reduces process-wide heap (inuse_space) by 60kB by using a pointer to
      a fixed-sized array instead of a slice of a fixed size.
      
      Before:
      119.44kB 23.43% 23.43%   147.88kB 29.01%  golang.org/x/net/http2/hpack.addDecoderNode
      
      After:
       59.72kB 13.28% 39.85%    87.94kB 19.56%  golang.org/x/net/http2/hpack.addDecoderNode
      
      (This is all work from an init func in http2/hpack)
      
      Doesn't seem to affect runtime performance.
      
      Measured with:
      
      $ cat huffman_test.go
      package main
      
      import (
              "testing"
      
              _ "golang.org/x/net/http2"
              )
      
      func TestMem(t *testing.T) {}
      
      $ GODEBUG=memprofilerate=1 go test -memprofilerate=1 -memprofile=mem.prof -v .
      === RUN   TestMem
      --- PASS: TestMem (0.00s)
      PASS
      ok      huffmem 0.052s
      
      $ go tool pprof --inuse_space mem.prof
      
      Change-Id: I5e56a5a2682f1063c955b342b37e97ca4c303dab
      Reviewed-on: https://go-review.googlesource.com/127235Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      32f9bdbd
  24. 31 Jul, 2018 1 commit
  25. 30 Jul, 2018 4 commits
  26. 29 Jul, 2018 1 commit
    • William Chang's avatar
      http2/h2c: add h2c implementation (unencrypted HTTP/2) · c4299a1a
      William Chang authored
      Implements h2c by leveraging the existing http2.Server by implementing the 2
      ways to start an h2c connection as described in RFC 7540, which are: (1)
      create a connection starting with HTTP/1 and then upgrading to h2c [Section 3.2]
      and (2) starting a connection directly speaking h2c (aka starting with prior
      knowledge) [Section 3.4].
      
      For both of the above connection methods the implementation strategy is to
      hijack a HTTP/1 connection, perform the h2c connection on the hijacked
      net.Conn, and create a suitably configured net.Conn to pass into
      http2.Server.ServeConn.
      
      For h2c with prior knowledge this is relatively simple. For that we just have
      to verify the HTTP/2 client preface has been written to the net.Conn, and
      then reforward the client preface to the hijacked connection.
      
      For h2c upgraded from HTTP/1, this is a bit more involved. First we validate
      the HTTP/1 Upgrade request, and respond to the client with 101 Switching
      Protocols. Then we write a HTTP/2 client preface on behalf of the client,
      and a settings frame and a headers frame which correspond to what was in
      the upgrade request. Then since http2.Server is going respond with a
      settings ACK, we swallow it so that it is not forwarded to the client since
      for h2c upgrade from HTTP/1 the 101 Switching Protocols response replaces
      the settins ACK.
      
      Fixes golang/go#14141
      
      Change-Id: I435f40216c883809c0dcb75426c9c59e2ea31182
      Reviewed-on: https://go-review.googlesource.com/112999Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      c4299a1a
  27. 24 Jul, 2018 1 commit
  28. 19 Jul, 2018 2 commits