Explorar o código

bump golang.org/x/net eb5bcb51f2a31c7d5141d810b70815c05d9c9146

drops support for Go 1.8 and older

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn %!s(int64=6) %!d(string=hai) anos
pai
achega
054e39c0f9
Modificáronse 96 ficheiros con 928 adicións e 1603 borrados
  1. 1 1
      vendor.conf
  2. 14 10
      vendor/golang.org/x/net/bpf/constants.go
  3. 108 86
      vendor/golang.org/x/net/bpf/instructions.go
  4. 10 0
      vendor/golang.org/x/net/bpf/vm.go
  5. 20 13
      vendor/golang.org/x/net/bpf/vm_instructions.go
  6. 1 4
      vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go
  7. 0 147
      vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go
  8. 0 82
      vendor/golang.org/x/net/http2/configure_transport.go
  9. 2 2
      vendor/golang.org/x/net/http2/frame.go
  10. 7 4
      vendor/golang.org/x/net/http2/go111.go
  11. 0 16
      vendor/golang.org/x/net/http2/go16.go
  12. 0 121
      vendor/golang.org/x/net/http2/go17.go
  13. 0 36
      vendor/golang.org/x/net/http2/go17_not18.go
  14. 0 56
      vendor/golang.org/x/net/http2/go18.go
  15. 0 16
      vendor/golang.org/x/net/http2/go19.go
  16. 15 5
      vendor/golang.org/x/net/http2/headermap.go
  17. 9 1
      vendor/golang.org/x/net/http2/hpack/hpack.go
  18. 15 5
      vendor/golang.org/x/net/http2/hpack/huffman.go
  19. 5 12
      vendor/golang.org/x/net/http2/http2.go
  20. 7 4
      vendor/golang.org/x/net/http2/not_go111.go
  21. 0 21
      vendor/golang.org/x/net/http2/not_go16.go
  22. 0 95
      vendor/golang.org/x/net/http2/not_go17.go
  23. 0 29
      vendor/golang.org/x/net/http2/not_go18.go
  24. 0 16
      vendor/golang.org/x/net/http2/not_go19.go
  25. 31 33
      vendor/golang.org/x/net/http2/server.go
  26. 181 27
      vendor/golang.org/x/net/http2/transport.go
  27. 2 2
      vendor/golang.org/x/net/http2/write.go
  28. 7 0
      vendor/golang.org/x/net/internal/socket/empty.s
  29. 0 2
      vendor/golang.org/x/net/internal/socket/rawconn.go
  30. 0 1
      vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go
  31. 0 1
      vendor/golang.org/x/net/internal/socket/rawconn_msg.go
  32. 2 5
      vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go
  33. 2 5
      vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go
  34. 0 25
      vendor/golang.org/x/net/internal/socket/rawconn_stub.go
  35. 0 62
      vendor/golang.org/x/net/internal/socket/reflect.go
  36. 3 0
      vendor/golang.org/x/net/internal/socket/socket.go
  37. 1 1
      vendor/golang.org/x/net/internal/socket/sys.go
  38. 2 4
      vendor/golang.org/x/net/internal/socket/sys_bsd.go
  39. 7 1
      vendor/golang.org/x/net/internal/socket/sys_bsdvar.go
  40. 33 0
      vendor/golang.org/x/net/internal/socket/sys_go1_11_darwin.go
  41. 42 0
      vendor/golang.org/x/net/internal/socket/sys_go1_12_darwin.go
  42. 26 11
      vendor/golang.org/x/net/internal/socket/sys_posix.go
  43. 2 3
      vendor/golang.org/x/net/internal/socket/sys_solaris.go
  44. 7 8
      vendor/golang.org/x/net/internal/socket/sys_stub.go
  45. 1 1
      vendor/golang.org/x/net/internal/socket/sys_unix.go
  46. 4 5
      vendor/golang.org/x/net/internal/socket/sys_windows.go
  47. 1 0
      vendor/golang.org/x/net/internal/socks/socks.go
  48. 6 2
      vendor/golang.org/x/net/ipv4/batch.go
  49. 1 1
      vendor/golang.org/x/net/ipv4/control_stub.go
  50. 2 6
      vendor/golang.org/x/net/ipv4/control_windows.go
  51. 15 15
      vendor/golang.org/x/net/ipv4/dgramopt.go
  52. 4 3
      vendor/golang.org/x/net/ipv4/doc.go
  53. 1 1
      vendor/golang.org/x/net/ipv4/endpoint.go
  54. 4 4
      vendor/golang.org/x/net/ipv4/genericopt.go
  55. 19 4
      vendor/golang.org/x/net/ipv4/header.go
  56. 18 3
      vendor/golang.org/x/net/ipv4/helper.go
  57. 51 2
      vendor/golang.org/x/net/ipv4/packet.go
  58. 0 56
      vendor/golang.org/x/net/ipv4/packet_go1_8.go
  59. 0 67
      vendor/golang.org/x/net/ipv4/packet_go1_9.go
  60. 55 4
      vendor/golang.org/x/net/ipv4/payload_cmsg.go
  61. 0 59
      vendor/golang.org/x/net/ipv4/payload_cmsg_go1_8.go
  62. 0 67
      vendor/golang.org/x/net/ipv4/payload_cmsg_go1_9.go
  63. 1 1
      vendor/golang.org/x/net/ipv4/payload_nocmsg.go
  64. 2 2
      vendor/golang.org/x/net/ipv4/sockopt_posix.go
  65. 7 7
      vendor/golang.org/x/net/ipv4/sockopt_stub.go
  66. 3 3
      vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go
  67. 2 2
      vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go
  68. 1 1
      vendor/golang.org/x/net/ipv4/sys_bpf_stub.go
  69. 12 40
      vendor/golang.org/x/net/ipv4/sys_darwin.go
  70. 1 1
      vendor/golang.org/x/net/ipv4/sys_freebsd.go
  71. 2 4
      vendor/golang.org/x/net/ipv4/sys_ssmreq.go
  72. 2 2
      vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go
  73. 0 2
      vendor/golang.org/x/net/ipv6/batch.go
  74. 1 1
      vendor/golang.org/x/net/ipv6/control_stub.go
  75. 2 6
      vendor/golang.org/x/net/ipv6/control_windows.go
  76. 17 17
      vendor/golang.org/x/net/ipv6/dgramopt.go
  77. 3 2
      vendor/golang.org/x/net/ipv6/doc.go
  78. 1 1
      vendor/golang.org/x/net/ipv6/endpoint.go
  79. 4 4
      vendor/golang.org/x/net/ipv6/genericopt.go
  80. 2 1
      vendor/golang.org/x/net/ipv6/helper.go
  81. 42 4
      vendor/golang.org/x/net/ipv6/payload_cmsg.go
  82. 0 55
      vendor/golang.org/x/net/ipv6/payload_cmsg_go1_8.go
  83. 0 57
      vendor/golang.org/x/net/ipv6/payload_cmsg_go1_9.go
  84. 1 1
      vendor/golang.org/x/net/ipv6/payload_nocmsg.go
  85. 3 3
      vendor/golang.org/x/net/ipv6/sockopt_posix.go
  86. 8 8
      vendor/golang.org/x/net/ipv6/sockopt_stub.go
  87. 1 1
      vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go
  88. 1 1
      vendor/golang.org/x/net/ipv6/sys_bpf_stub.go
  89. 23 51
      vendor/golang.org/x/net/ipv6/sys_darwin.go
  90. 1 1
      vendor/golang.org/x/net/ipv6/sys_freebsd.go
  91. 3 3
      vendor/golang.org/x/net/ipv6/sys_ssmreq.go
  92. 2 2
      vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go
  93. 7 2
      vendor/golang.org/x/net/proxy/proxy.go
  94. 29 2
      vendor/golang.org/x/net/trace/trace.go
  95. 0 21
      vendor/golang.org/x/net/trace/trace_go16.go
  96. 0 21
      vendor/golang.org/x/net/trace/trace_go17.go

+ 1 - 1
vendor.conf

@@ -14,7 +14,7 @@ github.com/mattn/go-shellwords v1.0.3
 github.com/sirupsen/logrus 8bdbc7bcc01dcbb8ec23dc8a28e332258d25251f # v1.4.1
 github.com/sirupsen/logrus 8bdbc7bcc01dcbb8ec23dc8a28e332258d25251f # v1.4.1
 github.com/tchap/go-patricia v2.2.6
 github.com/tchap/go-patricia v2.2.6
 github.com/vdemeester/shakers 24d7f1d6a71aa5d9cbe7390e4afb66b7eef9e1b3 # v0.1.0
 github.com/vdemeester/shakers 24d7f1d6a71aa5d9cbe7390e4afb66b7eef9e1b3 # v0.1.0
-golang.org/x/net a680a1efc54dd51c040b3b5ce4939ea3cf2ea0d1
+golang.org/x/net eb5bcb51f2a31c7d5141d810b70815c05d9c9146
 golang.org/x/sys d455e41777fca6e8a5a79e34a14b8368bc11d9ba
 golang.org/x/sys d455e41777fca6e8a5a79e34a14b8368bc11d9ba
 github.com/docker/go-units 47565b4f722fb6ceae66b95f853feed578a4a51c # v0.3.3
 github.com/docker/go-units 47565b4f722fb6ceae66b95f853feed578a4a51c # v0.3.3
 github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0
 github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0

+ 14 - 10
vendor/golang.org/x/net/bpf/constants.go

