Skip to content

Commit

Permalink
Merge pull request #409 from AkihiroSuda/remove-replace-inetaf-tcpproxy
Browse files Browse the repository at this point in the history
go.mod: remove `replace inet.af/tcpproxy => github.com/inetaf/tcpproxy`
  • Loading branch information
openshift-merge-bot[bot] authored Oct 23, 2024
2 parents 0d35eaa + aa45f1b commit 78d4944
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 628 deletions.
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ require (
golang.org/x/sync v0.8.0
golang.org/x/sys v0.26.0
gvisor.dev/gvisor v0.0.0-20240826182512-9f3309e5b121
inet.af/tcpproxy v0.0.0-20220326234310-be3ee21c9fa0
)

require (
Expand All @@ -52,5 +51,3 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace inet.af/tcpproxy => github.com/inetaf/tcpproxy v0.0.0-20221017015627-91f861402626
2 changes: 1 addition & 1 deletion pkg/services/forwarder/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import (
"sync"

"github.com/containers/gvisor-tap-vsock/pkg/sshclient"
"github.com/containers/gvisor-tap-vsock/pkg/tcpproxy"
"github.com/containers/gvisor-tap-vsock/pkg/types"
log "github.com/sirupsen/logrus"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/adapters/gonet"
"gvisor.dev/gvisor/pkg/tcpip/network/ipv4"
"gvisor.dev/gvisor/pkg/tcpip/stack"
"inet.af/tcpproxy"
)

type PortsForwarder struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/services/forwarder/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"net"
"sync"

"github.com/containers/gvisor-tap-vsock/pkg/tcpproxy"
log "github.com/sirupsen/logrus"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/adapters/gonet"
"gvisor.dev/gvisor/pkg/tcpip/stack"
"gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
"gvisor.dev/gvisor/pkg/waiter"
"inet.af/tcpproxy"
)

const linkLocalSubnet = "169.254.0.0/16"
Expand Down
16 changes: 6 additions & 10 deletions vendor/inet.af/tcpproxy/tcpproxy.go → pkg/tcpproxy/tcpproxy.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copied from https://github.com/inetaf/tcpproxy/blob/91f861402626c6ba93eaa57ee257109c4f07bd00/tcpproxy.go

// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -81,16 +83,6 @@ type Proxy struct {
ListenFunc func(net, laddr string) (net.Listener, error)
}

// Matcher reports whether hostname matches the Matcher's criteria.
type Matcher func(ctx context.Context, hostname string) bool

// equals is a trivial Matcher that implements string equality.
func equals(want string) Matcher {
return func(_ context.Context, got string) bool {
return want == got
}
}

// config contains the proxying state for one listener.
type config struct {
routes []route
Expand Down Expand Up @@ -372,11 +364,15 @@ func (dp *DialProxy) HandleConn(src net.Conn) {

if ka := dp.keepAlivePeriod(); ka > 0 {
if c, ok := UnderlyingConn(src).(*net.TCPConn); ok {
//nolint:errcheck
c.SetKeepAlive(true)
//nolint:errcheck
c.SetKeepAlivePeriod(ka)
}
if c, ok := dst.(*net.TCPConn); ok {
//nolint:errcheck
c.SetKeepAlive(true)
//nolint:errcheck
c.SetKeepAlivePeriod(ka)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/virtualnetwork/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"net/http"
"strconv"

"github.com/containers/gvisor-tap-vsock/pkg/tcpproxy"
"github.com/containers/gvisor-tap-vsock/pkg/types"
log "github.com/sirupsen/logrus"
"gvisor.dev/gvisor/pkg/tcpip"
"gvisor.dev/gvisor/pkg/tcpip/adapters/gonet"
"gvisor.dev/gvisor/pkg/tcpip/network/ipv4"
"inet.af/tcpproxy"
)

func (n *VirtualNetwork) Mux() *http.ServeMux {
Expand Down
45 changes: 0 additions & 45 deletions vendor/inet.af/tcpproxy/.travis.yml

This file was deleted.

8 changes: 0 additions & 8 deletions vendor/inet.af/tcpproxy/CONTRIBUTING.md

This file was deleted.

202 changes: 0 additions & 202 deletions vendor/inet.af/tcpproxy/LICENSE

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/inet.af/tcpproxy/README.md

This file was deleted.

Loading

0 comments on commit 78d4944

Please sign in to comment.