@@ -38,6 +38,7 @@ const (
 type JumpTest uint16
 type JumpTest uint16
 
 
 // Supported operators for conditional jumps.
 // Supported operators for conditional jumps.
+// K can be RegX for JumpIfX
 const (
 const (
 	// K == A
 	// K == A
 	JumpEqual JumpTest = iota
 	JumpEqual JumpTest = iota
@@ -134,12 +135,9 @@ const (
 	opMaskLoadDest  = 0x01
 	opMaskLoadDest  = 0x01
 	opMaskLoadWidth = 0x18
 	opMaskLoadWidth = 0x18
 	opMaskLoadMode  = 0xe0
 	opMaskLoadMode  = 0xe0
-	// opClsALU
-	opMaskOperandSrc = 0x08
-	opMaskOperator   = 0xf0
-	// opClsJump
-	opMaskJumpConst = 0x0f
-	opMaskJumpCond  = 0xf0
+	// opClsALU & opClsJump
+	opMaskOperand  = 0x08
+	opMaskOperator = 0xf0
 )
 )
 
 
 const (
 const (
@@ -192,15 +190,21 @@ const (
 	opLoadWidth1
 	opLoadWidth1
 )
 )
 
 
-// Operator defined by ALUOp*
+// Operand for ALU and Jump instructions
+type opOperand uint16
 
 
+// Supported operand sources.
 const (
 const (
-	opALUSrcConstant uint16 = iota << 3
-	opALUSrcX
+	opOperandConstant opOperand = iota << 3
+	opOperandX
 )
 )
 
 
+// An jumpOp is a conditional jump condition.
+type jumpOp uint16
+
+// Supported jump conditions.
 const (
 const (
-	opJumpAlways = iota << 4
+	opJumpAlways jumpOp = iota << 4
 	opJumpEqual
 	opJumpEqual
 	opJumpGT
 	opJumpGT
 	opJumpGE
 	opJumpGE

+ 108 - 86
vendor/golang.org/x/net/bpf/instructions.go

@@ -89,10 +89,14 @@ func (ri RawInstruction) Disassemble() Instruction {
 	case opClsALU:
 	case opClsALU:
 		switch op := ALUOp(ri.Op & opMaskOperator); op {
 		switch op := ALUOp(ri.Op & opMaskOperator); op {
 		case ALUOpAdd, ALUOpSub, ALUOpMul, ALUOpDiv, ALUOpOr, ALUOpAnd, ALUOpShiftLeft, ALUOpShiftRight, ALUOpMod, ALUOpXor:
 		case ALUOpAdd, ALUOpSub, ALUOpMul, ALUOpDiv, ALUOpOr, ALUOpAnd, ALUOpShiftLeft, ALUOpShiftRight, ALUOpMod, ALUOpXor:
-			if ri.Op&opMaskOperandSrc != 0 {
+			switch operand := opOperand(ri.Op & opMaskOperand); operand {
+			case opOperandX:
 				return ALUOpX{Op: op}
 				return ALUOpX{Op: op}
+			case opOperandConstant:
+				return ALUOpConstant{Op: op, Val: ri.K}
+			default:
+				return ri
 			}
 			}
-			return ALUOpConstant{Op: op, Val: ri.K}
 		case aluOpNeg:
 		case aluOpNeg:
 			return NegateA{}
 			return NegateA{}
 		default:
 		default:
@@ -100,63 +104,18 @@ func (ri RawInstruction) Disassemble() Instruction {
 		}
 		}
 
 
 	case opClsJump:
 	case opClsJump:
-		if ri.Op&opMaskJumpConst != opClsJump {
-			return ri
-		}
-		switch ri.Op & opMaskJumpCond {
+		switch op := jumpOp(ri.Op & opMaskOperator); op {
 		case opJumpAlways:
 		case opJumpAlways:
 			return Jump{Skip: ri.K}
 			return Jump{Skip: ri.K}
-		case opJumpEqual:
-			if ri.Jt == 0 {
-				return JumpIf{
-					Cond:      JumpNotEqual,
-					Val:       ri.K,
-					SkipTrue:  ri.Jf,
-					SkipFalse: 0,
-				}
-			}
-			return JumpIf{
-				Cond:      JumpEqual,
-				Val:       ri.K,
-				SkipTrue:  ri.Jt,
-				SkipFalse: ri.Jf,
-			}
-		case opJumpGT:
-			if ri.Jt == 0 {
-				return JumpIf{
-					Cond:      JumpLessOrEqual,
-					Val:       ri.K,
-					SkipTrue:  ri.Jf,
-					SkipFalse: 0,
-				}
-			}
-			return JumpIf{
-				Cond:      JumpGreaterThan,
-				Val:       ri.K,
-				SkipTrue:  ri.Jt,
-				SkipFalse: ri.Jf,
-			}
-		case opJumpGE:
-			if ri.Jt == 0 {
-				return JumpIf{
-					Cond:      JumpLessThan,
-					Val:       ri.K,
-					SkipTrue:  ri.Jf,
-					SkipFalse: 0,
-				}
-			}
-			return JumpIf{
-				Cond:      JumpGreaterOrEqual,
-				Val:       ri.K,
-				SkipTrue:  ri.Jt,
-				SkipFalse: ri.Jf,
-			}
-		case opJumpSet:
-			return JumpIf{
-				Cond:      JumpBitsSet,
-				Val:       ri.K,
-				SkipTrue:  ri.Jt,
-				SkipFalse: ri.Jf,
+		case opJumpEqual, opJumpGT, opJumpGE, opJumpSet:
+			cond, skipTrue, skipFalse := jumpOpToTest(op, ri.Jt, ri.Jf)
+			switch operand := opOperand(ri.Op & opMaskOperand); operand {
+			case opOperandX:
+				return JumpIfX{Cond: cond, SkipTrue: skipTrue, SkipFalse: skipFalse}
+			case opOperandConstant:
+				return JumpIf{Cond: cond, Val: ri.K, SkipTrue: skipTrue, SkipFalse: skipFalse}
+			default:
+				return ri
 			}
 			}
 		default:
 		default:
 			return ri
 			return ri
@@ -187,6 +146,41 @@ func (ri RawInstruction) Disassemble() Instruction {
 	}
 	}
 }
 }
 
 
+func jumpOpToTest(op jumpOp, skipTrue uint8, skipFalse uint8) (JumpTest, uint8, uint8) {
+	var test JumpTest
+
+	// Decode "fake" jump conditions that don't appear in machine code
+	// Ensures the Assemble -> Disassemble stage recreates the same instructions
+	// See https://github.com/golang/go/issues/18470
+	if skipTrue == 0 {
+		switch op {
+		case opJumpEqual:
+			test = JumpNotEqual
+		case opJumpGT:
+			test = JumpLessOrEqual
+		case opJumpGE:
+			test = JumpLessThan
+		case opJumpSet:
+			test = JumpBitsNotSet
+		}
+
+		return test, skipFalse, 0
+	}
+
+	switch op {
+	case opJumpEqual:
+		test = JumpEqual
+	case opJumpGT:
+		test = JumpGreaterThan
+	case opJumpGE:
+		test = JumpGreaterOrEqual
+	case opJumpSet:
+		test = JumpBitsSet
+	}
+
+	return test, skipTrue, skipFalse
+}
+
 // LoadConstant loads Val into register Dst.
 // LoadConstant loads Val into register Dst.
 type LoadConstant struct {
 type LoadConstant struct {
 	Dst Register
 	Dst Register
@@ -413,7 +407,7 @@ type ALUOpConstant struct {
 // Assemble implements the Instruction Assemble method.
 // Assemble implements the Instruction Assemble method.
 func (a ALUOpConstant) Assemble() (RawInstruction, error) {
 func (a ALUOpConstant) Assemble() (RawInstruction, error) {
 	return RawInstruction{
 	return RawInstruction{
-		Op: opClsALU | opALUSrcConstant | uint16(a.Op),
+		Op: opClsALU | uint16(opOperandConstant) | uint16(a.Op),
 		K:  a.Val,
 		K:  a.Val,
 	}, nil
 	}, nil
 }
 }
@@ -454,7 +448,7 @@ type ALUOpX struct {
 // Assemble implements the Instruction Assemble method.
 // Assemble implements the Instruction Assemble method.
 func (a ALUOpX) Assemble() (RawInstruction, error) {
 func (a ALUOpX) Assemble() (RawInstruction, error) {
 	return RawInstruction{
 	return RawInstruction{
-		Op: opClsALU | opALUSrcX | uint16(a.Op),
+		Op: opClsALU | uint16(opOperandX) | uint16(a.Op),
 	}, nil
 	}, nil
 }
 }
 
 
@@ -509,7 +503,7 @@ type Jump struct {
 // Assemble implements the Instruction Assemble method.
 // Assemble implements the Instruction Assemble method.
 func (a Jump) Assemble() (RawInstruction, error) {
 func (a Jump) Assemble() (RawInstruction, error) {
 	return RawInstruction{
 	return RawInstruction{
-		Op: opClsJump | opJumpAlways,
+		Op: opClsJump | uint16(opJumpAlways),
 		K:  a.Skip,
 		K:  a.Skip,
 	}, nil
 	}, nil
 }
 }
@@ -530,11 +524,39 @@ type JumpIf struct {
 
 
 // Assemble implements the Instruction Assemble method.
 // Assemble implements the Instruction Assemble method.
 func (a JumpIf) Assemble() (RawInstruction, error) {
 func (a JumpIf) Assemble() (RawInstruction, error) {
+	return jumpToRaw(a.Cond, opOperandConstant, a.Val, a.SkipTrue, a.SkipFalse)
+}
+
+// String returns the instruction in assembler notation.
+func (a JumpIf) String() string {
+	return jumpToString(a.Cond, fmt.Sprintf("#%d", a.Val), a.SkipTrue, a.SkipFalse)
+}
+
+// JumpIfX skips the following Skip instructions in the program if A
+// <Cond> X is true.
+type JumpIfX struct {
+	Cond      JumpTest
+	SkipTrue  uint8
+	SkipFalse uint8
+}
+
+// Assemble implements the Instruction Assemble method.
+func (a JumpIfX) Assemble() (RawInstruction, error) {
+	return jumpToRaw(a.Cond, opOperandX, 0, a.SkipTrue, a.SkipFalse)
+}
+
+// String returns the instruction in assembler notation.
+func (a JumpIfX) String() string {
+	return jumpToString(a.Cond, "x", a.SkipTrue, a.SkipFalse)
+}
+
+// jumpToRaw assembles a jump instruction into a RawInstruction
+func jumpToRaw(test JumpTest, operand opOperand, k uint32, skipTrue, skipFalse uint8) (RawInstruction, error) {
 	var (
 	var (
-		cond uint16
+		cond jumpOp
 		flip bool
 		flip bool
 	)
 	)
-	switch a.Cond {
+	switch test {
 	case JumpEqual:
 	case JumpEqual:
 		cond = opJumpEqual
 		cond = opJumpEqual
 	case JumpNotEqual:
 	case JumpNotEqual:
@@ -552,63 +574,63 @@ func (a JumpIf) Assemble() (RawInstruction, error) {
 	case JumpBitsNotSet:
 	case JumpBitsNotSet:
 		cond, flip = opJumpSet, true
 		cond, flip = opJumpSet, true
 	default:
 	default:
-		return RawInstruction{}, fmt.Errorf("unknown JumpTest %v", a.Cond)
+		return RawInstruction{}, fmt.Errorf("unknown JumpTest %v", test)
 	}
 	}
-	jt, jf := a.SkipTrue, a.SkipFalse
+	jt, jf := skipTrue, skipFalse
 	if flip {
 	if flip {
 		jt, jf = jf, jt
 		jt, jf = jf, jt
 	}
 	}
 	return RawInstruction{
 	return RawInstruction{
-		Op: opClsJump | cond,
+		Op: opClsJump | uint16(cond) | uint16(operand),
 		Jt: jt,
 		Jt: jt,
 		Jf: jf,
 		Jf: jf,
-		K:  a.Val,
+		K:  k,
 	}, nil
 	}, nil
 }
 }
 
 
-// String returns the instruction in assembler notation.
-func (a JumpIf) String() string {
-	switch a.Cond {
+// jumpToString converts a jump instruction to assembler notation
+func jumpToString(cond JumpTest, operand string, skipTrue, skipFalse uint8) string {
+	switch cond {
 	// K == A
 	// K == A
 	case JumpEqual:
 	case JumpEqual:
-		return conditionalJump(a, "jeq", "jneq")
+		return conditionalJump(operand, skipTrue, skipFalse, "jeq", "jneq")
 	// K != A
 	// K != A
 	case JumpNotEqual:
 	case JumpNotEqual:
-		return fmt.Sprintf("jneq #%d,%d", a.Val, a.SkipTrue)
+		return fmt.Sprintf("jneq %s,%d", operand, skipTrue)
 	// K > A
 	// K > A
 	case JumpGreaterThan:
 	case JumpGreaterThan:
-		return conditionalJump(a, "jgt", "jle")
+		return conditionalJump(operand, skipTrue, skipFalse, "jgt", "jle")
 	// K < A
 	// K < A
 	case JumpLessThan:
 	case JumpLessThan:
-		return fmt.Sprintf("jlt #%d,%d", a.Val, a.SkipTrue)
+		return fmt.Sprintf("jlt %s,%d", operand, skipTrue)
 	// K >= A
 	// K >= A
 	case JumpGreaterOrEqual:
 	case JumpGreaterOrEqual:
-		return conditionalJump(a, "jge", "jlt")
+		return conditionalJump(operand, skipTrue, skipFalse, "jge", "jlt")
 	// K <= A
 	// K <= A
 	case JumpLessOrEqual:
 	case JumpLessOrEqual:
-		return fmt.Sprintf("jle #%d,%d", a.Val, a.SkipTrue)
+		return fmt.Sprintf("jle %s,%d", operand, skipTrue)
 	// K & A != 0
 	// K & A != 0
 	case JumpBitsSet:
 	case JumpBitsSet:
-		if a.SkipFalse > 0 {
-			return fmt.Sprintf("jset #%d,%d,%d", a.Val, a.SkipTrue, a.SkipFalse)
+		if skipFalse > 0 {
+			return fmt.Sprintf("jset %s,%d,%d", operand, skipTrue, skipFalse)
 		}
 		}
-		return fmt.Sprintf("jset #%d,%d", a.Val, a.SkipTrue)
+		return fmt.Sprintf("jset %s,%d", operand, skipTrue)
 	// K & A == 0, there is no assembler instruction for JumpBitNotSet, use JumpBitSet and invert skips
 	// K & A == 0, there is no assembler instruction for JumpBitNotSet, use JumpBitSet and invert skips
 	case JumpBitsNotSet:
 	case JumpBitsNotSet:
-		return JumpIf{Cond: JumpBitsSet, SkipTrue: a.SkipFalse, SkipFalse: a.SkipTrue, Val: a.Val}.String()
+		return jumpToString(JumpBitsSet, operand, skipFalse, skipTrue)
 	default:
 	default:
-		return fmt.Sprintf("unknown instruction: %#v", a)
+		return fmt.Sprintf("unknown JumpTest %#v", cond)
 	}
 	}
 }
 }
 
 
-func conditionalJump(inst JumpIf, positiveJump, negativeJump string) string {
-	if inst.SkipTrue > 0 {
-		if inst.SkipFalse > 0 {
-			return fmt.Sprintf("%s #%d,%d,%d", positiveJump, inst.Val, inst.SkipTrue, inst.SkipFalse)
+func conditionalJump(operand string, skipTrue, skipFalse uint8, positiveJump, negativeJump string) string {
+	if skipTrue > 0 {
+		if skipFalse > 0 {
+			return fmt.Sprintf("%s %s,%d,%d", positiveJump, operand, skipTrue, skipFalse)
 		}
 		}
-		return fmt.Sprintf("%s #%d,%d", positiveJump, inst.Val, inst.SkipTrue)
+		return fmt.Sprintf("%s %s,%d", positiveJump, operand, skipTrue)
 	}
 	}
-	return fmt.Sprintf("%s #%d,%d", negativeJump, inst.Val, inst.SkipFalse)
+	return fmt.Sprintf("%s %s,%d", negativeJump, operand, skipFalse)
 }
 }
 
 
 // RetA exits the BPF program, returning the value of register A.
 // RetA exits the BPF program, returning the value of register A.

+ 10 - 0
vendor/golang.org/x/net/bpf/vm.go

@@ -35,6 +35,13 @@ func NewVM(filter []Instruction) (*VM, error) {
 			if check <= int(ins.SkipFalse) {
 			if check <= int(ins.SkipFalse) {
 				return nil, fmt.Errorf("cannot jump %d instructions in false case; jumping past program bounds", ins.SkipFalse)
 				return nil, fmt.Errorf("cannot jump %d instructions in false case; jumping past program bounds", ins.SkipFalse)
 			}
 			}
+		case JumpIfX:
+			if check <= int(ins.SkipTrue) {
+				return nil, fmt.Errorf("cannot jump %d instructions in true case; jumping past program bounds", ins.SkipTrue)
+			}
+			if check <= int(ins.SkipFalse) {
+				return nil, fmt.Errorf("cannot jump %d instructions in false case; jumping past program bounds", ins.SkipFalse)
+			}
 		// Check for division or modulus by zero
 		// Check for division or modulus by zero
 		case ALUOpConstant:
 		case ALUOpConstant:
 			if ins.Val != 0 {
 			if ins.Val != 0 {
@@ -109,6 +116,9 @@ func (v *VM) Run(in []byte) (int, error) {
 		case JumpIf:
 		case JumpIf:
 			jump := jumpIf(ins, regA)
 			jump := jumpIf(ins, regA)
 			i += jump
 			i += jump
+		case JumpIfX:
+			jump := jumpIfX(ins, regA, regX)
+			i += jump
 		case LoadAbsolute:
 		case LoadAbsolute:
 			regA, ok = loadAbsolute(ins, in)
 			regA, ok = loadAbsolute(ins, in)
 		case LoadConstant:
 		case LoadConstant:

+ 20 - 13
vendor/golang.org/x/net/bpf/vm_instructions.go

@@ -55,34 +55,41 @@ func aluOpCommon(op ALUOp, regA uint32, value uint32) uint32 {
 	}
 	}
 }
 }
 
 
-func jumpIf(ins JumpIf, value uint32) int {
+func jumpIf(ins JumpIf, regA uint32) int {
+	return jumpIfCommon(ins.Cond, ins.SkipTrue, ins.SkipFalse, regA, ins.Val)
+}
+
+func jumpIfX(ins JumpIfX, regA uint32, regX uint32) int {
+	return jumpIfCommon(ins.Cond, ins.SkipTrue, ins.SkipFalse, regA, regX)
+}
+
+func jumpIfCommon(cond JumpTest, skipTrue, skipFalse uint8, regA uint32, value uint32) int {
 	var ok bool
 	var ok bool
-	inV := uint32(ins.Val)
 
 
-	switch ins.Cond {
+	switch cond {
 	case JumpEqual:
 	case JumpEqual:
-		ok = value == inV
+		ok = regA == value
 	case JumpNotEqual:
 	case JumpNotEqual:
-		ok = value != inV
+		ok = regA != value
 	case JumpGreaterThan:
 	case JumpGreaterThan:
-		ok = value > inV
+		ok = regA > value
 	case JumpLessThan:
 	case JumpLessThan:
-		ok = value < inV
+		ok = regA < value
 	case JumpGreaterOrEqual:
 	case JumpGreaterOrEqual:
-		ok = value >= inV
+		ok = regA >= value
 	case JumpLessOrEqual:
 	case JumpLessOrEqual:
-		ok = value <= inV
+		ok = regA <= value
 	case JumpBitsSet:
 	case JumpBitsSet:
-		ok = (value & inV) != 0
+		ok = (regA & value) != 0
 	case JumpBitsNotSet:
 	case JumpBitsNotSet:
-		ok = (value & inV) == 0
+		ok = (regA & value) == 0
 	}
 	}
 
 
 	if ok {
 	if ok {
-		return int(ins.SkipTrue)
+		return int(skipTrue)
 	}
 	}
 
 
-	return int(ins.SkipFalse)
+	return int(skipFalse)
 }
 }
 
 
 func loadAbsolute(ins LoadAbsolute, in []byte) (uint32, bool) {
 func loadAbsolute(ins LoadAbsolute, in []byte) (uint32, bool) {

+ 1 - 4
vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go

@@ -2,18 +2,15 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build go1.7
-
 // Package ctxhttp provides helper functions for performing context-aware HTTP requests.
 // Package ctxhttp provides helper functions for performing context-aware HTTP requests.
 package ctxhttp // import "golang.org/x/net/context/ctxhttp"
 package ctxhttp // import "golang.org/x/net/context/ctxhttp"
 
 
 import (
 import (
+	"context"
 	"io"
 	"io"
 	"net/http"
 	"net/http"
 	"net/url"
 	"net/url"
 	"strings"
 	"strings"
-
-	"golang.org/x/net/context"
 )
 )
 
 
 // Do sends an HTTP request with the provided http.Client and returns
 // Do sends an HTTP request with the provided http.Client and returns

+ 0 - 147
vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go

@@ -1,147 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.7
-
-package ctxhttp // import "golang.org/x/net/context/ctxhttp"
-
-import (
-	"io"
-	"net/http"
-	"net/url"
-	"strings"
-
-	"golang.org/x/net/context"
-)
-
-func nop() {}
-
-var (
-	testHookContextDoneBeforeHeaders = nop
-	testHookDoReturned               = nop
-	testHookDidBodyClose             = nop
-)
-
-// Do sends an HTTP request with the provided http.Client and returns an HTTP response.
-// If the client is nil, http.DefaultClient is used.
-// If the context is canceled or times out, ctx.Err() will be returned.
-func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) {
-	if client == nil {
-		client = http.DefaultClient
-	}
-
-	// TODO(djd): Respect any existing value of req.Cancel.
-	cancel := make(chan struct{})
-	req.Cancel = cancel
-
-	type responseAndError struct {
-		resp *http.Response
-		err  error
-	}
-	result := make(chan responseAndError, 1)
-
-	// Make local copies of test hooks closed over by goroutines below.
-	// Prevents data races in tests.
-	testHookDoReturned := testHookDoReturned
-	testHookDidBodyClose := testHookDidBodyClose
-
-	go func() {
-		resp, err := client.Do(req)
-		testHookDoReturned()
-		result <- responseAndError{resp, err}
-	}()
-
-	var resp *http.Response
-
-	select {
-	case <-ctx.Done():
-		testHookContextDoneBeforeHeaders()
-		close(cancel)
-		// Clean up after the goroutine calling client.Do:
-		go func() {
-			if r := <-result; r.resp != nil {
-				testHookDidBodyClose()
-				r.resp.Body.Close()
-			}
-		}()
-		return nil, ctx.Err()
-	case r := <-result:
-		var err error
-		resp, err = r.resp, r.err
-		if err != nil {
-			return resp, err
-		}
-	}
-
-	c := make(chan struct{})
-	go func() {
-		select {
-		case <-ctx.Done():
-			close(cancel)
-		case <-c:
-			// The response's Body is closed.
-		}
-	}()
-	resp.Body = &notifyingReader{resp.Body, c}
-
-	return resp, nil
-}
-
-// Get issues a GET request via the Do function.
-func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) {
-	req, err := http.NewRequest("GET", url, nil)
-	if err != nil {
-		return nil, err
-	}
-	return Do(ctx, client, req)
-}
-
-// Head issues a HEAD request via the Do function.
-func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) {
-	req, err := http.NewRequest("HEAD", url, nil)
-	if err != nil {
-		return nil, err
-	}
-	return Do(ctx, client, req)
-}
-
-// Post issues a POST request via the Do function.
-func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) {
-	req, err := http.NewRequest("POST", url, body)
-	if err != nil {
-		return nil, err
-	}
-	req.Header.Set("Content-Type", bodyType)
-	return Do(ctx, client, req)
-}
-
-// PostForm issues a POST request via the Do function.
-func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) {
-	return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode()))
-}
-
-// notifyingReader is an io.ReadCloser that closes the notify channel after
-// Close is called or a Read fails on the underlying ReadCloser.
-type notifyingReader struct {
-	io.ReadCloser
-	notify chan<- struct{}
-}
-
-func (r *notifyingReader) Read(p []byte) (int, error) {
-	n, err := r.ReadCloser.Read(p)
-	if err != nil && r.notify != nil {
-		close(r.notify)
-		r.notify = nil
-	}
-	return n, err
-}
-
-func (r *notifyingReader) Close() error {
-	err := r.ReadCloser.Close()
-	if r.notify != nil {
-		close(r.notify)
-		r.notify = nil
-	}
-	return err
-}

+ 0 - 82
vendor/golang.org/x/net/http2/configure_transport.go

@@ -1,82 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.6
-
-package http2
-
-import (
-	"crypto/tls"
-	"fmt"
-	"net/http"
-)
-
-func configureTransport(t1 *http.Transport) (*Transport, error) {
-	connPool := new(clientConnPool)
-	t2 := &Transport{
-		ConnPool: noDialClientConnPool{connPool},
-		t1:       t1,
-	}
-	connPool.t = t2
-	if err := registerHTTPSProtocol(t1, noDialH2RoundTripper{t2}); err != nil {
-		return nil, err
-	}
-	if t1.TLSClientConfig == nil {
-		t1.TLSClientConfig = new(tls.Config)
-	}
-	if !strSliceContains(t1.TLSClientConfig.NextProtos, "h2") {
-		t1.TLSClientConfig.NextProtos = append([]string{"h2"}, t1.TLSClientConfig.NextProtos...)
-	}
-	if !strSliceContains(t1.TLSClientConfig.NextProtos, "http/1.1") {
-		t1.TLSClientConfig.NextProtos = append(t1.TLSClientConfig.NextProtos, "http/1.1")
-	}
-	upgradeFn := func(authority string, c *tls.Conn) http.RoundTripper {
-		addr := authorityAddr("https", authority)
-		if used, err := connPool.addConnIfNeeded(addr, t2, c); err != nil {
-			go c.Close()
-			return erringRoundTripper{err}
-		} else if !used {
-			// Turns out we don't need this c.
-			// For example, two goroutines made requests to the same host
-			// at the same time, both kicking off TCP dials. (since protocol
-			// was unknown)
-			go c.Close()
-		}
-		return t2
-	}
-	if m := t1.TLSNextProto; len(m) == 0 {
-		t1.TLSNextProto = map[string]func(string, *tls.Conn) http.RoundTripper{
-			"h2": upgradeFn,
-		}
-	} else {
-		m["h2"] = upgradeFn
-	}
-	return t2, nil
-}
-
-// registerHTTPSProtocol calls Transport.RegisterProtocol but
-// converting panics into errors.
-func registerHTTPSProtocol(t *http.Transport, rt noDialH2RoundTripper) (err error) {
-	defer func() {
-		if e := recover(); e != nil {
-			err = fmt.Errorf("%v", e)
-		}
-	}()
-	t.RegisterProtocol("https", rt)
-	return nil
-}
-
-// noDialH2RoundTripper is a RoundTripper which only tries to complete the request
-// if there's already has a cached connection to the host.
-// (The field is exported so it can be accessed via reflect from net/http; tested
-// by TestNoDialH2RoundTripperType)
-type noDialH2RoundTripper struct{ *Transport }
-
-func (rt noDialH2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
-	res, err := rt.Transport.RoundTrip(req)
-	if isNoCachedConnError(err) {
-		return nil, http.ErrSkipAltProtocol
-	}
-	return res, err
-}

+ 2 - 2
vendor/golang.org/x/net/http2/frame.go

@@ -643,7 +643,7 @@ func (f *Framer) WriteData(streamID uint32, endStream bool, data []byte) error {
 	return f.WriteDataPadded(streamID, endStream, data, nil)
 	return f.WriteDataPadded(streamID, endStream, data, nil)
 }
 }
 
 
-// WriteData writes a DATA frame with optional padding.
+// WriteDataPadded writes a DATA frame with optional padding.
 //
 //
 // If pad is nil, the padding bit is not sent.
 // If pad is nil, the padding bit is not sent.
 // The length of pad must not exceed 255 bytes.
 // The length of pad must not exceed 255 bytes.
@@ -1477,7 +1477,7 @@ func (fr *Framer) maxHeaderStringLen() int {
 }
 }
 
 
 // readMetaFrame returns 0 or more CONTINUATION frames from fr and
 // readMetaFrame returns 0 or more CONTINUATION frames from fr and
-// merge them into into the provided hf and returns a MetaHeadersFrame
+// merge them into the provided hf and returns a MetaHeadersFrame
 // with the decoded hpack values.
 // with the decoded hpack values.
 func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) {
 func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) {
 	if fr.AllowIllegalReads {
 	if fr.AllowIllegalReads {

+ 7 - 4
vendor/golang.org/x/net/http2/go111.go

@@ -6,19 +6,22 @@
 
 
 package http2
 package http2
 
 
-import "net/textproto"
+import (
+	"net/http/httptrace"
+	"net/textproto"
+)
 
 
-func traceHasWroteHeaderField(trace *clientTrace) bool {
+func traceHasWroteHeaderField(trace *httptrace.ClientTrace) bool {
 	return trace != nil && trace.WroteHeaderField != nil
 	return trace != nil && trace.WroteHeaderField != nil
 }
 }
 
 
-func traceWroteHeaderField(trace *clientTrace, k, v string) {
+func traceWroteHeaderField(trace *httptrace.ClientTrace, k, v string) {
 	if trace != nil && trace.WroteHeaderField != nil {
 	if trace != nil && trace.WroteHeaderField != nil {
 		trace.WroteHeaderField(k, []string{v})
 		trace.WroteHeaderField(k, []string{v})
 	}
 	}
 }
 }
 
 
-func traceGot1xxResponseFunc(trace *clientTrace) func(int, textproto.MIMEHeader) error {
+func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error {
 	if trace != nil {
 	if trace != nil {
 		return trace.Got1xxResponse
 		return trace.Got1xxResponse
 	}
 	}

+ 0 - 16
vendor/golang.org/x/net/http2/go16.go

@@ -1,16 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.6
-
-package http2
-
-import (
-	"net/http"
-	"time"
-)
-
-func transportExpectContinueTimeout(t1 *http.Transport) time.Duration {
-	return t1.ExpectContinueTimeout
-}

+ 0 - 121
vendor/golang.org/x/net/http2/go17.go

@@ -1,121 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.7
-
-package http2
-
-import (
-	"context"
-	"net"
-	"net/http"
-	"net/http/httptrace"
-	"time"
-)
-
-type contextContext interface {
-	context.Context
-}
-
-var errCanceled = context.Canceled
-
-func serverConnBaseContext(c net.Conn, opts *ServeConnOpts) (ctx contextContext, cancel func()) {
-	ctx, cancel = context.WithCancel(context.Background())
-	ctx = context.WithValue(ctx, http.LocalAddrContextKey, c.LocalAddr())
-	if hs := opts.baseConfig(); hs != nil {
-		ctx = context.WithValue(ctx, http.ServerContextKey, hs)
-	}
-	return
-}
-
-func contextWithCancel(ctx contextContext) (_ contextContext, cancel func()) {
-	return context.WithCancel(ctx)
-}
-
-func requestWithContext(req *http.Request, ctx contextContext) *http.Request {
-	return req.WithContext(ctx)
-}
-
-type clientTrace httptrace.ClientTrace
-
-func reqContext(r *http.Request) context.Context { return r.Context() }
-
-func (t *Transport) idleConnTimeout() time.Duration {
-	if t.t1 != nil {
-		return t.t1.IdleConnTimeout
-	}
-	return 0
-}
-
-func setResponseUncompressed(res *http.Response) { res.Uncompressed = true }
-
-func traceGetConn(req *http.Request, hostPort string) {
-	trace := httptrace.ContextClientTrace(req.Context())
-	if trace == nil || trace.GetConn == nil {
-		return
-	}
-	trace.GetConn(hostPort)
-}
-
-func traceGotConn(req *http.Request, cc *ClientConn) {
-	trace := httptrace.ContextClientTrace(req.Context())
-	if trace == nil || trace.GotConn == nil {
-		return
-	}
-	ci := httptrace.GotConnInfo{Conn: cc.tconn}
-	cc.mu.Lock()
-	ci.Reused = cc.nextStreamID > 1
-	ci.WasIdle = len(cc.streams) == 0 && ci.Reused
-	if ci.WasIdle && !cc.lastActive.IsZero() {
-		ci.IdleTime = time.Now().Sub(cc.lastActive)
-	}
-	cc.mu.Unlock()
-
-	trace.GotConn(ci)
-}
-
-func traceWroteHeaders(trace *clientTrace) {
-	if trace != nil && trace.WroteHeaders != nil {
-		trace.WroteHeaders()
-	}
-}
-
-func traceGot100Continue(trace *clientTrace) {
-	if trace != nil && trace.Got100Continue != nil {
-		trace.Got100Continue()
-	}
-}
-
-func traceWait100Continue(trace *clientTrace) {
-	if trace != nil && trace.Wait100Continue != nil {
-		trace.Wait100Continue()
-	}
-}
-
-func traceWroteRequest(trace *clientTrace, err error) {
-	if trace != nil && trace.WroteRequest != nil {
-		trace.WroteRequest(httptrace.WroteRequestInfo{Err: err})
-	}
-}
-
-func traceFirstResponseByte(trace *clientTrace) {
-	if trace != nil && trace.GotFirstResponseByte != nil {
-		trace.GotFirstResponseByte()
-	}
-}
-
-func requestTrace(req *http.Request) *clientTrace {
-	trace := httptrace.ContextClientTrace(req.Context())
-	return (*clientTrace)(trace)
-}
-
-// Ping sends a PING frame to the server and waits for the ack.
-func (cc *ClientConn) Ping(ctx context.Context) error {
-	return cc.ping(ctx)
-}
-
-// Shutdown gracefully closes the client connection, waiting for running streams to complete.
-func (cc *ClientConn) Shutdown(ctx context.Context) error {
-	return cc.shutdown(ctx)
-}

+ 0 - 36
vendor/golang.org/x/net/http2/go17_not18.go

@@ -1,36 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.7,!go1.8
-
-package http2
-
-import "crypto/tls"
-
-// temporary copy of Go 1.7's private tls.Config.clone:
-func cloneTLSConfig(c *tls.Config) *tls.Config {
-	return &tls.Config{
-		Rand:                        c.Rand,
-		Time:                        c.Time,
-		Certificates:                c.Certificates,
-		NameToCertificate:           c.NameToCertificate,
-		GetCertificate:              c.GetCertificate,
-		RootCAs:                     c.RootCAs,
-		NextProtos:                  c.NextProtos,
-		ServerName:                  c.ServerName,
-		ClientAuth:                  c.ClientAuth,
-		ClientCAs:                   c.ClientCAs,
-		InsecureSkipVerify:          c.InsecureSkipVerify,
-		CipherSuites:                c.CipherSuites,
-		PreferServerCipherSuites:    c.PreferServerCipherSuites,
-		SessionTicketsDisabled:      c.SessionTicketsDisabled,
-		SessionTicketKey:            c.SessionTicketKey,
-		ClientSessionCache:          c.ClientSessionCache,
-		MinVersion:                  c.MinVersion,
-		MaxVersion:                  c.MaxVersion,
-		CurvePreferences:            c.CurvePreferences,
-		DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled,
-		Renegotiation:               c.Renegotiation,
-	}
-}

+ 0 - 56
vendor/golang.org/x/net/http2/go18.go

@@ -1,56 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.8
-
-package http2
-
-import (
-	"crypto/tls"
-	"io"
-	"net/http"
-)
-
-func cloneTLSConfig(c *tls.Config) *tls.Config {
-	c2 := c.Clone()
-	c2.GetClientCertificate = c.GetClientCertificate // golang.org/issue/19264
-	return c2
-}
-
-var _ http.Pusher = (*responseWriter)(nil)
-
-// Push implements http.Pusher.
-func (w *responseWriter) Push(target string, opts *http.PushOptions) error {
-	internalOpts := pushOptions{}
-	if opts != nil {
-		internalOpts.Method = opts.Method
-		internalOpts.Header = opts.Header
-	}
-	return w.push(target, internalOpts)
-}
-
-func configureServer18(h1 *http.Server, h2 *Server) error {
-	if h2.IdleTimeout == 0 {
-		if h1.IdleTimeout != 0 {
-			h2.IdleTimeout = h1.IdleTimeout
-		} else {
-			h2.IdleTimeout = h1.ReadTimeout
-		}
-	}
-	return nil
-}
-
-func shouldLogPanic(panicValue interface{}) bool {
-	return panicValue != nil && panicValue != http.ErrAbortHandler
-}
-
-func reqGetBody(req *http.Request) func() (io.ReadCloser, error) {
-	return req.GetBody
-}
-
-func reqBodyIsNoBody(body io.ReadCloser) bool {
-	return body == http.NoBody
-}
-
-func go18httpNoBody() io.ReadCloser { return http.NoBody } // for tests only

+ 0 - 16
vendor/golang.org/x/net/http2/go19.go

@@ -1,16 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.9
-
-package http2
-
-import (
-	"net/http"
-)
-
-func configureServer19(s *http.Server, conf *Server) error {
-	s.RegisterOnShutdown(conf.state.startGracefulShutdown)
-	return nil
-}

+ 15 - 5
vendor/golang.org/x/net/http2/headermap.go

@@ -7,15 +7,21 @@ package http2
 import (
 import (
 	"net/http"
 	"net/http"
 	"strings"
 	"strings"
+	"sync"
 )
 )
 
 
 var (
 var (
-	commonLowerHeader = map[string]string{} // Go-Canonical-Case -> lower-case
-	commonCanonHeader = map[string]string{} // lower-case -> Go-Canonical-Case
+	commonBuildOnce   sync.Once
+	commonLowerHeader map[string]string // Go-Canonical-Case -> lower-case
+	commonCanonHeader map[string]string // lower-case -> Go-Canonical-Case
 )
 )
 
 
-func init() {
-	for _, v := range []string{
+func buildCommonHeaderMapsOnce() {
+	commonBuildOnce.Do(buildCommonHeaderMaps)
+}
+
+func buildCommonHeaderMaps() {
+	common := []string{
 		"accept",
 		"accept",
 		"accept-charset",
 		"accept-charset",
 		"accept-encoding",
 		"accept-encoding",
@@ -63,7 +69,10 @@ func init() {
 		"vary",
 		"vary",
 		"via",
 		"via",
 		"www-authenticate",
 		"www-authenticate",
-	} {
+	}
+	commonLowerHeader = make(map[string]string, len(common))
+	commonCanonHeader = make(map[string]string, len(common))
+	for _, v := range common {
 		chk := http.CanonicalHeaderKey(v)
 		chk := http.CanonicalHeaderKey(v)
 		commonLowerHeader[chk] = v
 		commonLowerHeader[chk] = v
 		commonCanonHeader[v] = chk
 		commonCanonHeader[v] = chk
@@ -71,6 +80,7 @@ func init() {
 }
 }
 
 
 func lowerHeader(v string) string {
 func lowerHeader(v string) string {
+	buildCommonHeaderMapsOnce()
 	if s, ok := commonLowerHeader[v]; ok {
 	if s, ok := commonLowerHeader[v]; ok {
 		return s
 		return s
 	}
 	}

+ 9 - 1
vendor/golang.org/x/net/http2/hpack/hpack.go

@@ -92,6 +92,8 @@ type Decoder struct {
 	// saveBuf is previous data passed to Write which we weren't able
 	// saveBuf is previous data passed to Write which we weren't able
 	// to fully parse before. Unlike buf, we own this data.
 	// to fully parse before. Unlike buf, we own this data.
 	saveBuf bytes.Buffer
 	saveBuf bytes.Buffer
+
+	firstField bool // processing the first field of the header block
 }
 }
 
 
 // NewDecoder returns a new decoder with the provided maximum dynamic
 // NewDecoder returns a new decoder with the provided maximum dynamic
@@ -101,6 +103,7 @@ func NewDecoder(maxDynamicTableSize uint32, emitFunc func(f HeaderField)) *Decod
 	d := &Decoder{
 	d := &Decoder{
 		emit:        emitFunc,
 		emit:        emitFunc,
 		emitEnabled: true,
 		emitEnabled: true,
+		firstField:  true,
 	}
 	}
 	d.dynTab.table.init()
 	d.dynTab.table.init()
 	d.dynTab.allowedMaxSize = maxDynamicTableSize
 	d.dynTab.allowedMaxSize = maxDynamicTableSize
@@ -226,11 +229,15 @@ func (d *Decoder) DecodeFull(p []byte) ([]HeaderField, error) {
 	return hf, nil
 	return hf, nil
 }
 }
 
 
+// Close declares that the decoding is complete and resets the Decoder
+// to be reused again for a new header block. If there is any remaining
+// data in the decoder's buffer, Close returns an error.
 func (d *Decoder) Close() error {
 func (d *Decoder) Close() error {
 	if d.saveBuf.Len() > 0 {
 	if d.saveBuf.Len() > 0 {
 		d.saveBuf.Reset()
 		d.saveBuf.Reset()
 		return DecodingError{errors.New("truncated headers")}
 		return DecodingError{errors.New("truncated headers")}
 	}
 	}
+	d.firstField = true
 	return nil
 	return nil
 }
 }
 
 
@@ -266,6 +273,7 @@ func (d *Decoder) Write(p []byte) (n int, err error) {
 			d.saveBuf.Write(d.buf)
 			d.saveBuf.Write(d.buf)
 			return len(p), nil
 			return len(p), nil
 		}
 		}
+		d.firstField = false
 		if err != nil {
 		if err != nil {
 			break
 			break
 		}
 		}
@@ -391,7 +399,7 @@ func (d *Decoder) callEmit(hf HeaderField) error {
 func (d *Decoder) parseDynamicTableSizeUpdate() error {
 func (d *Decoder) parseDynamicTableSizeUpdate() error {
 	// RFC 7541, sec 4.2: This dynamic table size update MUST occur at the
 	// RFC 7541, sec 4.2: This dynamic table size update MUST occur at the
 	// beginning of the first header block following the change to the dynamic table size.
 	// beginning of the first header block following the change to the dynamic table size.
-	if d.dynTab.size > 0 {
+	if !d.firstField && d.dynTab.size > 0 {
 		return DecodingError{errors.New("dynamic table size update MUST occur at the beginning of a header block")}
 		return DecodingError{errors.New("dynamic table size update MUST occur at the beginning of a header block")}
 	}
 	}
 
 

+ 15 - 5
vendor/golang.org/x/net/http2/hpack/huffman.go

@@ -47,6 +47,7 @@ var ErrInvalidHuffman = errors.New("hpack: invalid Huffman-encoded data")
 // If maxLen is greater than 0, attempts to write more to buf than
 // If maxLen is greater than 0, attempts to write more to buf than
 // maxLen bytes will return ErrStringLength.
 // maxLen bytes will return ErrStringLength.
 func huffmanDecode(buf *bytes.Buffer, maxLen int, v []byte) error {
 func huffmanDecode(buf *bytes.Buffer, maxLen int, v []byte) error {
+	rootHuffmanNode := getRootHuffmanNode()
 	n := rootHuffmanNode
 	n := rootHuffmanNode
 	// cur is the bit buffer that has not been fed into n.
 	// cur is the bit buffer that has not been fed into n.
 	// cbits is the number of low order bits in cur that are valid.
 	// cbits is the number of low order bits in cur that are valid.
@@ -106,7 +107,7 @@ func huffmanDecode(buf *bytes.Buffer, maxLen int, v []byte) error {
 
 
 type node struct {
 type node struct {
 	// children is non-nil for internal nodes
 	// children is non-nil for internal nodes
-	children []*node
+	children *[256]*node
 
 
 	// The following are only valid if children is nil:
 	// The following are only valid if children is nil:
 	codeLen uint8 // number of bits that led to the output of sym
 	codeLen uint8 // number of bits that led to the output of sym
@@ -114,22 +115,31 @@ type node struct {
 }
 }
 
 
 func newInternalNode() *node {
 func newInternalNode() *node {
-	return &node{children: make([]*node, 256)}
+	return &node{children: new([256]*node)}
 }
 }
 
 
-var rootHuffmanNode = newInternalNode()
+var (
+	buildRootOnce       sync.Once
+	lazyRootHuffmanNode *node
+)
+
+func getRootHuffmanNode() *node {
+	buildRootOnce.Do(buildRootHuffmanNode)
+	return lazyRootHuffmanNode
+}
 
 
-func init() {
+func buildRootHuffmanNode() {
 	if len(huffmanCodes) != 256 {
 	if len(huffmanCodes) != 256 {
 		panic("unexpected size")
 		panic("unexpected size")
 	}
 	}
+	lazyRootHuffmanNode = newInternalNode()
 	for i, code := range huffmanCodes {
 	for i, code := range huffmanCodes {
 		addDecoderNode(byte(i), code, huffmanCodeLen[i])
 		addDecoderNode(byte(i), code, huffmanCodeLen[i])
 	}
 	}
 }
 }
 
 
 func addDecoderNode(sym byte, code uint32, codeLen uint8) {
 func addDecoderNode(sym byte, code uint32, codeLen uint8) {
-	cur := rootHuffmanNode
+	cur := lazyRootHuffmanNode
 	for codeLen > 8 {
 	for codeLen > 8 {
 		codeLen -= 8
 		codeLen -= 8
 		i := uint8(code >> codeLen)
 		i := uint8(code >> codeLen)

+ 5 - 12
vendor/golang.org/x/net/http2/http2.go

@@ -201,19 +201,12 @@ func validWireHeaderFieldName(v string) bool {
 	return true
 	return true
 }
 }
 
 
-var httpCodeStringCommon = map[int]string{} // n -> strconv.Itoa(n)
-
-func init() {
-	for i := 100; i <= 999; i++ {
-		if v := http.StatusText(i); v != "" {
-			httpCodeStringCommon[i] = strconv.Itoa(i)
-		}
-	}
-}
-
 func httpCodeString(code int) string {
 func httpCodeString(code int) string {
-	if s, ok := httpCodeStringCommon[code]; ok {
-		return s
+	switch code {
+	case 200:
+		return "200"
+	case 404:
+		return "404"
 	}
 	}
 	return strconv.Itoa(code)
 	return strconv.Itoa(code)
 }
 }

+ 7 - 4
vendor/golang.org/x/net/http2/not_go111.go

@@ -6,12 +6,15 @@
 
 
 package http2
 package http2
 
 
-import "net/textproto"
+import (
+	"net/http/httptrace"
+	"net/textproto"
+)
 
 
-func traceHasWroteHeaderField(trace *clientTrace) bool { return false }
+func traceHasWroteHeaderField(trace *httptrace.ClientTrace) bool { return false }
 
 
-func traceWroteHeaderField(trace *clientTrace, k, v string) {}
+func traceWroteHeaderField(trace *httptrace.ClientTrace, k, v string) {}
 
 
-func traceGot1xxResponseFunc(trace *clientTrace) func(int, textproto.MIMEHeader) error {
+func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error {
 	return nil
 	return nil
 }
 }

+ 0 - 21
vendor/golang.org/x/net/http2/not_go16.go

@@ -1,21 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.6
-
-package http2
-
-import (
-	"net/http"
-	"time"
-)
-
-func configureTransport(t1 *http.Transport) (*Transport, error) {
-	return nil, errTransportVersion
-}
-
-func transportExpectContinueTimeout(t1 *http.Transport) time.Duration {
-	return 0
-
-}

+ 0 - 95
vendor/golang.org/x/net/http2/not_go17.go

@@ -1,95 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.7
-
-package http2
-
-import (
-	"crypto/tls"
-	"errors"
-	"net"
-	"net/http"
-	"time"
-)
-
-type contextContext interface {
-	Done() <-chan struct{}
-	Err() error
-}
-
-var errCanceled = errors.New("canceled")
-
-type fakeContext struct{}
-
-func (fakeContext) Done() <-chan struct{} { return nil }
-func (fakeContext) Err() error            { panic("should not be called") }
-
-func reqContext(r *http.Request) fakeContext {
-	return fakeContext{}
-}
-
-func setResponseUncompressed(res *http.Response) {
-	// Nothing.
-}
-
-type clientTrace struct{}
-
-func requestTrace(*http.Request) *clientTrace { return nil }
-func traceGetConn(*http.Request, string)      {}
-func traceGotConn(*http.Request, *ClientConn) {}
-func traceFirstResponseByte(*clientTrace)     {}
-func traceWroteHeaders(*clientTrace)          {}
-func traceWroteRequest(*clientTrace, error)   {}
-func traceGot100Continue(trace *clientTrace)  {}
-func traceWait100Continue(trace *clientTrace) {}
-
-func nop() {}
-
-func serverConnBaseContext(c net.Conn, opts *ServeConnOpts) (ctx contextContext, cancel func()) {
-	return nil, nop
-}
-
-func contextWithCancel(ctx contextContext) (_ contextContext, cancel func()) {
-	return ctx, nop
-}
-
-func requestWithContext(req *http.Request, ctx contextContext) *http.Request {
-	return req
-}
-
-// temporary copy of Go 1.6's private tls.Config.clone:
-func cloneTLSConfig(c *tls.Config) *tls.Config {
-	return &tls.Config{
-		Rand:                     c.Rand,
-		Time:                     c.Time,
-		Certificates:             c.Certificates,
-		NameToCertificate:        c.NameToCertificate,
-		GetCertificate:           c.GetCertificate,
-		RootCAs:                  c.RootCAs,
-		NextProtos:               c.NextProtos,
-		ServerName:               c.ServerName,
-		ClientAuth:               c.ClientAuth,
-		ClientCAs:                c.ClientCAs,
-		InsecureSkipVerify:       c.InsecureSkipVerify,
-		CipherSuites:             c.CipherSuites,
-		PreferServerCipherSuites: c.PreferServerCipherSuites,
-		SessionTicketsDisabled:   c.SessionTicketsDisabled,
-		SessionTicketKey:         c.SessionTicketKey,
-		ClientSessionCache:       c.ClientSessionCache,
-		MinVersion:               c.MinVersion,
-		MaxVersion:               c.MaxVersion,
-		CurvePreferences:         c.CurvePreferences,
-	}
-}
-
-func (cc *ClientConn) Ping(ctx contextContext) error {
-	return cc.ping(ctx)
-}
-
-func (cc *ClientConn) Shutdown(ctx contextContext) error {
-	return cc.shutdown(ctx)
-}
-
-func (t *Transport) idleConnTimeout() time.Duration { return 0 }

+ 0 - 29
vendor/golang.org/x/net/http2/not_go18.go

@@ -1,29 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.8
-
-package http2
-
-import (
-	"io"
-	"net/http"
-)
-
-func configureServer18(h1 *http.Server, h2 *Server) error {
-	// No IdleTimeout to sync prior to Go 1.8.
-	return nil
-}
-
-func shouldLogPanic(panicValue interface{}) bool {
-	return panicValue != nil
-}
-
-func reqGetBody(req *http.Request) func() (io.ReadCloser, error) {
-	return nil
-}
-
-func reqBodyIsNoBody(io.ReadCloser) bool { return false }
-
-func go18httpNoBody() io.ReadCloser { return nil } // for tests only

+ 0 - 16
vendor/golang.org/x/net/http2/not_go19.go

@@ -1,16 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.9
-
-package http2
-
-import (
-	"net/http"
-)
-
-func configureServer19(s *http.Server, conf *Server) error {
-	// not supported prior to go1.9
-	return nil
-}

+ 31 - 33
vendor/golang.org/x/net/http2/server.go

@@ -28,6 +28,7 @@ package http2
 import (
 import (
 	"bufio"
 	"bufio"
 	"bytes"
 	"bytes"
+	"context"
 	"crypto/tls"
 	"crypto/tls"
 	"errors"
 	"errors"
 	"fmt"
 	"fmt"
@@ -209,12 +210,14 @@ func ConfigureServer(s *http.Server, conf *Server) error {
 		conf = new(Server)
 		conf = new(Server)
 	}
 	}
 	conf.state = &serverInternalState{activeConns: make(map[*serverConn]struct{})}
 	conf.state = &serverInternalState{activeConns: make(map[*serverConn]struct{})}
-	if err := configureServer18(s, conf); err != nil {
-		return err
-	}
-	if err := configureServer19(s, conf); err != nil {
-		return err
+	if h1, h2 := s, conf; h2.IdleTimeout == 0 {
+		if h1.IdleTimeout != 0 {
+			h2.IdleTimeout = h1.IdleTimeout
+		} else {
+			h2.IdleTimeout = h1.ReadTimeout
+		}
 	}
 	}
+	s.RegisterOnShutdown(conf.state.startGracefulShutdown)
 
 
 	if s.TLSConfig == nil {
 	if s.TLSConfig == nil {
 		s.TLSConfig = new(tls.Config)
 		s.TLSConfig = new(tls.Config)
@@ -435,6 +438,15 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) {
 	sc.serve()
 	sc.serve()
 }
 }
 
 
+func serverConnBaseContext(c net.Conn, opts *ServeConnOpts) (ctx context.Context, cancel func()) {
+	ctx, cancel = context.WithCancel(context.Background())
+	ctx = context.WithValue(ctx, http.LocalAddrContextKey, c.LocalAddr())
+	if hs := opts.baseConfig(); hs != nil {
+		ctx = context.WithValue(ctx, http.ServerContextKey, hs)
+	}
+	return
+}
+
 func (sc *serverConn) rejectConn(err ErrCode, debug string) {
 func (sc *serverConn) rejectConn(err ErrCode, debug string) {
 	sc.vlogf("http2: server rejecting conn: %v, %s", err, debug)
 	sc.vlogf("http2: server rejecting conn: %v, %s", err, debug)
 	// ignoring errors. hanging up anyway.
 	// ignoring errors. hanging up anyway.
@@ -450,7 +462,7 @@ type serverConn struct {
 	conn             net.Conn
 	conn             net.Conn
 	bw               *bufferedWriter // writing to conn
 	bw               *bufferedWriter // writing to conn
 	handler          http.Handler
 	handler          http.Handler
-	baseCtx          contextContext
+	baseCtx          context.Context
 	framer           *Framer
 	framer           *Framer
 	doneServing      chan struct{}          // closed when serverConn.serve ends
 	doneServing      chan struct{}          // closed when serverConn.serve ends
 	readFrameCh      chan readFrameResult   // written by serverConn.readFrames
 	readFrameCh      chan readFrameResult   // written by serverConn.readFrames
@@ -530,7 +542,7 @@ type stream struct {
 	id        uint32
 	id        uint32
 	body      *pipe       // non-nil if expecting DATA frames
 	body      *pipe       // non-nil if expecting DATA frames
 	cw        closeWaiter // closed wait stream transitions to closed state
 	cw        closeWaiter // closed wait stream transitions to closed state
-	ctx       contextContext
+	ctx       context.Context
 	cancelCtx func()
 	cancelCtx func()
 
 
 	// owned by serverConn's serve loop:
 	// owned by serverConn's serve loop:
@@ -663,6 +675,7 @@ func (sc *serverConn) condlogf(err error, format string, args ...interface{}) {
 
 
 func (sc *serverConn) canonicalHeader(v string) string {
 func (sc *serverConn) canonicalHeader(v string) string {
 	sc.serveG.check()
 	sc.serveG.check()
+	buildCommonHeaderMapsOnce()
 	cv, ok := commonCanonHeader[v]
 	cv, ok := commonCanonHeader[v]
 	if ok {
 	if ok {
 		return cv
 		return cv
@@ -1109,7 +1122,7 @@ func (sc *serverConn) startFrameWrite(wr FrameWriteRequest) {
 
 
 // errHandlerPanicked is the error given to any callers blocked in a read from
 // errHandlerPanicked is the error given to any callers blocked in a read from
 // Request.Body when the main goroutine panics. Since most handlers read in the
 // Request.Body when the main goroutine panics. Since most handlers read in the
-// the main ServeHTTP goroutine, this will show up rarely.
+// main ServeHTTP goroutine, this will show up rarely.
 var errHandlerPanicked = errors.New("http2: handler panicked")
 var errHandlerPanicked = errors.New("http2: handler panicked")
 
 
 // wroteFrame is called on the serve goroutine with the result of
 // wroteFrame is called on the serve goroutine with the result of
@@ -1581,12 +1594,6 @@ func (sc *serverConn) processData(f *DataFrame) error {
 		// type PROTOCOL_ERROR."
 		// type PROTOCOL_ERROR."
 		return ConnectionError(ErrCodeProtocol)
 		return ConnectionError(ErrCodeProtocol)
 	}
 	}
-	// RFC 7540, sec 6.1: If a DATA frame is received whose stream is not in
-	// "open" or "half-closed (local)" state, the recipient MUST respond with a
-	// stream error (Section 5.4.2) of type STREAM_CLOSED.
-	if state == stateClosed {
-		return streamError(id, ErrCodeStreamClosed)
-	}
 	if st == nil || state != stateOpen || st.gotTrailerHeader || st.resetQueued {
 	if st == nil || state != stateOpen || st.gotTrailerHeader || st.resetQueued {
 		// This includes sending a RST_STREAM if the stream is
 		// This includes sending a RST_STREAM if the stream is
 		// in stateHalfClosedLocal (which currently means that
 		// in stateHalfClosedLocal (which currently means that
@@ -1881,7 +1888,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream
 		panic("internal error: cannot create stream with id 0")
 		panic("internal error: cannot create stream with id 0")
 	}
 	}
 
 
-	ctx, cancelCtx := contextWithCancel(sc.baseCtx)
+	ctx, cancelCtx := context.WithCancel(sc.baseCtx)
 	st := &stream{
 	st := &stream{
 		sc:        sc,
 		sc:        sc,
 		id:        id,
 		id:        id,
@@ -2047,7 +2054,7 @@ func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp requestParam) (*r
 		Body:       body,
 		Body:       body,
 		Trailer:    trailer,
 		Trailer:    trailer,
 	}
 	}
-	req = requestWithContext(req, st.ctx)
+	req = req.WithContext(st.ctx)
 
 
 	rws := responseWriterStatePool.Get().(*responseWriterState)
 	rws := responseWriterStatePool.Get().(*responseWriterState)
 	bwSave := rws.bw
 	bwSave := rws.bw
@@ -2075,7 +2082,7 @@ func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler
 				stream: rw.rws.stream,
 				stream: rw.rws.stream,
 			})
 			})
 			// Same as net/http:
 			// Same as net/http:
-			if shouldLogPanic(e) {
+			if e != nil && e != http.ErrAbortHandler {
 				const size = 64 << 10
 				const size = 64 << 10
 				buf := make([]byte, size)
 				buf := make([]byte, size)
 				buf = buf[:runtime.Stack(buf, false)]
 				buf = buf[:runtime.Stack(buf, false)]
@@ -2346,15 +2353,7 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
 		}
 		}
 		_, hasContentType := rws.snapHeader["Content-Type"]
 		_, hasContentType := rws.snapHeader["Content-Type"]
 		if !hasContentType && bodyAllowedForStatus(rws.status) && len(p) > 0 {
 		if !hasContentType && bodyAllowedForStatus(rws.status) && len(p) > 0 {
-			if cto := rws.snapHeader.Get("X-Content-Type-Options"); strings.EqualFold("nosniff", cto) {
-				// nosniff is an explicit directive not to guess a content-type.
-				// Content-sniffing is no less susceptible to polyglot attacks via
-				// hosted content when done on the server.
-				ctype = "application/octet-stream"
-				rws.conn.logf("http2: WriteHeader called with X-Content-Type-Options:nosniff but no Content-Type")
-			} else {
-				ctype = http.DetectContentType(p)
-			}
+			ctype = http.DetectContentType(p)
 		}
 		}
 		var date string
 		var date string
 		if _, ok := rws.snapHeader["Date"]; !ok {
 		if _, ok := rws.snapHeader["Date"]; !ok {
@@ -2645,14 +2644,9 @@ var (
 	ErrPushLimitReached = errors.New("http2: push would exceed peer's SETTINGS_MAX_CONCURRENT_STREAMS")
 	ErrPushLimitReached = errors.New("http2: push would exceed peer's SETTINGS_MAX_CONCURRENT_STREAMS")
 )
 )
 
 
-// pushOptions is the internal version of http.PushOptions, which we
-// cannot include here because it's only defined in Go 1.8 and later.
-type pushOptions struct {
-	Method string
-	Header http.Header
-}
+var _ http.Pusher = (*responseWriter)(nil)
 
 
-func (w *responseWriter) push(target string, opts pushOptions) error {
+func (w *responseWriter) Push(target string, opts *http.PushOptions) error {
 	st := w.rws.stream
 	st := w.rws.stream
 	sc := st.sc
 	sc := st.sc
 	sc.serveG.checkNotOn()
 	sc.serveG.checkNotOn()
@@ -2663,6 +2657,10 @@ func (w *responseWriter) push(target string, opts pushOptions) error {
 		return ErrRecursivePush
 		return ErrRecursivePush
 	}
 	}
 
 
+	if opts == nil {
+		opts = new(http.PushOptions)
+	}
+
 	// Default options.
 	// Default options.
 	if opts.Method == "" {
 	if opts.Method == "" {
 		opts.Method = "GET"
 		opts.Method = "GET"

+ 181 - 27
vendor/golang.org/x/net/http2/transport.go

@@ -10,6 +10,7 @@ import (
 	"bufio"
 	"bufio"
 	"bytes"
 	"bytes"
 	"compress/gzip"
 	"compress/gzip"
+	"context"
 	"crypto/rand"
 	"crypto/rand"
 	"crypto/tls"
 	"crypto/tls"
 	"errors"
 	"errors"
@@ -21,6 +22,7 @@ import (
 	mathrand "math/rand"
 	mathrand "math/rand"
 	"net"
 	"net"
 	"net/http"
 	"net/http"
+	"net/http/httptrace"
 	"net/textproto"
 	"net/textproto"
 	"sort"
 	"sort"
 	"strconv"
 	"strconv"
@@ -95,6 +97,16 @@ type Transport struct {
 	// to mean no limit.
 	// to mean no limit.
 	MaxHeaderListSize uint32
 	MaxHeaderListSize uint32
 
 
+	// StrictMaxConcurrentStreams controls whether the server's
+	// SETTINGS_MAX_CONCURRENT_STREAMS should be respected
+	// globally. If false, new TCP connections are created to the
+	// server as needed to keep each under the per-connection
+	// SETTINGS_MAX_CONCURRENT_STREAMS limit. If true, the
+	// server's SETTINGS_MAX_CONCURRENT_STREAMS is interpreted as
+	// a global limit and callers of RoundTrip block when needed,
+	// waiting for their turn.
+	StrictMaxConcurrentStreams bool
+
 	// t1, if non-nil, is the standard library Transport using
 	// t1, if non-nil, is the standard library Transport using
 	// this transport. Its settings are used (but not its
 	// this transport. Its settings are used (but not its
 	// RoundTrip method, etc).
 	// RoundTrip method, etc).
@@ -118,16 +130,56 @@ func (t *Transport) disableCompression() bool {
 	return t.DisableCompression || (t.t1 != nil && t.t1.DisableCompression)
 	return t.DisableCompression || (t.t1 != nil && t.t1.DisableCompression)
 }
 }
 
 
-var errTransportVersion = errors.New("http2: ConfigureTransport is only supported starting at Go 1.6")
-
 // ConfigureTransport configures a net/http HTTP/1 Transport to use HTTP/2.
 // ConfigureTransport configures a net/http HTTP/1 Transport to use HTTP/2.
-// It requires Go 1.6 or later and returns an error if the net/http package is too old
-// or if t1 has already been HTTP/2-enabled.
+// It returns an error if t1 has already been HTTP/2-enabled.
 func ConfigureTransport(t1 *http.Transport) error {
 func ConfigureTransport(t1 *http.Transport) error {
-	_, err := configureTransport(t1) // in configure_transport.go (go1.6) or not_go16.go
+	_, err := configureTransport(t1)
 	return err
 	return err
 }
 }
 
 
+func configureTransport(t1 *http.Transport) (*Transport, error) {
+	connPool := new(clientConnPool)
+	t2 := &Transport{
+		ConnPool: noDialClientConnPool{connPool},
+		t1:       t1,
+	}
+	connPool.t = t2
+	if err := registerHTTPSProtocol(t1, noDialH2RoundTripper{t2}); err != nil {
+		return nil, err
+	}
+	if t1.TLSClientConfig == nil {
+		t1.TLSClientConfig = new(tls.Config)
+	}
+	if !strSliceContains(t1.TLSClientConfig.NextProtos, "h2") {
+		t1.TLSClientConfig.NextProtos = append([]string{"h2"}, t1.TLSClientConfig.NextProtos...)
+	}
+	if !strSliceContains(t1.TLSClientConfig.NextProtos, "http/1.1") {
+		t1.TLSClientConfig.NextProtos = append(t1.TLSClientConfig.NextProtos, "http/1.1")
+	}
+	upgradeFn := func(authority string, c *tls.Conn) http.RoundTripper {
+		addr := authorityAddr("https", authority)
+		if used, err := connPool.addConnIfNeeded(addr, t2, c); err != nil {
+			go c.Close()
+			return erringRoundTripper{err}
+		} else if !used {
+			// Turns out we don't need this c.
+			// For example, two goroutines made requests to the same host
+			// at the same time, both kicking off TCP dials. (since protocol
+			// was unknown)
+			go c.Close()
+		}
+		return t2
+	}
+	if m := t1.TLSNextProto; len(m) == 0 {
+		t1.TLSNextProto = map[string]func(string, *tls.Conn) http.RoundTripper{
+			"h2": upgradeFn,
+		}
+	} else {
+		m["h2"] = upgradeFn
+	}
+	return t2, nil
+}
+
 func (t *Transport) connPool() ClientConnPool {
 func (t *Transport) connPool() ClientConnPool {
 	t.connPoolOnce.Do(t.initConnPool)
 	t.connPoolOnce.Do(t.initConnPool)
 	return t.connPoolOrDef
 	return t.connPoolOrDef
@@ -192,7 +244,7 @@ type ClientConn struct {
 type clientStream struct {
 type clientStream struct {
 	cc            *ClientConn
 	cc            *ClientConn
 	req           *http.Request
 	req           *http.Request
-	trace         *clientTrace // or nil
+	trace         *httptrace.ClientTrace // or nil
 	ID            uint32
 	ID            uint32
 	resc          chan resAndError
 	resc          chan resAndError
 	bufPipe       pipe // buffered pipe with the flow-controlled response payload
 	bufPipe       pipe // buffered pipe with the flow-controlled response payload
@@ -226,7 +278,7 @@ type clientStream struct {
 // channel to be signaled. A non-nil error is returned only if the request was
 // channel to be signaled. A non-nil error is returned only if the request was
 // canceled.
 // canceled.
 func awaitRequestCancel(req *http.Request, done <-chan struct{}) error {
 func awaitRequestCancel(req *http.Request, done <-chan struct{}) error {
-	ctx := reqContext(req)
+	ctx := req.Context()
 	if req.Cancel == nil && ctx.Done() == nil {
 	if req.Cancel == nil && ctx.Done() == nil {
 		return nil
 		return nil
 	}
 	}
@@ -401,8 +453,8 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res
 				select {
 				select {
 				case <-time.After(time.Second * time.Duration(backoff)):
 				case <-time.After(time.Second * time.Duration(backoff)):
 					continue
 					continue
-				case <-reqContext(req).Done():
-					return nil, reqContext(req).Err()
+				case <-req.Context().Done():
+					return nil, req.Context().Err()
 				}
 				}
 			}
 			}
 		}
 		}
@@ -439,16 +491,15 @@ func shouldRetryRequest(req *http.Request, err error, afterBodyWrite bool) (*htt
 	}
 	}
 	// If the Body is nil (or http.NoBody), it's safe to reuse
 	// If the Body is nil (or http.NoBody), it's safe to reuse
 	// this request and its Body.
 	// this request and its Body.
-	if req.Body == nil || reqBodyIsNoBody(req.Body) {
+	if req.Body == nil || req.Body == http.NoBody {
 		return req, nil
 		return req, nil
 	}
 	}
 
 
 	// If the request body can be reset back to its original
 	// If the request body can be reset back to its original
 	// state via the optional req.GetBody, do that.
 	// state via the optional req.GetBody, do that.
-	getBody := reqGetBody(req) // Go 1.8: getBody = req.GetBody
-	if getBody != nil {
+	if req.GetBody != nil {
 		// TODO: consider a req.Body.Close here? or audit that all caller paths do?
 		// TODO: consider a req.Body.Close here? or audit that all caller paths do?
-		body, err := getBody()
+		body, err := req.GetBody()
 		if err != nil {
 		if err != nil {
 			return nil, err
 			return nil, err
 		}
 		}
@@ -494,7 +545,7 @@ func (t *Transport) dialClientConn(addr string, singleUse bool) (*ClientConn, er
 func (t *Transport) newTLSConfig(host string) *tls.Config {
 func (t *Transport) newTLSConfig(host string) *tls.Config {
 	cfg := new(tls.Config)
 	cfg := new(tls.Config)
 	if t.TLSClientConfig != nil {
 	if t.TLSClientConfig != nil {
-		*cfg = *cloneTLSConfig(t.TLSClientConfig)
+		*cfg = *t.TLSClientConfig.Clone()
 	}
 	}
 	if !strSliceContains(cfg.NextProtos, NextProtoTLS) {
 	if !strSliceContains(cfg.NextProtos, NextProtoTLS) {
 		cfg.NextProtos = append([]string{NextProtoTLS}, cfg.NextProtos...)
 		cfg.NextProtos = append([]string{NextProtoTLS}, cfg.NextProtos...)
@@ -545,7 +596,7 @@ func (t *Transport) expectContinueTimeout() time.Duration {
 	if t.t1 == nil {
 	if t.t1 == nil {
 		return 0
 		return 0
 	}
 	}
-	return transportExpectContinueTimeout(t.t1)
+	return t.t1.ExpectContinueTimeout
 }
 }
 
 
 func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) {
 func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) {
@@ -670,8 +721,19 @@ func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) {
 	if cc.singleUse && cc.nextStreamID > 1 {
 	if cc.singleUse && cc.nextStreamID > 1 {
 		return
 		return
 	}
 	}
-	st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing &&
-		int64(cc.nextStreamID)+int64(cc.pendingRequests) < math.MaxInt32
+	var maxConcurrentOkay bool
+	if cc.t.StrictMaxConcurrentStreams {
+		// We'll tell the caller we can take a new request to
+		// prevent the caller from dialing a new TCP
+		// connection, but then we'll block later before
+		// writing it.
+		maxConcurrentOkay = true
+	} else {
+		maxConcurrentOkay = int64(len(cc.streams)+1) < int64(cc.maxConcurrentStreams)
+	}
+
+	st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && maxConcurrentOkay &&
+		int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32
 	st.freshConn = cc.nextStreamID == 1 && st.canTakeNewRequest
 	st.freshConn = cc.nextStreamID == 1 && st.canTakeNewRequest
 	return
 	return
 }
 }
@@ -711,8 +773,7 @@ func (cc *ClientConn) closeIfIdle() {
 var shutdownEnterWaitStateHook = func() {}
 var shutdownEnterWaitStateHook = func() {}
 
 
 // Shutdown gracefully close the client connection, waiting for running streams to complete.
 // Shutdown gracefully close the client connection, waiting for running streams to complete.
-// Public implementation is in go17.go and not_go17.go
-func (cc *ClientConn) shutdown(ctx contextContext) error {
+func (cc *ClientConn) Shutdown(ctx context.Context) error {
 	if err := cc.sendGoAway(); err != nil {
 	if err := cc.sendGoAway(); err != nil {
 		return err
 		return err
 	}
 	}
@@ -882,7 +943,7 @@ func checkConnHeaders(req *http.Request) error {
 // req.ContentLength, where 0 actually means zero (not unknown) and -1
 // req.ContentLength, where 0 actually means zero (not unknown) and -1
 // means unknown.
 // means unknown.
 func actualContentLength(req *http.Request) int64 {
 func actualContentLength(req *http.Request) int64 {
-	if req.Body == nil || reqBodyIsNoBody(req.Body) {
+	if req.Body == nil || req.Body == http.NoBody {
 		return 0
 		return 0
 	}
 	}
 	if req.ContentLength != 0 {
 	if req.ContentLength != 0 {
@@ -952,7 +1013,7 @@ func (cc *ClientConn) roundTrip(req *http.Request) (res *http.Response, gotErrAf
 
 
 	cs := cc.newStream()
 	cs := cc.newStream()
 	cs.req = req
 	cs.req = req
-	cs.trace = requestTrace(req)
+	cs.trace = httptrace.ContextClientTrace(req.Context())
 	cs.requestedGzip = requestedGzip
 	cs.requestedGzip = requestedGzip
 	bodyWriter := cc.t.getBodyWriterState(cs, body)
 	bodyWriter := cc.t.getBodyWriterState(cs, body)
 	cs.on100 = bodyWriter.on100
 	cs.on100 = bodyWriter.on100
@@ -990,7 +1051,7 @@ func (cc *ClientConn) roundTrip(req *http.Request) (res *http.Response, gotErrAf
 
 
 	readLoopResCh := cs.resc
 	readLoopResCh := cs.resc
 	bodyWritten := false
 	bodyWritten := false
-	ctx := reqContext(req)
+	ctx := req.Context()
 
 
 	handleReadLoopResponse := func(re resAndError) (*http.Response, bool, error) {
 	handleReadLoopResponse := func(re resAndError) (*http.Response, bool, error) {
 		res := re.res
 		res := re.res
@@ -1060,6 +1121,7 @@ func (cc *ClientConn) roundTrip(req *http.Request) (res *http.Response, gotErrAf
 			default:
 			default:
 			}
 			}
 			if err != nil {
 			if err != nil {
+				cc.forgetStreamID(cs.ID)
 				return nil, cs.getStartedWrite(), err
 				return nil, cs.getStartedWrite(), err
 			}
 			}
 			bodyWritten = true
 			bodyWritten = true
@@ -1181,6 +1243,7 @@ func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) (
 			sawEOF = true
 			sawEOF = true
 			err = nil
 			err = nil
 		} else if err != nil {
 		} else if err != nil {
+			cc.writeStreamReset(cs.ID, ErrCodeCancel, err)
 			return err
 			return err
 		}
 		}
 
 
@@ -1348,7 +1411,11 @@ func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trail
 		// followed by the query production (see Sections 3.3 and 3.4 of
 		// followed by the query production (see Sections 3.3 and 3.4 of
 		// [RFC3986]).
 		// [RFC3986]).
 		f(":authority", host)
 		f(":authority", host)
-		f(":method", req.Method)
+		m := req.Method
+		if m == "" {
+			m = http.MethodGet
+		}
+		f(":method", m)
 		if req.Method != "CONNECT" {
 		if req.Method != "CONNECT" {
 			f(":path", path)
 			f(":path", path)
 			f(":scheme", req.URL.Scheme)
 			f(":scheme", req.URL.Scheme)
@@ -1416,7 +1483,7 @@ func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trail
 		return nil, errRequestHeaderListSize
 		return nil, errRequestHeaderListSize
 	}
 	}
 
 
-	trace := requestTrace(req)
+	trace := httptrace.ContextClientTrace(req.Context())
 	traceHeaders := traceHasWroteHeaderField(trace)
 	traceHeaders := traceHasWroteHeaderField(trace)
 
 
 	// Header list size is ok. Write the headers.
 	// Header list size is ok. Write the headers.
@@ -1839,7 +1906,7 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra
 		res.Header.Del("Content-Length")
 		res.Header.Del("Content-Length")
 		res.ContentLength = -1
 		res.ContentLength = -1
 		res.Body = &gzipReader{body: res.Body}
 		res.Body = &gzipReader{body: res.Body}
-		setResponseUncompressed(res)
+		res.Uncompressed = true
 	}
 	}
 	return res, nil
 	return res, nil
 }
 }
@@ -2216,8 +2283,7 @@ func (rl *clientConnReadLoop) processResetStream(f *RSTStreamFrame) error {
 }
 }
 
 
 // Ping sends a PING frame to the server and waits for the ack.
 // Ping sends a PING frame to the server and waits for the ack.
-// Public implementation is in go17.go and not_go17.go
-func (cc *ClientConn) ping(ctx contextContext) error {
+func (cc *ClientConn) Ping(ctx context.Context) error {
 	c := make(chan struct{})
 	c := make(chan struct{})
 	// Generate a random payload
 	// Generate a random payload
 	var p [8]byte
 	var p [8]byte
@@ -2451,3 +2517,91 @@ func (s bodyWriterState) scheduleBodyWrite() {
 func isConnectionCloseRequest(req *http.Request) bool {
 func isConnectionCloseRequest(req *http.Request) bool {
 	return req.Close || httpguts.HeaderValuesContainsToken(req.Header["Connection"], "close")
 	return req.Close || httpguts.HeaderValuesContainsToken(req.Header["Connection"], "close")
 }
 }
+
+// registerHTTPSProtocol calls Transport.RegisterProtocol but
+// converting panics into errors.
+func registerHTTPSProtocol(t *http.Transport, rt noDialH2RoundTripper) (err error) {
+	defer func() {
+		if e := recover(); e != nil {
+			err = fmt.Errorf("%v", e)
+		}
+	}()
+	t.RegisterProtocol("https", rt)
+	return nil
+}
+
+// noDialH2RoundTripper is a RoundTripper which only tries to complete the request
+// if there's already has a cached connection to the host.
+// (The field is exported so it can be accessed via reflect from net/http; tested
+// by TestNoDialH2RoundTripperType)
+type noDialH2RoundTripper struct{ *Transport }
+
+func (rt noDialH2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
+	res, err := rt.Transport.RoundTrip(req)
+	if isNoCachedConnError(err) {
+		return nil, http.ErrSkipAltProtocol
+	}
+	return res, err
+}
+
+func (t *Transport) idleConnTimeout() time.Duration {
+	if t.t1 != nil {
+		return t.t1.IdleConnTimeout
+	}
+	return 0
+}
+
+func traceGetConn(req *http.Request, hostPort string) {
+	trace := httptrace.ContextClientTrace(req.Context())
+	if trace == nil || trace.GetConn == nil {
+		return
+	}
+	trace.GetConn(hostPort)
+}
+
+func traceGotConn(req *http.Request, cc *ClientConn) {
+	trace := httptrace.ContextClientTrace(req.Context())
+	if trace == nil || trace.GotConn == nil {
+		return
+	}
+	ci := httptrace.GotConnInfo{Conn: cc.tconn}
+	cc.mu.Lock()
+	ci.Reused = cc.nextStreamID > 1
+	ci.WasIdle = len(cc.streams) == 0 && ci.Reused
+	if ci.WasIdle && !cc.lastActive.IsZero() {
+		ci.IdleTime = time.Now().Sub(cc.lastActive)
+	}
+	cc.mu.Unlock()
+
+	trace.GotConn(ci)
+}
+
+func traceWroteHeaders(trace *httptrace.ClientTrace) {
+	if trace != nil && trace.WroteHeaders != nil {
+		trace.WroteHeaders()
+	}
+}
+
+func traceGot100Continue(trace *httptrace.ClientTrace) {
+	if trace != nil && trace.Got100Continue != nil {
+		trace.Got100Continue()
+	}
+}
+
+func traceWait100Continue(trace *httptrace.ClientTrace) {
+	if trace != nil && trace.Wait100Continue != nil {
+		trace.Wait100Continue()
+	}
+}
+
+func traceWroteRequest(trace *httptrace.ClientTrace, err error) {
+	if trace != nil && trace.WroteRequest != nil {
+		trace.WroteRequest(httptrace.WroteRequestInfo{Err: err})
+	}
+}
+
+func traceFirstResponseByte(trace *httptrace.ClientTrace) {
+	if trace != nil && trace.GotFirstResponseByte != nil {
+		trace.GotFirstResponseByte()
+	}
+}

+ 2 - 2
vendor/golang.org/x/net/http2/write.go

@@ -199,7 +199,7 @@ func (w *writeResHeaders) staysWithinBuffer(max int) bool {
 	// TODO: this is a common one. It'd be nice to return true
 	// TODO: this is a common one. It'd be nice to return true
 	// here and get into the fast path if we could be clever and
 	// here and get into the fast path if we could be clever and
 	// calculate the size fast enough, or at least a conservative
 	// calculate the size fast enough, or at least a conservative
-	// uppper bound that usually fires. (Maybe if w.h and
+	// upper bound that usually fires. (Maybe if w.h and
 	// w.trailers are nil, so we don't need to enumerate it.)
 	// w.trailers are nil, so we don't need to enumerate it.)
 	// Otherwise I'm afraid that just calculating the length to
 	// Otherwise I'm afraid that just calculating the length to
 	// answer this question would be slower than the ~2µs benefit.
 	// answer this question would be slower than the ~2µs benefit.
@@ -329,7 +329,7 @@ func (wu writeWindowUpdate) writeFrame(ctx writeContext) error {
 }
 }
 
 
 // encodeHeaders encodes an http.Header. If keys is not nil, then (k, h[k])
 // encodeHeaders encodes an http.Header. If keys is not nil, then (k, h[k])
-// is encoded only only if k is in keys.
+// is encoded only if k is in keys.
 func encodeHeaders(enc *hpack.Encoder, h http.Header, keys []string) {
 func encodeHeaders(enc *hpack.Encoder, h http.Header, keys []string) {
 	if keys == nil {
 	if keys == nil {
 		sorter := sorterPool.Get().(*sorter)
 		sorter := sorterPool.Get().(*sorter)

+ 7 - 0
vendor/golang.org/x/net/internal/socket/empty.s

@@ -0,0 +1,7 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin,go1.12
+
+// This exists solely so we can linkname in symbols from syscall.

+ 0 - 2
vendor/golang.org/x/net/internal/socket/rawconn.go

@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build go1.9
-
 package socket
 package socket
 
 
 import (
 import (

+ 0 - 1
vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go

@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build go1.9
 // +build linux
 // +build linux
 
 
 package socket
 package socket

+ 0 - 1
vendor/golang.org/x/net/internal/socket/rawconn_msg.go

@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build go1.9
 // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
 // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
 
 
 package socket
 package socket

+ 2 - 5
vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go

@@ -2,17 +2,14 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build go1.9
 // +build !linux
 // +build !linux
 
 
 package socket
 package socket
 
 
-import "errors"
-
 func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) {
 func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }
 
 
 func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) {
 func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }

+ 2 - 5
vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go

@@ -2,17 +2,14 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build go1.9
 // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows
 // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows
 
 
 package socket
 package socket
 
 
-import "errors"
-
 func (c *Conn) recvMsg(m *Message, flags int) error {
 func (c *Conn) recvMsg(m *Message, flags int) error {
-	return errors.New("not implemented")
+	return errNotImplemented
 }
 }
 
 
 func (c *Conn) sendMsg(m *Message, flags int) error {
 func (c *Conn) sendMsg(m *Message, flags int) error {
-	return errors.New("not implemented")
+	return errNotImplemented
 }
 }

+ 0 - 25
vendor/golang.org/x/net/internal/socket/rawconn_stub.go

@@ -1,25 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.9
-
-package socket
-
-import "errors"
-
-func (c *Conn) recvMsg(m *Message, flags int) error {
-	return errors.New("not implemented")
-}
-
-func (c *Conn) sendMsg(m *Message, flags int) error {
-	return errors.New("not implemented")
-}
-
-func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) {
-	return 0, errors.New("not implemented")
-}
-
-func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) {
-	return 0, errors.New("not implemented")
-}

+ 0 - 62
vendor/golang.org/x/net/internal/socket/reflect.go

@@ -1,62 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.9
-
-package socket
-
-import (
-	"errors"
-	"net"
-	"os"
-	"reflect"
-	"runtime"
-)
-
-// A Conn represents a raw connection.
-type Conn struct {
-	c net.Conn
-}
-
-// NewConn returns a new raw connection.
-func NewConn(c net.Conn) (*Conn, error) {
-	return &Conn{c: c}, nil
-}
-
-func (o *Option) get(c *Conn, b []byte) (int, error) {
-	s, err := socketOf(c.c)
-	if err != nil {
-		return 0, err
-	}
-	n, err := getsockopt(s, o.Level, o.Name, b)
-	return n, os.NewSyscallError("getsockopt", err)
-}
-
-func (o *Option) set(c *Conn, b []byte) error {
-	s, err := socketOf(c.c)
-	if err != nil {
-		return err
-	}
-	return os.NewSyscallError("setsockopt", setsockopt(s, o.Level, o.Name, b))
-}
-
-func socketOf(c net.Conn) (uintptr, error) {
-	switch c.(type) {
-	case *net.TCPConn, *net.UDPConn, *net.IPConn:
-		v := reflect.ValueOf(c)
-		switch e := v.Elem(); e.Kind() {
-		case reflect.Struct:
-			fd := e.FieldByName("conn").FieldByName("fd")
-			switch e := fd.Elem(); e.Kind() {
-			case reflect.Struct:
-				sysfd := e.FieldByName("sysfd")
-				if runtime.GOOS == "windows" {
-					return uintptr(sysfd.Uint()), nil
-				}
-				return uintptr(sysfd.Int()), nil
-			}
-		}
-	}
-	return 0, errors.New("invalid type")
-}

+ 3 - 0
vendor/golang.org/x/net/internal/socket/socket.go

@@ -9,9 +9,12 @@ package socket // import "golang.org/x/net/internal/socket"
 import (
 import (
 	"errors"
 	"errors"
 	"net"
 	"net"
+	"runtime"
 	"unsafe"
 	"unsafe"
 )
 )
 
 
+var errNotImplemented = errors.New("not implemented on " + runtime.GOOS + "/" + runtime.GOARCH)
+
 // An Option represents a sticky socket option.
 // An Option represents a sticky socket option.
 type Option struct {
 type Option struct {
 	Level int // level
 	Level int // level

+ 1 - 1
vendor/golang.org/x/net/internal/socket/sys.go

@@ -29,5 +29,5 @@ func init() {
 }
 }
 
 
 func roundup(l int) int {
 func roundup(l int) int {
-	return (l + kernelAlign - 1) & ^(kernelAlign - 1)
+	return (l + kernelAlign - 1) &^ (kernelAlign - 1)
 }
 }

+ 2 - 4
vendor/golang.org/x/net/internal/socket/sys_bsd.go

@@ -6,12 +6,10 @@
 
 
 package socket
 package socket
 
 
-import "errors"
-
 func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
 func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }
 
 
 func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
 func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }

+ 7 - 1
vendor/golang.org/x/net/internal/socket/sys_bsdvar.go

@@ -6,9 +6,15 @@
 
 
 package socket
 package socket
 
 
-import "unsafe"
+import (
+	"runtime"
+	"unsafe"
+)
 
 
 func probeProtocolStack() int {
 func probeProtocolStack() int {
+	if (runtime.GOOS == "netbsd" || runtime.GOOS == "openbsd") && runtime.GOARCH == "arm" {
+		return 8
+	}
 	var p uintptr
 	var p uintptr
 	return int(unsafe.Sizeof(p))
 	return int(unsafe.Sizeof(p))
 }
 }

+ 33 - 0
vendor/golang.org/x/net/internal/socket/sys_go1_11_darwin.go

@@ -0,0 +1,33 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build !go1.12
+
+package socket
+
+import (
+	"syscall"
+	"unsafe"
+)
+
+func getsockopt(s uintptr, level, name int, b []byte) (int, error) {
+	l := uint32(len(b))
+	_, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0)
+	return int(l), errnoErr(errno)
+}
+
+func setsockopt(s uintptr, level, name int, b []byte) error {
+	_, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0)
+	return errnoErr(errno)
+}
+
+func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
+	n, _, errno := syscall.Syscall(syscall.SYS_RECVMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags))
+	return int(n), errnoErr(errno)
+}
+
+func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
+	n, _, errno := syscall.Syscall(syscall.SYS_SENDMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags))
+	return int(n), errnoErr(errno)
+}

+ 42 - 0
vendor/golang.org/x/net/internal/socket/sys_go1_12_darwin.go

@@ -0,0 +1,42 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build go1.12
+
+package socket
+
+import (
+	"syscall"
+	"unsafe"
+)
+
+//go:linkname syscall_getsockopt syscall.getsockopt
+func syscall_getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *uint32) error
+
+func getsockopt(s uintptr, level, name int, b []byte) (int, error) {
+	l := uint32(len(b))
+	err := syscall_getsockopt(int(s), level, name, unsafe.Pointer(&b[0]), &l)
+	return int(l), err
+}
+
+//go:linkname syscall_setsockopt syscall.setsockopt
+func syscall_setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) error
+
+func setsockopt(s uintptr, level, name int, b []byte) error {
+	return syscall_setsockopt(int(s), level, name, unsafe.Pointer(&b[0]), uintptr(len(b)))
+}
+
+//go:linkname syscall_recvmsg syscall.recvmsg
+func syscall_recvmsg(s int, msg *syscall.Msghdr, flags int) (n int, err error)
+
+func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
+	return syscall_recvmsg(int(s), (*syscall.Msghdr)(unsafe.Pointer(h)), flags)
+}
+
+//go:linkname syscall_sendmsg syscall.sendmsg
+func syscall_sendmsg(s int, msg *syscall.Msghdr, flags int) (n int, err error)
+
+func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
+	return syscall_sendmsg(int(s), (*syscall.Msghdr)(unsafe.Pointer(h)), flags)
+}

+ 26 - 11
vendor/golang.org/x/net/internal/socket/sys_posix.go

@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build go1.9
 // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
 // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
 
 
 package socket
 package socket
@@ -121,18 +120,21 @@ var zoneCache = ipv6ZoneCache{
 	toName:  make(map[int]string),
 	toName:  make(map[int]string),
 }
 }
 
 
-func (zc *ipv6ZoneCache) update(ift []net.Interface) {
+// update refreshes the network interface information if the cache was last
+// updated more than 1 minute ago, or if force is set. It returns whether the
+// cache was updated.
+func (zc *ipv6ZoneCache) update(ift []net.Interface, force bool) (updated bool) {
 	zc.Lock()
 	zc.Lock()
 	defer zc.Unlock()
 	defer zc.Unlock()
 	now := time.Now()
 	now := time.Now()
-	if zc.lastFetched.After(now.Add(-60 * time.Second)) {
-		return
+	if !force && zc.lastFetched.After(now.Add(-60*time.Second)) {
+		return false
 	}
 	}
 	zc.lastFetched = now
 	zc.lastFetched = now
 	if len(ift) == 0 {
 	if len(ift) == 0 {
 		var err error
 		var err error
 		if ift, err = net.Interfaces(); err != nil {
 		if ift, err = net.Interfaces(); err != nil {
-			return
+			return false
 		}
 		}
 	}
 	}
 	zc.toIndex = make(map[string]int, len(ift))
 	zc.toIndex = make(map[string]int, len(ift))
@@ -143,25 +145,38 @@ func (zc *ipv6ZoneCache) update(ift []net.Interface) {
 			zc.toName[ifi.Index] = ifi.Name
 			zc.toName[ifi.Index] = ifi.Name
 		}
 		}
 	}
 	}
+	return true
 }
 }
 
 
 func (zc *ipv6ZoneCache) name(zone int) string {
 func (zc *ipv6ZoneCache) name(zone int) string {
-	zoneCache.update(nil)
+	updated := zoneCache.update(nil, false)
 	zoneCache.RLock()
 	zoneCache.RLock()
-	defer zoneCache.RUnlock()
 	name, ok := zoneCache.toName[zone]
 	name, ok := zoneCache.toName[zone]
-	if !ok {
+	zoneCache.RUnlock()
+	if !ok && !updated {
+		zoneCache.update(nil, true)
+		zoneCache.RLock()
+		name, ok = zoneCache.toName[zone]
+		zoneCache.RUnlock()
+	}
+	if !ok { // last resort
 		name = strconv.Itoa(zone)
 		name = strconv.Itoa(zone)
 	}
 	}
 	return name
 	return name
 }
 }
 
 
 func (zc *ipv6ZoneCache) index(zone string) int {
 func (zc *ipv6ZoneCache) index(zone string) int {
-	zoneCache.update(nil)
+	updated := zoneCache.update(nil, false)
 	zoneCache.RLock()
 	zoneCache.RLock()
-	defer zoneCache.RUnlock()
 	index, ok := zoneCache.toIndex[zone]
 	index, ok := zoneCache.toIndex[zone]
-	if !ok {
+	zoneCache.RUnlock()
+	if !ok && !updated {
+		zoneCache.update(nil, true)
+		zoneCache.RLock()
+		index, ok = zoneCache.toIndex[zone]
+		zoneCache.RUnlock()
+	}
+	if !ok { // last resort
 		index, _ = strconv.Atoi(zone)
 		index, _ = strconv.Atoi(zone)
 	}
 	}
 	return index
 	return index

+ 2 - 3
vendor/golang.org/x/net/internal/socket/sys_solaris.go

@@ -5,7 +5,6 @@
 package socket
 package socket
 
 
 import (
 import (
-	"errors"
 	"runtime"
 	"runtime"
 	"syscall"
 	"syscall"
 	"unsafe"
 	"unsafe"
@@ -63,9 +62,9 @@ func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
 }
 }
 
 
 func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
 func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }
 
 
 func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
 func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }

+ 7 - 8
vendor/golang.org/x/net/internal/socket/sys_stub.go

@@ -7,7 +7,6 @@
 package socket
 package socket
 
 
 import (
 import (
-	"errors"
 	"net"
 	"net"
 	"runtime"
 	"runtime"
 	"unsafe"
 	"unsafe"
@@ -36,29 +35,29 @@ func marshalInetAddr(ip net.IP, port int, zone string) []byte {
 }
 }
 
 
 func parseInetAddr(b []byte, network string) (net.Addr, error) {
 func parseInetAddr(b []byte, network string) (net.Addr, error) {
-	return nil, errors.New("not implemented")
+	return nil, errNotImplemented
 }
 }
 
 
 func getsockopt(s uintptr, level, name int, b []byte) (int, error) {
 func getsockopt(s uintptr, level, name int, b []byte) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }
 
 
 func setsockopt(s uintptr, level, name int, b []byte) error {
 func setsockopt(s uintptr, level, name int, b []byte) error {
-	return errors.New("not implemented")
+	return errNotImplemented
 }
 }
 
 
 func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
 func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }
 
 
 func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
 func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }
 
 
 func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
 func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }
 
 
 func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
 func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }

+ 1 - 1
vendor/golang.org/x/net/internal/socket/sys_unix.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build darwin dragonfly freebsd linux,!s390x,!386 netbsd openbsd
+// +build dragonfly freebsd linux,!s390x,!386 netbsd openbsd
 
 
 package socket
 package socket
 
 

+ 4 - 5
vendor/golang.org/x/net/internal/socket/sys_windows.go

@@ -5,7 +5,6 @@
 package socket
 package socket
 
 
 import (
 import (
-	"errors"
 	"syscall"
 	"syscall"
 	"unsafe"
 	"unsafe"
 )
 )
@@ -54,17 +53,17 @@ func setsockopt(s uintptr, level, name int, b []byte) error {
 }
 }
 
 
 func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
 func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }
 
 
 func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
 func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }
 
 
 func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
 func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }
 
 
 func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
 func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
-	return 0, errors.New("not implemented")
+	return 0, errNotImplemented
 }
 }

+ 1 - 0
vendor/golang.org/x/net/internal/socks/socks.go

@@ -224,6 +224,7 @@ func (d *Dialer) Dial(network, address string) (net.Conn, error) {
 		return nil, &net.OpError{Op: d.cmd.String(), Net: network, Source: proxy, Addr: dst, Err: err}
 		return nil, &net.OpError{Op: d.cmd.String(), Net: network, Source: proxy, Addr: dst, Err: err}
 	}
 	}
 	if _, err := d.DialWithConn(context.Background(), c, network, address); err != nil {
 	if _, err := d.DialWithConn(context.Background(), c, network, address); err != nil {
+		c.Close()
 		return nil, err
 		return nil, err
 	}
 	}
 	return c, nil
 	return c, nil

+ 6 - 2
vendor/golang.org/x/net/ipv4/batch.go

@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build go1.9
-
 package ipv4
 package ipv4
 
 
 import (
 import (
@@ -91,6 +89,9 @@ func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
 			n = 0
 			n = 0
 			err = &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
 			err = &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
 		}
 		}
+		if compatFreeBSD32 && ms[0].NN > 0 {
+			adjustFreeBSD32(&ms[0])
+		}
 		return n, err
 		return n, err
 	}
 	}
 }
 }
@@ -154,6 +155,9 @@ func (c *packetHandler) ReadBatch(ms []Message, flags int) (int, error) {
 			n = 0
 			n = 0
 			err = &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
 			err = &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
 		}
 		}
+		if compatFreeBSD32 && ms[0].NN > 0 {
+			adjustFreeBSD32(&ms[0])
+		}
 		return n, err
 		return n, err
 	}
 	}
 }
 }

+ 1 - 1
vendor/golang.org/x/net/ipv4/control_stub.go

@@ -9,5 +9,5 @@ package ipv4
 import "golang.org/x/net/internal/socket"
 import "golang.org/x/net/internal/socket"
 
 
 func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
 func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 2 - 6
vendor/golang.org/x/net/ipv4/control_windows.go

@@ -4,13 +4,9 @@
 
 
 package ipv4
 package ipv4
 
 
-import (
-	"syscall"
-
-	"golang.org/x/net/internal/socket"
-)
+import "golang.org/x/net/internal/socket"
 
 
 func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
 func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
 	// TODO(mikio): implement this
 	// TODO(mikio): implement this
-	return syscall.EWINDOWS
+	return errNotImplemented
 }
 }

+ 15 - 15
vendor/golang.org/x/net/ipv4/dgramopt.go

@@ -18,7 +18,7 @@ func (c *dgramOpt) MulticastTTL() (int, error) {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastTTL]
 	so, ok := sockOpts[ssoMulticastTTL]
 	if !ok {
 	if !ok {
-		return 0, errOpNoSupport
+		return 0, errNotImplemented
 	}
 	}
 	return so.GetInt(c.Conn)
 	return so.GetInt(c.Conn)
 }
 }
@@ -31,7 +31,7 @@ func (c *dgramOpt) SetMulticastTTL(ttl int) error {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastTTL]
 	so, ok := sockOpts[ssoMulticastTTL]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.SetInt(c.Conn, ttl)
 	return so.SetInt(c.Conn, ttl)
 }
 }
@@ -44,7 +44,7 @@ func (c *dgramOpt) MulticastInterface() (*net.Interface, error) {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastInterface]
 	so, ok := sockOpts[ssoMulticastInterface]
 	if !ok {
 	if !ok {
-		return nil, errOpNoSupport
+		return nil, errNotImplemented
 	}
 	}
 	return so.getMulticastInterface(c.Conn)
 	return so.getMulticastInterface(c.Conn)
 }
 }
@@ -57,7 +57,7 @@ func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastInterface]
 	so, ok := sockOpts[ssoMulticastInterface]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.setMulticastInterface(c.Conn, ifi)
 	return so.setMulticastInterface(c.Conn, ifi)
 }
 }
@@ -70,7 +70,7 @@ func (c *dgramOpt) MulticastLoopback() (bool, error) {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastLoopback]
 	so, ok := sockOpts[ssoMulticastLoopback]
 	if !ok {
 	if !ok {
-		return false, errOpNoSupport
+		return false, errNotImplemented
 	}
 	}
 	on, err := so.GetInt(c.Conn)
 	on, err := so.GetInt(c.Conn)
 	if err != nil {
 	if err != nil {
@@ -87,7 +87,7 @@ func (c *dgramOpt) SetMulticastLoopback(on bool) error {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastLoopback]
 	so, ok := sockOpts[ssoMulticastLoopback]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.SetInt(c.Conn, boolint(on))
 	return so.SetInt(c.Conn, boolint(on))
 }
 }
@@ -107,7 +107,7 @@ func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {
 	}
 	}
 	so, ok := sockOpts[ssoJoinGroup]
 	so, ok := sockOpts[ssoJoinGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP4(group)
 	grp := netAddrToIP4(group)
 	if grp == nil {
 	if grp == nil {
@@ -125,7 +125,7 @@ func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {
 	}
 	}
 	so, ok := sockOpts[ssoLeaveGroup]
 	so, ok := sockOpts[ssoLeaveGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP4(group)
 	grp := netAddrToIP4(group)
 	if grp == nil {
 	if grp == nil {
@@ -146,7 +146,7 @@ func (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net
 	}
 	}
 	so, ok := sockOpts[ssoJoinSourceGroup]
 	so, ok := sockOpts[ssoJoinSourceGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP4(group)
 	grp := netAddrToIP4(group)
 	if grp == nil {
 	if grp == nil {
@@ -167,7 +167,7 @@ func (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source ne
 	}
 	}
 	so, ok := sockOpts[ssoLeaveSourceGroup]
 	so, ok := sockOpts[ssoLeaveSourceGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP4(group)
 	grp := netAddrToIP4(group)
 	if grp == nil {
 	if grp == nil {
@@ -189,7 +189,7 @@ func (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source
 	}
 	}
 	so, ok := sockOpts[ssoBlockSourceGroup]
 	so, ok := sockOpts[ssoBlockSourceGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP4(group)
 	grp := netAddrToIP4(group)
 	if grp == nil {
 	if grp == nil {
@@ -210,7 +210,7 @@ func (c *dgramOpt) IncludeSourceSpecificGroup(ifi *net.Interface, group, source
 	}
 	}
 	so, ok := sockOpts[ssoUnblockSourceGroup]
 	so, ok := sockOpts[ssoUnblockSourceGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP4(group)
 	grp := netAddrToIP4(group)
 	if grp == nil {
 	if grp == nil {
@@ -231,7 +231,7 @@ func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {
 	}
 	}
 	so, ok := sockOpts[ssoICMPFilter]
 	so, ok := sockOpts[ssoICMPFilter]
 	if !ok {
 	if !ok {
-		return nil, errOpNoSupport
+		return nil, errNotImplemented
 	}
 	}
 	return so.getICMPFilter(c.Conn)
 	return so.getICMPFilter(c.Conn)
 }
 }
@@ -244,7 +244,7 @@ func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {
 	}
 	}
 	so, ok := sockOpts[ssoICMPFilter]
 	so, ok := sockOpts[ssoICMPFilter]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.setICMPFilter(c.Conn, f)
 	return so.setICMPFilter(c.Conn, f)
 }
 }
@@ -258,7 +258,7 @@ func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error {
 	}
 	}
 	so, ok := sockOpts[ssoAttachFilter]
 	so, ok := sockOpts[ssoAttachFilter]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.setBPF(c.Conn, filter)
 	return so.setBPF(c.Conn, filter)
 }
 }

+ 4 - 3
vendor/golang.org/x/net/ipv4/doc.go

@@ -55,7 +55,7 @@
 // Multicasting
 // Multicasting
 //
 //
 // The options for multicasting are available for net.UDPConn and
 // The options for multicasting are available for net.UDPConn and
-// net.IPconn which are created as network connections that use the
+// net.IPConn which are created as network connections that use the
 // IPv4 transport. A few network facilities must be prepared before
 // IPv4 transport. A few network facilities must be prepared before
 // you begin multicasting, at a minimum joining network interfaces and
 // you begin multicasting, at a minimum joining network interfaces and
 // multicast groups.
 // multicast groups.
@@ -209,7 +209,7 @@
 // LeaveSourceSpecificGroup for the operation known as "include" mode,
 // LeaveSourceSpecificGroup for the operation known as "include" mode,
 //
 //
 //	ssmgroup := net.UDPAddr{IP: net.IPv4(232, 7, 8, 9)}
 //	ssmgroup := net.UDPAddr{IP: net.IPv4(232, 7, 8, 9)}
-//	ssmsource := net.UDPAddr{IP: net.IPv4(192, 168, 0, 1)})
+//	ssmsource := net.UDPAddr{IP: net.IPv4(192, 168, 0, 1)}
 //	if err := p.JoinSourceSpecificGroup(en0, &ssmgroup, &ssmsource); err != nil {
 //	if err := p.JoinSourceSpecificGroup(en0, &ssmgroup, &ssmsource); err != nil {
 //		// error handling
 //		// error handling
 //	}
 //	}
@@ -241,4 +241,5 @@
 // IncludeSourceSpecificGroup may return an error.
 // IncludeSourceSpecificGroup may return an error.
 package ipv4 // import "golang.org/x/net/ipv4"
 package ipv4 // import "golang.org/x/net/ipv4"
 
 
-// BUG(mikio): This package is not implemented on JS, NaCl and Plan 9.
+// BUG(mikio): This package is not implemented on AIX, JS, NaCl and
+// Plan 9.

+ 1 - 1
vendor/golang.org/x/net/ipv4/endpoint.go

@@ -177,7 +177,7 @@ func NewRawConn(c net.PacketConn) (*RawConn, error) {
 	}
 	}
 	so, ok := sockOpts[ssoHeaderPrepend]
 	so, ok := sockOpts[ssoHeaderPrepend]
 	if !ok {
 	if !ok {
-		return nil, errOpNoSupport
+		return nil, errNotImplemented
 	}
 	}
 	if err := so.SetInt(r.dgramOpt.Conn, boolint(true)); err != nil {
 	if err := so.SetInt(r.dgramOpt.Conn, boolint(true)); err != nil {
 		return nil, err
 		return nil, err

+ 4 - 4
vendor/golang.org/x/net/ipv4/genericopt.go

@@ -11,7 +11,7 @@ func (c *genericOpt) TOS() (int, error) {
 	}
 	}
 	so, ok := sockOpts[ssoTOS]
 	so, ok := sockOpts[ssoTOS]
 	if !ok {
 	if !ok {
-		return 0, errOpNoSupport
+		return 0, errNotImplemented
 	}
 	}
 	return so.GetInt(c.Conn)
 	return so.GetInt(c.Conn)
 }
 }
@@ -24,7 +24,7 @@ func (c *genericOpt) SetTOS(tos int) error {
 	}
 	}
 	so, ok := sockOpts[ssoTOS]
 	so, ok := sockOpts[ssoTOS]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.SetInt(c.Conn, tos)
 	return so.SetInt(c.Conn, tos)
 }
 }
@@ -36,7 +36,7 @@ func (c *genericOpt) TTL() (int, error) {
 	}
 	}
 	so, ok := sockOpts[ssoTTL]
 	so, ok := sockOpts[ssoTTL]
 	if !ok {
 	if !ok {
-		return 0, errOpNoSupport
+		return 0, errNotImplemented
 	}
 	}
 	return so.GetInt(c.Conn)
 	return so.GetInt(c.Conn)
 }
 }
@@ -49,7 +49,7 @@ func (c *genericOpt) SetTTL(ttl int) error {
 	}
 	}
 	so, ok := sockOpts[ssoTTL]
 	so, ok := sockOpts[ssoTTL]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.SetInt(c.Conn, ttl)
 	return so.SetInt(c.Conn, ttl)
 }
 }

+ 19 - 4
vendor/golang.org/x/net/ipv4/header.go

@@ -51,9 +51,13 @@ func (h *Header) String() string {
 }
 }
 
 
 // Marshal returns the binary encoding of h.
 // Marshal returns the binary encoding of h.
+//
+// The returned slice is in the format used by a raw IP socket on the
+// local system.
+// This may differ from the wire format, depending on the system.
 func (h *Header) Marshal() ([]byte, error) {
 func (h *Header) Marshal() ([]byte, error) {
 	if h == nil {
 	if h == nil {
-		return nil, errInvalidConn
+		return nil, errNilHeader
 	}
 	}
 	if h.Len < HeaderLen {
 	if h.Len < HeaderLen {
 		return nil, errHeaderTooShort
 		return nil, errHeaderTooShort
@@ -98,13 +102,20 @@ func (h *Header) Marshal() ([]byte, error) {
 }
 }
 
 
 // Parse parses b as an IPv4 header and stores the result in h.
 // Parse parses b as an IPv4 header and stores the result in h.
+//
+// The provided b must be in the format used by a raw IP socket on the
+// local system.
+// This may differ from the wire format, depending on the system.
 func (h *Header) Parse(b []byte) error {
 func (h *Header) Parse(b []byte) error {
-	if h == nil || len(b) < HeaderLen {
+	if h == nil || b == nil {
+		return errNilHeader
+	}
+	if len(b) < HeaderLen {
 		return errHeaderTooShort
 		return errHeaderTooShort
 	}
 	}
 	hdrlen := int(b[0]&0x0f) << 2
 	hdrlen := int(b[0]&0x0f) << 2
-	if hdrlen > len(b) {
-		return errBufferTooShort
+	if len(b) < hdrlen {
+		return errExtHeaderTooShort
 	}
 	}
 	h.Version = int(b[0] >> 4)
 	h.Version = int(b[0] >> 4)
 	h.Len = hdrlen
 	h.Len = hdrlen
@@ -149,6 +160,10 @@ func (h *Header) Parse(b []byte) error {
 }
 }
 
 
 // ParseHeader parses b as an IPv4 header.
 // ParseHeader parses b as an IPv4 header.
+//
+// The provided b must be in the format used by a raw IP socket on the
+// local system.
+// This may differ from the wire format, depending on the system.
 func ParseHeader(b []byte) (*Header, error) {
 func ParseHeader(b []byte) (*Header, error) {
 	h := new(Header)
 	h := new(Header)
 	if err := h.Parse(b); err != nil {
 	if err := h.Parse(b); err != nil {

+ 18 - 3
vendor/golang.org/x/net/ipv4/helper.go

@@ -7,23 +7,38 @@ package ipv4
 import (
 import (
 	"errors"
 	"errors"
 	"net"
 	"net"
+	"runtime"
+
+	"golang.org/x/net/internal/socket"
 )
 )
 
 
 var (
 var (
 	errInvalidConn              = errors.New("invalid connection")
 	errInvalidConn              = errors.New("invalid connection")
 	errMissingAddress           = errors.New("missing address")
 	errMissingAddress           = errors.New("missing address")
 	errMissingHeader            = errors.New("missing header")
 	errMissingHeader            = errors.New("missing header")
+	errNilHeader                = errors.New("nil header")
 	errHeaderTooShort           = errors.New("header too short")
 	errHeaderTooShort           = errors.New("header too short")
-	errBufferTooShort           = errors.New("buffer too short")
+	errExtHeaderTooShort        = errors.New("extension header too short")
 	errInvalidConnType          = errors.New("invalid conn type")
 	errInvalidConnType          = errors.New("invalid conn type")
-	errOpNoSupport              = errors.New("operation not supported")
 	errNoSuchInterface          = errors.New("no such interface")
 	errNoSuchInterface          = errors.New("no such interface")
 	errNoSuchMulticastInterface = errors.New("no such multicast interface")
 	errNoSuchMulticastInterface = errors.New("no such multicast interface")
+	errNotImplemented           = errors.New("not implemented on " + runtime.GOOS + "/" + runtime.GOARCH)
 
 
 	// See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html.
 	// See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html.
-	freebsdVersion uint32
+	freebsdVersion  uint32
+	compatFreeBSD32 bool // 386 emulation on amd64
 )
 )
 
 
+// See golang.org/issue/30899.
+func adjustFreeBSD32(m *socket.Message) {
+	if freebsdVersion >= 1103000 {
+		l := (m.NN + 4 - 1) &^ (4 - 1)
+		if m.NN < l && l <= len(m.OOB) {
+			m.NN = l
+		}
+	}
+}
+
 func boolint(b bool) int {
 func boolint(b bool) int {
 	if b {
 	if b {
 		return 1
 		return 1

+ 51 - 2
vendor/golang.org/x/net/ipv4/packet.go

@@ -29,7 +29,35 @@ func (c *packetHandler) ReadFrom(b []byte) (h *Header, p []byte, cm *ControlMess
 	if !c.ok() {
 	if !c.ok() {
 		return nil, nil, nil, errInvalidConn
 		return nil, nil, nil, errInvalidConn
 	}
 	}
-	return c.readFrom(b)
+	c.rawOpt.RLock()
+	m := socket.Message{
+		Buffers: [][]byte{b},
+		OOB:     NewControlMessage(c.rawOpt.cflags),
+	}
+	c.rawOpt.RUnlock()
+	if err := c.RecvMsg(&m, 0); err != nil {
+		return nil, nil, nil, &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
+	}
+	var hs []byte
+	if hs, p, err = slicePacket(b[:m.N]); err != nil {
+		return nil, nil, nil, &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
+	}
+	if h, err = ParseHeader(hs); err != nil {
+		return nil, nil, nil, &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
+	}
+	if m.NN > 0 {
+		if compatFreeBSD32 {
+			adjustFreeBSD32(&m)
+		}
+		cm = new(ControlMessage)
+		if err := cm.Parse(m.OOB[:m.NN]); err != nil {
+			return nil, nil, nil, &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
+		}
+	}
+	if src, ok := m.Addr.(*net.IPAddr); ok && cm != nil {
+		cm.Src = src.IP
+	}
+	return
 }
 }
 
 
 func slicePacket(b []byte) (h, p []byte, err error) {
 func slicePacket(b []byte) (h, p []byte, err error) {
@@ -64,5 +92,26 @@ func (c *packetHandler) WriteTo(h *Header, p []byte, cm *ControlMessage) error {
 	if !c.ok() {
 	if !c.ok() {
 		return errInvalidConn
 		return errInvalidConn
 	}
 	}
-	return c.writeTo(h, p, cm)
+	m := socket.Message{
+		OOB: cm.Marshal(),
+	}
+	wh, err := h.Marshal()
+	if err != nil {
+		return err
+	}
+	m.Buffers = [][]byte{wh, p}
+	dst := new(net.IPAddr)
+	if cm != nil {
+		if ip := cm.Dst.To4(); ip != nil {
+			dst.IP = ip
+		}
+	}
+	if dst.IP == nil {
+		dst.IP = h.Dst
+	}
+	m.Addr = dst
+	if err := c.SendMsg(&m, 0); err != nil {
+		return &net.OpError{Op: "write", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Addr: opAddr(dst), Err: err}
+	}
+	return nil
 }
 }

+ 0 - 56
vendor/golang.org/x/net/ipv4/packet_go1_8.go

@@ -1,56 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.9
-
-package ipv4
-
-import "net"
-
-func (c *packetHandler) readFrom(b []byte) (h *Header, p []byte, cm *ControlMessage, err error) {
-	c.rawOpt.RLock()
-	oob := NewControlMessage(c.rawOpt.cflags)
-	c.rawOpt.RUnlock()
-	n, nn, _, src, err := c.ReadMsgIP(b, oob)
-	if err != nil {
-		return nil, nil, nil, err
-	}
-	var hs []byte
-	if hs, p, err = slicePacket(b[:n]); err != nil {
-		return nil, nil, nil, err
-	}
-	if h, err = ParseHeader(hs); err != nil {
-		return nil, nil, nil, err
-	}
-	if nn > 0 {
-		cm = new(ControlMessage)
-		if err := cm.Parse(oob[:nn]); err != nil {
-			return nil, nil, nil, err
-		}
-	}
-	if src != nil && cm != nil {
-		cm.Src = src.IP
-	}
-	return
-}
-
-func (c *packetHandler) writeTo(h *Header, p []byte, cm *ControlMessage) error {
-	oob := cm.Marshal()
-	wh, err := h.Marshal()
-	if err != nil {
-		return err
-	}
-	dst := new(net.IPAddr)
-	if cm != nil {
-		if ip := cm.Dst.To4(); ip != nil {
-			dst.IP = ip
-		}
-	}
-	if dst.IP == nil {
-		dst.IP = h.Dst
-	}
-	wh = append(wh, p...)
-	_, _, err = c.WriteMsgIP(wh, oob, dst)
-	return err
-}

+ 0 - 67
vendor/golang.org/x/net/ipv4/packet_go1_9.go

@@ -1,67 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.9
-
-package ipv4
-
-import (
-	"net"
-
-	"golang.org/x/net/internal/socket"
-)
-
-func (c *packetHandler) readFrom(b []byte) (h *Header, p []byte, cm *ControlMessage, err error) {
-	c.rawOpt.RLock()
-	m := socket.Message{
-		Buffers: [][]byte{b},
-		OOB:     NewControlMessage(c.rawOpt.cflags),
-	}
-	c.rawOpt.RUnlock()
-	if err := c.RecvMsg(&m, 0); err != nil {
-		return nil, nil, nil, &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
-	}
-	var hs []byte
-	if hs, p, err = slicePacket(b[:m.N]); err != nil {
-		return nil, nil, nil, &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
-	}
-	if h, err = ParseHeader(hs); err != nil {
-		return nil, nil, nil, &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
-	}
-	if m.NN > 0 {
-		cm = new(ControlMessage)
-		if err := cm.Parse(m.OOB[:m.NN]); err != nil {
-			return nil, nil, nil, &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
-		}
-	}
-	if src, ok := m.Addr.(*net.IPAddr); ok && cm != nil {
-		cm.Src = src.IP
-	}
-	return
-}
-
-func (c *packetHandler) writeTo(h *Header, p []byte, cm *ControlMessage) error {
-	m := socket.Message{
-		OOB: cm.Marshal(),
-	}
-	wh, err := h.Marshal()
-	if err != nil {
-		return err
-	}
-	m.Buffers = [][]byte{wh, p}
-	dst := new(net.IPAddr)
-	if cm != nil {
-		if ip := cm.Dst.To4(); ip != nil {
-			dst.IP = ip
-		}
-	}
-	if dst.IP == nil {
-		dst.IP = h.Dst
-	}
-	m.Addr = dst
-	if err := c.SendMsg(&m, 0); err != nil {
-		return &net.OpError{Op: "write", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Addr: opAddr(dst), Err: err}
-	}
-	return nil
-}

+ 55 - 4
vendor/golang.org/x/net/ipv4/payload_cmsg.go

@@ -2,11 +2,15 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build !js,!nacl,!plan9,!windows
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris
 
 
 package ipv4
 package ipv4
 
 
-import "net"
+import (
+	"net"
+
+	"golang.org/x/net/internal/socket"
+)
 
 
 // ReadFrom reads a payload of the received IPv4 datagram, from the
 // ReadFrom reads a payload of the received IPv4 datagram, from the
 // endpoint c, copying the payload into b. It returns the number of
 // endpoint c, copying the payload into b. It returns the number of
@@ -16,7 +20,45 @@ func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.
 	if !c.ok() {
 	if !c.ok() {
 		return 0, nil, nil, errInvalidConn
 		return 0, nil, nil, errInvalidConn
 	}
 	}
-	return c.readFrom(b)
+	c.rawOpt.RLock()
+	m := socket.Message{
+		OOB: NewControlMessage(c.rawOpt.cflags),
+	}
+	c.rawOpt.RUnlock()
+	switch c.PacketConn.(type) {
+	case *net.UDPConn:
+		m.Buffers = [][]byte{b}
+		if err := c.RecvMsg(&m, 0); err != nil {
+			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
+		}
+	case *net.IPConn:
+		h := make([]byte, HeaderLen)
+		m.Buffers = [][]byte{h, b}
+		if err := c.RecvMsg(&m, 0); err != nil {
+			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
+		}
+		hdrlen := int(h[0]&0x0f) << 2
+		if hdrlen > len(h) {
+			d := hdrlen - len(h)
+			copy(b, b[d:])
+			m.N -= d
+		} else {
+			m.N -= hdrlen
+		}
+	default:
+		return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errInvalidConnType}
+	}
+	if m.NN > 0 {
+		if compatFreeBSD32 {
+			adjustFreeBSD32(&m)
+		}
+		cm = new(ControlMessage)
+		if err := cm.Parse(m.OOB[:m.NN]); err != nil {
+			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
+		}
+		cm.Src = netAddrToIP4(m.Addr)
+	}
+	return m.N, cm, m.Addr, nil
 }
 }
 
 
 // WriteTo writes a payload of the IPv4 datagram, to the destination
 // WriteTo writes a payload of the IPv4 datagram, to the destination
@@ -29,5 +71,14 @@ func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n
 	if !c.ok() {
 	if !c.ok() {
 		return 0, errInvalidConn
 		return 0, errInvalidConn
 	}
 	}
-	return c.writeTo(b, cm, dst)
+	m := socket.Message{
+		Buffers: [][]byte{b},
+		OOB:     cm.Marshal(),
+		Addr:    dst,
+	}
+	err = c.SendMsg(&m, 0)
+	if err != nil {
+		err = &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Addr: opAddr(dst), Err: err}
+	}
+	return m.N, err
 }
 }

+ 0 - 59
vendor/golang.org/x/net/ipv4/payload_cmsg_go1_8.go

@@ -1,59 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.9
-// +build !js,!nacl,!plan9,!windows
-
-package ipv4
-
-import "net"
-
-func (c *payloadHandler) readFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {
-	c.rawOpt.RLock()
-	oob := NewControlMessage(c.rawOpt.cflags)
-	c.rawOpt.RUnlock()
-	var nn int
-	switch c := c.PacketConn.(type) {
-	case *net.UDPConn:
-		if n, nn, _, src, err = c.ReadMsgUDP(b, oob); err != nil {
-			return 0, nil, nil, err
-		}
-	case *net.IPConn:
-		nb := make([]byte, maxHeaderLen+len(b))
-		if n, nn, _, src, err = c.ReadMsgIP(nb, oob); err != nil {
-			return 0, nil, nil, err
-		}
-		hdrlen := int(nb[0]&0x0f) << 2
-		copy(b, nb[hdrlen:])
-		n -= hdrlen
-	default:
-		return 0, nil, nil, &net.OpError{Op: "read", Net: c.LocalAddr().Network(), Source: c.LocalAddr(), Err: errInvalidConnType}
-	}
-	if nn > 0 {
-		cm = new(ControlMessage)
-		if err = cm.Parse(oob[:nn]); err != nil {
-			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
-		}
-	}
-	if cm != nil {
-		cm.Src = netAddrToIP4(src)
-	}
-	return
-}
-
-func (c *payloadHandler) writeTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {
-	oob := cm.Marshal()
-	if dst == nil {
-		return 0, &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errMissingAddress}
-	}
-	switch c := c.PacketConn.(type) {
-	case *net.UDPConn:
-		n, _, err = c.WriteMsgUDP(b, oob, dst.(*net.UDPAddr))
-	case *net.IPConn:
-		n, _, err = c.WriteMsgIP(b, oob, dst.(*net.IPAddr))
-	default:
-		return 0, &net.OpError{Op: "write", Net: c.LocalAddr().Network(), Source: c.LocalAddr(), Addr: opAddr(dst), Err: errInvalidConnType}
-	}
-	return
-}

+ 0 - 67
vendor/golang.org/x/net/ipv4/payload_cmsg_go1_9.go

@@ -1,67 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.9
-// +build !js,!nacl,!plan9,!windows
-
-package ipv4
-
-import (
-	"net"
-
-	"golang.org/x/net/internal/socket"
-)
-
-func (c *payloadHandler) readFrom(b []byte) (int, *ControlMessage, net.Addr, error) {
-	c.rawOpt.RLock()
-	m := socket.Message{
-		OOB: NewControlMessage(c.rawOpt.cflags),
-	}
-	c.rawOpt.RUnlock()
-	switch c.PacketConn.(type) {
-	case *net.UDPConn:
-		m.Buffers = [][]byte{b}
-		if err := c.RecvMsg(&m, 0); err != nil {
-			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
-		}
-	case *net.IPConn:
-		h := make([]byte, HeaderLen)
-		m.Buffers = [][]byte{h, b}
-		if err := c.RecvMsg(&m, 0); err != nil {
-			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
-		}
-		hdrlen := int(h[0]&0x0f) << 2
-		if hdrlen > len(h) {
-			d := hdrlen - len(h)
-			copy(b, b[d:])
-			m.N -= d
-		} else {
-			m.N -= hdrlen
-		}
-	default:
-		return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errInvalidConnType}
-	}
-	var cm *ControlMessage
-	if m.NN > 0 {
-		cm = new(ControlMessage)
-		if err := cm.Parse(m.OOB[:m.NN]); err != nil {
-			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
-		}
-		cm.Src = netAddrToIP4(m.Addr)
-	}
-	return m.N, cm, m.Addr, nil
-}
-
-func (c *payloadHandler) writeTo(b []byte, cm *ControlMessage, dst net.Addr) (int, error) {
-	m := socket.Message{
-		Buffers: [][]byte{b},
-		OOB:     cm.Marshal(),
-		Addr:    dst,
-	}
-	err := c.SendMsg(&m, 0)
-	if err != nil {
-		err = &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Addr: opAddr(dst), Err: err}
-	}
-	return m.N, err
-}

+ 1 - 1
vendor/golang.org/x/net/ipv4/payload_nocmsg.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build js nacl plan9 windows
+// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris
 
 
 package ipv4
 package ipv4
 
 

+ 2 - 2
vendor/golang.org/x/net/ipv4/sockopt_posix.go

@@ -39,7 +39,7 @@ func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) {
 		return nil, err
 		return nil, err
 	}
 	}
 	if n != sizeofICMPFilter {
 	if n != sizeofICMPFilter {
-		return nil, errOpNoSupport
+		return nil, errNotImplemented
 	}
 	}
 	return (*ICMPFilter)(unsafe.Pointer(&b[0])), nil
 	return (*ICMPFilter)(unsafe.Pointer(&b[0])), nil
 }
 }
@@ -58,7 +58,7 @@ func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) erro
 	case ssoTypeGroupReq:
 	case ssoTypeGroupReq:
 		return so.setGroupReq(c, ifi, grp)
 		return so.setGroupReq(c, ifi, grp)
 	default:
 	default:
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 }
 }
 
 

+ 7 - 7
vendor/golang.org/x/net/ipv4/sockopt_stub.go

@@ -14,29 +14,29 @@ import (
 )
 )
 
 
 func (so *sockOpt) getMulticastInterface(c *socket.Conn) (*net.Interface, error) {
 func (so *sockOpt) getMulticastInterface(c *socket.Conn) (*net.Interface, error) {
-	return nil, errOpNoSupport
+	return nil, errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setMulticastInterface(c *socket.Conn, ifi *net.Interface) error {
 func (so *sockOpt) setMulticastInterface(c *socket.Conn, ifi *net.Interface) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) {
 func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) {
-	return nil, errOpNoSupport
+	return nil, errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setICMPFilter(c *socket.Conn, f *ICMPFilter) error {
 func (so *sockOpt) setICMPFilter(c *socket.Conn, f *ICMPFilter) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setSourceGroup(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
 func (so *sockOpt) setSourceGroup(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setBPF(c *socket.Conn, f []bpf.RawInstruction) error {
 func (so *sockOpt) setBPF(c *socket.Conn, f []bpf.RawInstruction) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 3 - 3
vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go

@@ -13,13 +13,13 @@ import (
 )
 )
 
 
 func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) getMulticastIf(c *socket.Conn) (*net.Interface, error) {
 func (so *sockOpt) getMulticastIf(c *socket.Conn) (*net.Interface, error) {
-	return nil, errOpNoSupport
+	return nil, errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setMulticastIf(c *socket.Conn, ifi *net.Interface) error {
 func (so *sockOpt) setMulticastIf(c *socket.Conn, ifi *net.Interface) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 2 - 2
vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go

@@ -13,9 +13,9 @@ import (
 )
 )
 
 
 func (so *sockOpt) getIPMreqn(c *socket.Conn) (*net.Interface, error) {
 func (so *sockOpt) getIPMreqn(c *socket.Conn) (*net.Interface, error) {
-	return nil, errOpNoSupport
+	return nil, errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setIPMreqn(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 func (so *sockOpt) setIPMreqn(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 1 - 1
vendor/golang.org/x/net/ipv4/sys_bpf_stub.go

@@ -12,5 +12,5 @@ import (
 )
 )
 
 
 func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error {
 func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 12 - 40
vendor/golang.org/x/net/ipv4/sys_darwin.go

@@ -6,8 +6,6 @@ package ipv4
 
 
 import (
 import (
 	"net"
 	"net"
-	"strconv"
-	"strings"
 	"syscall"
 	"syscall"
 	"unsafe"
 	"unsafe"
 
 
@@ -17,59 +15,33 @@ import (
 
 
 var (
 var (
 	ctlOpts = [ctlMax]ctlOpt{
 	ctlOpts = [ctlMax]ctlOpt{
-		ctlTTL:       {sysIP_RECVTTL, 1, marshalTTL, parseTTL},
-		ctlDst:       {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst},
-		ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface},
+		ctlTTL:        {sysIP_RECVTTL, 1, marshalTTL, parseTTL},
+		ctlDst:        {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst},
+		ctlInterface:  {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface},
+		ctlPacketInfo: {sysIP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo},
 	}
 	}
 
 
 	sockOpts = map[int]*sockOpt{
 	sockOpts = map[int]*sockOpt{
 		ssoTOS:                {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}},
 		ssoTOS:                {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}},
 		ssoTTL:                {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}},
 		ssoTTL:                {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}},
 		ssoMulticastTTL:       {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}},
 		ssoMulticastTTL:       {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}},
-		ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}},
+		ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn},
 		ssoMulticastLoopback:  {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}},
 		ssoMulticastLoopback:  {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}},
 		ssoReceiveTTL:         {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}},
 		ssoReceiveTTL:         {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}},
 		ssoReceiveDst:         {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}},
 		ssoReceiveDst:         {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}},
 		ssoReceiveInterface:   {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}},
 		ssoReceiveInterface:   {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}},
 		ssoHeaderPrepend:      {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}},
 		ssoHeaderPrepend:      {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}},
 		ssoStripHeader:        {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_STRIPHDR, Len: 4}},
 		ssoStripHeader:        {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_STRIPHDR, Len: 4}},
-		ssoJoinGroup:          {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq},
-		ssoLeaveGroup:         {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq},
+		ssoJoinGroup:          {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
+		ssoLeaveGroup:         {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
+		ssoJoinSourceGroup:    {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
+		ssoLeaveSourceGroup:   {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
+		ssoBlockSourceGroup:   {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
+		ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
+		ssoPacketInfo:         {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVPKTINFO, Len: 4}},
 	}
 	}
 )
 )
 
 
-func init() {
-	// Seems like kern.osreldate is veiled on latest OS X. We use
-	// kern.osrelease instead.
-	s, err := syscall.Sysctl("kern.osrelease")
-	if err != nil {
-		return
-	}
-	ss := strings.Split(s, ".")
-	if len(ss) == 0 {
-		return
-	}
-	// The IP_PKTINFO and protocol-independent multicast API were
-	// introduced in OS X 10.7 (Darwin 11). But it looks like
-	// those features require OS X 10.8 (Darwin 12) or above.
-	// See http://support.apple.com/kb/HT1633.
-	if mjver, err := strconv.Atoi(ss[0]); err != nil || mjver < 12 {
-		return
-	}
-	ctlOpts[ctlPacketInfo].name = sysIP_PKTINFO
-	ctlOpts[ctlPacketInfo].length = sizeofInetPktinfo
-	ctlOpts[ctlPacketInfo].marshal = marshalPacketInfo
-	ctlOpts[ctlPacketInfo].parse = parsePacketInfo
-	sockOpts[ssoPacketInfo] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVPKTINFO, Len: 4}}
-	sockOpts[ssoMulticastInterface] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn}
-	sockOpts[ssoJoinGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}
-	sockOpts[ssoLeaveGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}
-	sockOpts[ssoJoinSourceGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}
-	sockOpts[ssoLeaveSourceGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}
-	sockOpts[ssoBlockSourceGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}
-	sockOpts[ssoUnblockSourceGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}
-}
-
 func (pi *inetPktinfo) setIfindex(i int) {
 func (pi *inetPktinfo) setIfindex(i int) {
 	pi.Ifindex = uint32(i)
 	pi.Ifindex = uint32(i)
 }
 }

+ 1 - 1
vendor/golang.org/x/net/ipv4/sys_freebsd.go

@@ -50,7 +50,7 @@ func init() {
 		archs, _ := syscall.Sysctl("kern.supported_archs")
 		archs, _ := syscall.Sysctl("kern.supported_archs")
 		for _, s := range strings.Fields(archs) {
 		for _, s := range strings.Fields(archs) {
 			if s == "amd64" {
 			if s == "amd64" {
-				freebsd32o64 = true
+				compatFreeBSD32 = true
 				break
 				break
 			}
 			}
 		}
 		}

+ 2 - 4
vendor/golang.org/x/net/ipv4/sys_ssmreq.go

@@ -13,8 +13,6 @@ import (
 	"golang.org/x/net/internal/socket"
 	"golang.org/x/net/internal/socket"
 )
 )
 
 
-var freebsd32o64 bool
-
 func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 	var gr groupReq
 	var gr groupReq
 	if ifi != nil {
 	if ifi != nil {
@@ -22,7 +20,7 @@ func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) e
 	}
 	}
 	gr.setGroup(grp)
 	gr.setGroup(grp)
 	var b []byte
 	var b []byte
-	if freebsd32o64 {
+	if compatFreeBSD32 {
 		var d [sizeofGroupReq + 4]byte
 		var d [sizeofGroupReq + 4]byte
 		s := (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr))
 		s := (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr))
 		copy(d[:4], s[:4])
 		copy(d[:4], s[:4])
@@ -41,7 +39,7 @@ func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, sr
 	}
 	}
 	gsr.setSourceGroup(grp, src)
 	gsr.setSourceGroup(grp, src)
 	var b []byte
 	var b []byte
-	if freebsd32o64 {
+	if compatFreeBSD32 {
 		var d [sizeofGroupSourceReq + 4]byte
 		var d [sizeofGroupSourceReq + 4]byte
 		s := (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))
 		s := (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))
 		copy(d[:4], s[:4])
 		copy(d[:4], s[:4])

+ 2 - 2
vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go

@@ -13,9 +13,9 @@ import (
 )
 )
 
 
 func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
 func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 0 - 2
vendor/golang.org/x/net/ipv6/batch.go

@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build go1.9
-
 package ipv6
 package ipv6
 
 
 import (
 import (

+ 1 - 1
vendor/golang.org/x/net/ipv6/control_stub.go

@@ -9,5 +9,5 @@ package ipv6
 import "golang.org/x/net/internal/socket"
 import "golang.org/x/net/internal/socket"
 
 
 func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
 func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 2 - 6
vendor/golang.org/x/net/ipv6/control_windows.go

@@ -4,13 +4,9 @@
 
 
 package ipv6
 package ipv6
 
 
-import (
-	"syscall"
-
-	"golang.org/x/net/internal/socket"
-)
+import "golang.org/x/net/internal/socket"
 
 
 func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
 func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
 	// TODO(mikio): implement this
 	// TODO(mikio): implement this
-	return syscall.EWINDOWS
+	return errNotImplemented
 }
 }

+ 17 - 17
vendor/golang.org/x/net/ipv6/dgramopt.go

@@ -18,7 +18,7 @@ func (c *dgramOpt) MulticastHopLimit() (int, error) {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastHopLimit]
 	so, ok := sockOpts[ssoMulticastHopLimit]
 	if !ok {
 	if !ok {
-		return 0, errOpNoSupport
+		return 0, errNotImplemented
 	}
 	}
 	return so.GetInt(c.Conn)
 	return so.GetInt(c.Conn)
 }
 }
@@ -31,7 +31,7 @@ func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastHopLimit]
 	so, ok := sockOpts[ssoMulticastHopLimit]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.SetInt(c.Conn, hoplim)
 	return so.SetInt(c.Conn, hoplim)
 }
 }
@@ -44,7 +44,7 @@ func (c *dgramOpt) MulticastInterface() (*net.Interface, error) {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastInterface]
 	so, ok := sockOpts[ssoMulticastInterface]
 	if !ok {
 	if !ok {
-		return nil, errOpNoSupport
+		return nil, errNotImplemented
 	}
 	}
 	return so.getMulticastInterface(c.Conn)
 	return so.getMulticastInterface(c.Conn)
 }
 }
@@ -57,7 +57,7 @@ func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastInterface]
 	so, ok := sockOpts[ssoMulticastInterface]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.setMulticastInterface(c.Conn, ifi)
 	return so.setMulticastInterface(c.Conn, ifi)
 }
 }
@@ -70,7 +70,7 @@ func (c *dgramOpt) MulticastLoopback() (bool, error) {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastLoopback]
 	so, ok := sockOpts[ssoMulticastLoopback]
 	if !ok {
 	if !ok {
-		return false, errOpNoSupport
+		return false, errNotImplemented
 	}
 	}
 	on, err := so.GetInt(c.Conn)
 	on, err := so.GetInt(c.Conn)
 	if err != nil {
 	if err != nil {
@@ -87,7 +87,7 @@ func (c *dgramOpt) SetMulticastLoopback(on bool) error {
 	}
 	}
 	so, ok := sockOpts[ssoMulticastLoopback]
 	so, ok := sockOpts[ssoMulticastLoopback]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.SetInt(c.Conn, boolint(on))
 	return so.SetInt(c.Conn, boolint(on))
 }
 }
@@ -107,7 +107,7 @@ func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {
 	}
 	}
 	so, ok := sockOpts[ssoJoinGroup]
 	so, ok := sockOpts[ssoJoinGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP16(group)
 	grp := netAddrToIP16(group)
 	if grp == nil {
 	if grp == nil {
@@ -125,7 +125,7 @@ func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {
 	}
 	}
 	so, ok := sockOpts[ssoLeaveGroup]
 	so, ok := sockOpts[ssoLeaveGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP16(group)
 	grp := netAddrToIP16(group)
 	if grp == nil {
 	if grp == nil {
@@ -146,7 +146,7 @@ func (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net
 	}
 	}
 	so, ok := sockOpts[ssoJoinSourceGroup]
 	so, ok := sockOpts[ssoJoinSourceGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP16(group)
 	grp := netAddrToIP16(group)
 	if grp == nil {
 	if grp == nil {
@@ -167,7 +167,7 @@ func (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source ne
 	}
 	}
 	so, ok := sockOpts[ssoLeaveSourceGroup]
 	so, ok := sockOpts[ssoLeaveSourceGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP16(group)
 	grp := netAddrToIP16(group)
 	if grp == nil {
 	if grp == nil {
@@ -189,7 +189,7 @@ func (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source
 	}
 	}
 	so, ok := sockOpts[ssoBlockSourceGroup]
 	so, ok := sockOpts[ssoBlockSourceGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP16(group)
 	grp := netAddrToIP16(group)
 	if grp == nil {
 	if grp == nil {
@@ -210,7 +210,7 @@ func (c *dgramOpt) IncludeSourceSpecificGroup(ifi *net.Interface, group, source
 	}
 	}
 	so, ok := sockOpts[ssoUnblockSourceGroup]
 	so, ok := sockOpts[ssoUnblockSourceGroup]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	grp := netAddrToIP16(group)
 	grp := netAddrToIP16(group)
 	if grp == nil {
 	if grp == nil {
@@ -233,7 +233,7 @@ func (c *dgramOpt) Checksum() (on bool, offset int, err error) {
 	}
 	}
 	so, ok := sockOpts[ssoChecksum]
 	so, ok := sockOpts[ssoChecksum]
 	if !ok {
 	if !ok {
-		return false, 0, errOpNoSupport
+		return false, 0, errNotImplemented
 	}
 	}
 	offset, err = so.GetInt(c.Conn)
 	offset, err = so.GetInt(c.Conn)
 	if err != nil {
 	if err != nil {
@@ -254,7 +254,7 @@ func (c *dgramOpt) SetChecksum(on bool, offset int) error {
 	}
 	}
 	so, ok := sockOpts[ssoChecksum]
 	so, ok := sockOpts[ssoChecksum]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	if !on {
 	if !on {
 		offset = -1
 		offset = -1
@@ -269,7 +269,7 @@ func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {
 	}
 	}
 	so, ok := sockOpts[ssoICMPFilter]
 	so, ok := sockOpts[ssoICMPFilter]
 	if !ok {
 	if !ok {
-		return nil, errOpNoSupport
+		return nil, errNotImplemented
 	}
 	}
 	return so.getICMPFilter(c.Conn)
 	return so.getICMPFilter(c.Conn)
 }
 }
@@ -281,7 +281,7 @@ func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {
 	}
 	}
 	so, ok := sockOpts[ssoICMPFilter]
 	so, ok := sockOpts[ssoICMPFilter]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.setICMPFilter(c.Conn, f)
 	return so.setICMPFilter(c.Conn, f)
 }
 }
@@ -295,7 +295,7 @@ func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error {
 	}
 	}
 	so, ok := sockOpts[ssoAttachFilter]
 	so, ok := sockOpts[ssoAttachFilter]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.setBPF(c.Conn, filter)
 	return so.setBPF(c.Conn, filter)
 }
 }

+ 3 - 2
vendor/golang.org/x/net/ipv6/doc.go

@@ -56,7 +56,7 @@
 // Multicasting
 // Multicasting
 //
 //
 // The options for multicasting are available for net.UDPConn and
 // The options for multicasting are available for net.UDPConn and
-// net.IPconn which are created as network connections that use the
+// net.IPConn which are created as network connections that use the
 // IPv6 transport. A few network facilities must be prepared before
 // IPv6 transport. A few network facilities must be prepared before
 // you begin multicasting, at a minimum joining network interfaces and
 // you begin multicasting, at a minimum joining network interfaces and
 // multicast groups.
 // multicast groups.
@@ -240,4 +240,5 @@
 // IncludeSourceSpecificGroup may return an error.
 // IncludeSourceSpecificGroup may return an error.
 package ipv6 // import "golang.org/x/net/ipv6"
 package ipv6 // import "golang.org/x/net/ipv6"
 
 
-// BUG(mikio): This package is not implemented on JS, NaCl and Plan 9.
+// BUG(mikio): This package is not implemented on AIX, JS, NaCl and
+// Plan 9.

+ 1 - 1
vendor/golang.org/x/net/ipv6/endpoint.go

@@ -37,7 +37,7 @@ func (c *Conn) PathMTU() (int, error) {
 	}
 	}
 	so, ok := sockOpts[ssoPathMTU]
 	so, ok := sockOpts[ssoPathMTU]
 	if !ok {
 	if !ok {
-		return 0, errOpNoSupport
+		return 0, errNotImplemented
 	}
 	}
 	_, mtu, err := so.getMTUInfo(c.Conn)
 	_, mtu, err := so.getMTUInfo(c.Conn)
 	if err != nil {
 	if err != nil {

+ 4 - 4
vendor/golang.org/x/net/ipv6/genericopt.go

@@ -12,7 +12,7 @@ func (c *genericOpt) TrafficClass() (int, error) {
 	}
 	}
 	so, ok := sockOpts[ssoTrafficClass]
 	so, ok := sockOpts[ssoTrafficClass]
 	if !ok {
 	if !ok {
-		return 0, errOpNoSupport
+		return 0, errNotImplemented
 	}
 	}
 	return so.GetInt(c.Conn)
 	return so.GetInt(c.Conn)
 }
 }
@@ -25,7 +25,7 @@ func (c *genericOpt) SetTrafficClass(tclass int) error {
 	}
 	}
 	so, ok := sockOpts[ssoTrafficClass]
 	so, ok := sockOpts[ssoTrafficClass]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.SetInt(c.Conn, tclass)
 	return so.SetInt(c.Conn, tclass)
 }
 }
@@ -37,7 +37,7 @@ func (c *genericOpt) HopLimit() (int, error) {
 	}
 	}
 	so, ok := sockOpts[ssoHopLimit]
 	so, ok := sockOpts[ssoHopLimit]
 	if !ok {
 	if !ok {
-		return 0, errOpNoSupport
+		return 0, errNotImplemented
 	}
 	}
 	return so.GetInt(c.Conn)
 	return so.GetInt(c.Conn)
 }
 }
@@ -50,7 +50,7 @@ func (c *genericOpt) SetHopLimit(hoplim int) error {
 	}
 	}
 	so, ok := sockOpts[ssoHopLimit]
 	so, ok := sockOpts[ssoHopLimit]
 	if !ok {
 	if !ok {
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 	return so.SetInt(c.Conn, hoplim)
 	return so.SetInt(c.Conn, hoplim)
 }
 }

+ 2 - 1
vendor/golang.org/x/net/ipv6/helper.go

@@ -7,6 +7,7 @@ package ipv6
 import (
 import (
 	"errors"
 	"errors"
 	"net"
 	"net"
+	"runtime"
 )
 )
 
 
 var (
 var (
@@ -14,8 +15,8 @@ var (
 	errMissingAddress  = errors.New("missing address")
 	errMissingAddress  = errors.New("missing address")
 	errHeaderTooShort  = errors.New("header too short")
 	errHeaderTooShort  = errors.New("header too short")
 	errInvalidConnType = errors.New("invalid conn type")
 	errInvalidConnType = errors.New("invalid conn type")
-	errOpNoSupport     = errors.New("operation not supported")
 	errNoSuchInterface = errors.New("no such interface")
 	errNoSuchInterface = errors.New("no such interface")
+	errNotImplemented  = errors.New("not implemented on " + runtime.GOOS + "/" + runtime.GOARCH)
 )
 )
 
 
 func boolint(b bool) int {
 func boolint(b bool) int {

+ 42 - 4
vendor/golang.org/x/net/ipv6/payload_cmsg.go

@@ -2,11 +2,15 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build !js,!nacl,!plan9,!windows
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris
 
 
 package ipv6
 package ipv6
 
 
-import "net"
+import (
+	"net"
+
+	"golang.org/x/net/internal/socket"
+)
 
 
 // ReadFrom reads a payload of the received IPv6 datagram, from the
 // ReadFrom reads a payload of the received IPv6 datagram, from the
 // endpoint c, copying the payload into b. It returns the number of
 // endpoint c, copying the payload into b. It returns the number of
@@ -16,7 +20,32 @@ func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.
 	if !c.ok() {
 	if !c.ok() {
 		return 0, nil, nil, errInvalidConn
 		return 0, nil, nil, errInvalidConn
 	}
 	}
-	return c.readFrom(b)
+	c.rawOpt.RLock()
+	m := socket.Message{
+		Buffers: [][]byte{b},
+		OOB:     NewControlMessage(c.rawOpt.cflags),
+	}
+	c.rawOpt.RUnlock()
+	switch c.PacketConn.(type) {
+	case *net.UDPConn:
+		if err := c.RecvMsg(&m, 0); err != nil {
+			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
+		}
+	case *net.IPConn:
+		if err := c.RecvMsg(&m, 0); err != nil {
+			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
+		}
+	default:
+		return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errInvalidConnType}
+	}
+	if m.NN > 0 {
+		cm = new(ControlMessage)
+		if err := cm.Parse(m.OOB[:m.NN]); err != nil {
+			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
+		}
+		cm.Src = netAddrToIP16(m.Addr)
+	}
+	return m.N, cm, m.Addr, nil
 }
 }
 
 
 // WriteTo writes a payload of the IPv6 datagram, to the destination
 // WriteTo writes a payload of the IPv6 datagram, to the destination
@@ -28,5 +57,14 @@ func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n
 	if !c.ok() {
 	if !c.ok() {
 		return 0, errInvalidConn
 		return 0, errInvalidConn
 	}
 	}
-	return c.writeTo(b, cm, dst)
+	m := socket.Message{
+		Buffers: [][]byte{b},
+		OOB:     cm.Marshal(),
+		Addr:    dst,
+	}
+	err = c.SendMsg(&m, 0)
+	if err != nil {
+		err = &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Addr: opAddr(dst), Err: err}
+	}
+	return m.N, err
 }
 }

+ 0 - 55
vendor/golang.org/x/net/ipv6/payload_cmsg_go1_8.go

@@ -1,55 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.9
-// +build !js,!nacl,!plan9,!windows
-
-package ipv6
-
-import "net"
-
-func (c *payloadHandler) readFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {
-	c.rawOpt.RLock()
-	oob := NewControlMessage(c.rawOpt.cflags)
-	c.rawOpt.RUnlock()
-	var nn int
-	switch c := c.PacketConn.(type) {
-	case *net.UDPConn:
-		if n, nn, _, src, err = c.ReadMsgUDP(b, oob); err != nil {
-			return 0, nil, nil, err
-		}
-	case *net.IPConn:
-		if n, nn, _, src, err = c.ReadMsgIP(b, oob); err != nil {
-			return 0, nil, nil, err
-		}
-	default:
-		return 0, nil, nil, &net.OpError{Op: "read", Net: c.LocalAddr().Network(), Source: c.LocalAddr(), Err: errInvalidConnType}
-	}
-	if nn > 0 {
-		cm = new(ControlMessage)
-		if err = cm.Parse(oob[:nn]); err != nil {
-			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
-		}
-	}
-	if cm != nil {
-		cm.Src = netAddrToIP16(src)
-	}
-	return
-}
-
-func (c *payloadHandler) writeTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {
-	oob := cm.Marshal()
-	if dst == nil {
-		return 0, &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errMissingAddress}
-	}
-	switch c := c.PacketConn.(type) {
-	case *net.UDPConn:
-		n, _, err = c.WriteMsgUDP(b, oob, dst.(*net.UDPAddr))
-	case *net.IPConn:
-		n, _, err = c.WriteMsgIP(b, oob, dst.(*net.IPAddr))
-	default:
-		return 0, &net.OpError{Op: "write", Net: c.LocalAddr().Network(), Source: c.LocalAddr(), Addr: opAddr(dst), Err: errInvalidConnType}
-	}
-	return
-}

+ 0 - 57
vendor/golang.org/x/net/ipv6/payload_cmsg_go1_9.go

@@ -1,57 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.9
-// +build !js,!nacl,!plan9,!windows
-
-package ipv6
-
-import (
-	"net"
-
-	"golang.org/x/net/internal/socket"
-)
-
-func (c *payloadHandler) readFrom(b []byte) (int, *ControlMessage, net.Addr, error) {
-	c.rawOpt.RLock()
-	m := socket.Message{
-		Buffers: [][]byte{b},
-		OOB:     NewControlMessage(c.rawOpt.cflags),
-	}
-	c.rawOpt.RUnlock()
-	switch c.PacketConn.(type) {
-	case *net.UDPConn:
-		if err := c.RecvMsg(&m, 0); err != nil {
-			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
-		}
-	case *net.IPConn:
-		if err := c.RecvMsg(&m, 0); err != nil {
-			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
-		}
-	default:
-		return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errInvalidConnType}
-	}
-	var cm *ControlMessage
-	if m.NN > 0 {
-		cm = new(ControlMessage)
-		if err := cm.Parse(m.OOB[:m.NN]); err != nil {
-			return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
-		}
-		cm.Src = netAddrToIP16(m.Addr)
-	}
-	return m.N, cm, m.Addr, nil
-}
-
-func (c *payloadHandler) writeTo(b []byte, cm *ControlMessage, dst net.Addr) (int, error) {
-	m := socket.Message{
-		Buffers: [][]byte{b},
-		OOB:     cm.Marshal(),
-		Addr:    dst,
-	}
-	err := c.SendMsg(&m, 0)
-	if err != nil {
-		err = &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Addr: opAddr(dst), Err: err}
-	}
-	return m.N, err
-}

+ 1 - 1
vendor/golang.org/x/net/ipv6/payload_nocmsg.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build js nacl plan9 windows
+// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris
 
 
 package ipv6
 package ipv6
 
 

+ 3 - 3
vendor/golang.org/x/net/ipv6/sockopt_posix.go

@@ -37,7 +37,7 @@ func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) {
 		return nil, err
 		return nil, err
 	}
 	}
 	if n != sizeofICMPv6Filter {
 	if n != sizeofICMPv6Filter {
-		return nil, errOpNoSupport
+		return nil, errNotImplemented
 	}
 	}
 	return (*ICMPFilter)(unsafe.Pointer(&b[0])), nil
 	return (*ICMPFilter)(unsafe.Pointer(&b[0])), nil
 }
 }
@@ -54,7 +54,7 @@ func (so *sockOpt) getMTUInfo(c *socket.Conn) (*net.Interface, int, error) {
 		return nil, 0, err
 		return nil, 0, err
 	}
 	}
 	if n != sizeofIPv6Mtuinfo {
 	if n != sizeofIPv6Mtuinfo {
-		return nil, 0, errOpNoSupport
+		return nil, 0, errNotImplemented
 	}
 	}
 	mi := (*ipv6Mtuinfo)(unsafe.Pointer(&b[0]))
 	mi := (*ipv6Mtuinfo)(unsafe.Pointer(&b[0]))
 	if mi.Addr.Scope_id == 0 {
 	if mi.Addr.Scope_id == 0 {
@@ -74,7 +74,7 @@ func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) erro
 	case ssoTypeGroupReq:
 	case ssoTypeGroupReq:
 		return so.setGroupReq(c, ifi, grp)
 		return so.setGroupReq(c, ifi, grp)
 	default:
 	default:
-		return errOpNoSupport
+		return errNotImplemented
 	}
 	}
 }
 }
 
 

+ 8 - 8
vendor/golang.org/x/net/ipv6/sockopt_stub.go

@@ -14,33 +14,33 @@ import (
 )
 )
 
 
 func (so *sockOpt) getMulticastInterface(c *socket.Conn) (*net.Interface, error) {
 func (so *sockOpt) getMulticastInterface(c *socket.Conn) (*net.Interface, error) {
-	return nil, errOpNoSupport
+	return nil, errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setMulticastInterface(c *socket.Conn, ifi *net.Interface) error {
 func (so *sockOpt) setMulticastInterface(c *socket.Conn, ifi *net.Interface) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) {
 func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) {
-	return nil, errOpNoSupport
+	return nil, errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setICMPFilter(c *socket.Conn, f *ICMPFilter) error {
 func (so *sockOpt) setICMPFilter(c *socket.Conn, f *ICMPFilter) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) getMTUInfo(c *socket.Conn) (*net.Interface, int, error) {
 func (so *sockOpt) getMTUInfo(c *socket.Conn) (*net.Interface, int, error) {
-	return nil, 0, errOpNoSupport
+	return nil, 0, errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setSourceGroup(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
 func (so *sockOpt) setSourceGroup(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setBPF(c *socket.Conn, f []bpf.RawInstruction) error {
 func (so *sockOpt) setBPF(c *socket.Conn, f []bpf.RawInstruction) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 1 - 1
vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go

@@ -13,5 +13,5 @@ import (
 )
 )
 
 
 func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 1 - 1
vendor/golang.org/x/net/ipv6/sys_bpf_stub.go

@@ -12,5 +12,5 @@ import (
 )
 )
 
 
 func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error {
 func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 23 - 51
vendor/golang.org/x/net/ipv6/sys_darwin.go

@@ -6,8 +6,6 @@ package ipv6
 
 
 import (
 import (
 	"net"
 	"net"
-	"strconv"
-	"strings"
 	"syscall"
 	"syscall"
 	"unsafe"
 	"unsafe"
 
 
@@ -17,61 +15,35 @@ import (
 
 
 var (
 var (
 	ctlOpts = [ctlMax]ctlOpt{
 	ctlOpts = [ctlMax]ctlOpt{
-		ctlHopLimit:   {sysIPV6_2292HOPLIMIT, 4, marshal2292HopLimit, parseHopLimit},
-		ctlPacketInfo: {sysIPV6_2292PKTINFO, sizeofInet6Pktinfo, marshal2292PacketInfo, parsePacketInfo},
+		ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
+		ctlHopLimit:     {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
+		ctlPacketInfo:   {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
+		ctlNextHop:      {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop},
+		ctlPathMTU:      {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
 	}
 	}
 
 
 	sockOpts = map[int]*sockOpt{
 	sockOpts = map[int]*sockOpt{
-		ssoHopLimit:           {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}},
-		ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}},
-		ssoMulticastHopLimit:  {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}},
-		ssoMulticastLoopback:  {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}},
-		ssoReceiveHopLimit:    {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_2292HOPLIMIT, Len: 4}},
-		ssoReceivePacketInfo:  {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_2292PKTINFO, Len: 4}},
-		ssoChecksum:           {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}},
-		ssoICMPFilter:         {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}},
-		ssoJoinGroup:          {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq},
-		ssoLeaveGroup:         {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq},
+		ssoHopLimit:            {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}},
+		ssoMulticastInterface:  {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}},
+		ssoMulticastHopLimit:   {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}},
+		ssoMulticastLoopback:   {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}},
+		ssoTrafficClass:        {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}},
+		ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}},
+		ssoReceiveHopLimit:     {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}},
+		ssoReceivePacketInfo:   {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}},
+		ssoReceivePathMTU:      {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}},
+		ssoPathMTU:             {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}},
+		ssoChecksum:            {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}},
+		ssoICMPFilter:          {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}},
+		ssoJoinGroup:           {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
+		ssoLeaveGroup:          {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
+		ssoJoinSourceGroup:     {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
+		ssoLeaveSourceGroup:    {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
+		ssoBlockSourceGroup:    {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
+		ssoUnblockSourceGroup:  {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
 	}
 	}
 )
 )
 
 
-func init() {
-	// Seems like kern.osreldate is veiled on latest OS X. We use
-	// kern.osrelease instead.
-	s, err := syscall.Sysctl("kern.osrelease")
-	if err != nil {
-		return
-	}
-	ss := strings.Split(s, ".")
-	if len(ss) == 0 {
-		return
-	}
-	// The IP_PKTINFO and protocol-independent multicast API were
-	// introduced in OS X 10.7 (Darwin 11). But it looks like
-	// those features require OS X 10.8 (Darwin 12) or above.
-	// See http://support.apple.com/kb/HT1633.
-	if mjver, err := strconv.Atoi(ss[0]); err != nil || mjver < 12 {
-		return
-	}
-	ctlOpts[ctlTrafficClass] = ctlOpt{sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}
-	ctlOpts[ctlHopLimit] = ctlOpt{sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}
-	ctlOpts[ctlPacketInfo] = ctlOpt{sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}
-	ctlOpts[ctlNextHop] = ctlOpt{sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}
-	ctlOpts[ctlPathMTU] = ctlOpt{sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}
-	sockOpts[ssoTrafficClass] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}
-	sockOpts[ssoReceiveTrafficClass] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}
-	sockOpts[ssoReceiveHopLimit] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}
-	sockOpts[ssoReceivePacketInfo] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}
-	sockOpts[ssoReceivePathMTU] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}
-	sockOpts[ssoPathMTU] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}
-	sockOpts[ssoJoinGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}
-	sockOpts[ssoLeaveGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}
-	sockOpts[ssoJoinSourceGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}
-	sockOpts[ssoLeaveSourceGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}
-	sockOpts[ssoBlockSourceGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}
-	sockOpts[ssoUnblockSourceGroup] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}
-}
-
 func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) {
 func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) {
 	sa.Len = sizeofSockaddrInet6
 	sa.Len = sizeofSockaddrInet6
 	sa.Family = syscall.AF_INET6
 	sa.Family = syscall.AF_INET6

+ 1 - 1
vendor/golang.org/x/net/ipv6/sys_freebsd.go

@@ -51,7 +51,7 @@ func init() {
 		archs, _ := syscall.Sysctl("kern.supported_archs")
 		archs, _ := syscall.Sysctl("kern.supported_archs")
 		for _, s := range strings.Fields(archs) {
 		for _, s := range strings.Fields(archs) {
 			if s == "amd64" {
 			if s == "amd64" {
-				freebsd32o64 = true
+				compatFreeBSD32 = true
 				break
 				break
 			}
 			}
 		}
 		}

+ 3 - 3
vendor/golang.org/x/net/ipv6/sys_ssmreq.go

@@ -13,7 +13,7 @@ import (
 	"golang.org/x/net/internal/socket"
 	"golang.org/x/net/internal/socket"
 )
 )
 
 
-var freebsd32o64 bool
+var compatFreeBSD32 bool // 386 emulation on amd64
 
 
 func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 	var gr groupReq
 	var gr groupReq
@@ -22,7 +22,7 @@ func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) e
 	}
 	}
 	gr.setGroup(grp)
 	gr.setGroup(grp)
 	var b []byte
 	var b []byte
-	if freebsd32o64 {
+	if compatFreeBSD32 {
 		var d [sizeofGroupReq + 4]byte
 		var d [sizeofGroupReq + 4]byte
 		s := (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr))
 		s := (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr))
 		copy(d[:4], s[:4])
 		copy(d[:4], s[:4])
@@ -41,7 +41,7 @@ func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, sr
 	}
 	}
 	gsr.setSourceGroup(grp, src)
 	gsr.setSourceGroup(grp, src)
 	var b []byte
 	var b []byte
-	if freebsd32o64 {
+	if compatFreeBSD32 {
 		var d [sizeofGroupSourceReq + 4]byte
 		var d [sizeofGroupSourceReq + 4]byte
 		s := (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))
 		s := (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))
 		copy(d[:4], s[:4])
 		copy(d[:4], s[:4])

+ 2 - 2
vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go

@@ -13,9 +13,9 @@ import (
 )
 )
 
 
 func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
 func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }
 
 
 func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
 func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
-	return errOpNoSupport
+	return errNotImplemented
 }
 }

+ 7 - 2
vendor/golang.org/x/net/proxy/proxy.go

@@ -79,8 +79,13 @@ func FromURL(u *url.URL, forward Dialer) (Dialer, error) {
 	}
 	}
 
 
 	switch u.Scheme {
 	switch u.Scheme {
-	case "socks5":
-		return SOCKS5("tcp", u.Host, auth, forward)
+	case "socks5", "socks5h":
+		addr := u.Hostname()
+		port := u.Port()
+		if port == "" {
+			port = "1080"
+		}
+		return SOCKS5("tcp", net.JoinHostPort(addr, port), auth, forward)
 	}
 	}
 
 
 	// If the scheme doesn't match any of the built-in schemes, see if it
 	// If the scheme doesn't match any of the built-in schemes, see if it

+ 29 - 2
vendor/golang.org/x/net/trace/trace.go

@@ -64,12 +64,14 @@ package trace // import "golang.org/x/net/trace"
 
 
 import (
 import (
 	"bytes"
 	"bytes"
+	"context"
 	"fmt"
 	"fmt"
 	"html/template"
 	"html/template"
 	"io"
 	"io"
 	"log"
 	"log"
 	"net"
 	"net"
 	"net/http"
 	"net/http"
+	"net/url"
 	"runtime"
 	"runtime"
 	"sort"
 	"sort"
 	"strconv"
 	"strconv"
@@ -84,6 +86,12 @@ import (
 // FOR DEBUGGING ONLY. This will slow down the program.
 // FOR DEBUGGING ONLY. This will slow down the program.
 var DebugUseAfterFinish = false
 var DebugUseAfterFinish = false
 
 
+// HTTP ServeMux paths.
+const (
+	debugRequestsPath = "/debug/requests"
+	debugEventsPath   = "/debug/events"
+)
+
 // AuthRequest determines whether a specific request is permitted to load the
 // AuthRequest determines whether a specific request is permitted to load the
 // /debug/requests or /debug/events pages.
 // /debug/requests or /debug/events pages.
 //
 //
@@ -110,10 +118,29 @@ var AuthRequest = func(req *http.Request) (any, sensitive bool) {
 }
 }
 
 
 func init() {
 func init() {
+	_, pat := http.DefaultServeMux.Handler(&http.Request{URL: &url.URL{Path: debugRequestsPath}})
+	if pat == debugRequestsPath {
+		panic("/debug/requests is already registered. You may have two independent copies of " +
+			"golang.org/x/net/trace in your binary, trying to maintain separate state. This may " +
+			"involve a vendored copy of golang.org/x/net/trace.")
+	}
+
 	// TODO(jbd): Serve Traces from /debug/traces in the future?
 	// TODO(jbd): Serve Traces from /debug/traces in the future?
 	// There is no requirement for a request to be present to have traces.
 	// There is no requirement for a request to be present to have traces.
-	http.HandleFunc("/debug/requests", Traces)
-	http.HandleFunc("/debug/events", Events)
+	http.HandleFunc(debugRequestsPath, Traces)
+	http.HandleFunc(debugEventsPath, Events)
+}
+
+// NewContext returns a copy of the parent context
+// and associates it with a Trace.
+func NewContext(ctx context.Context, tr Trace) context.Context {
+	return context.WithValue(ctx, contextKey, tr)
+}
+
+// FromContext returns the Trace bound to the context, if any.
+func FromContext(ctx context.Context) (tr Trace, ok bool) {
+	tr, ok = ctx.Value(contextKey).(Trace)
+	return
 }
 }
 
 
 // Traces responds with traces from the program.
 // Traces responds with traces from the program.

+ 0 - 21
vendor/golang.org/x/net/trace/trace_go16.go

@@ -1,21 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.7
-
-package trace
-
-import "golang.org/x/net/context"
-
-// NewContext returns a copy of the parent context
-// and associates it with a Trace.
-func NewContext(ctx context.Context, tr Trace) context.Context {
-	return context.WithValue(ctx, contextKey, tr)
-}
-
-// FromContext returns the Trace bound to the context, if any.
-func FromContext(ctx context.Context) (tr Trace, ok bool) {
-	tr, ok = ctx.Value(contextKey).(Trace)
-	return
-}

+ 0 - 21
vendor/golang.org/x/net/trace/trace_go17.go

@@ -1,21 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.7
-
-package trace
-
-import "context"
-
-// NewContext returns a copy of the parent context
-// and associates it with a Trace.
-func NewContext(ctx context.Context, tr Trace) context.Context {
-	return context.WithValue(ctx, contextKey, tr)
-}
-
-// FromContext returns the Trace bound to the context, if any.
-func FromContext(ctx context.Context) (tr Trace, ok bool) {
-	tr, ok = ctx.Value(contextKey).(Trace)
-	return
-}