Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZmqSub Tool Debug #251

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ target
bin/
Cargo.lock
__pycache__/
zmqsub
1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ use (
.
./cmd/application
./cmd/registration-server
./util/station-debug
)
42 changes: 22 additions & 20 deletions pkg/station/lib/registration_ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/refraction-networking/conjure/pkg/phantoms"
"github.com/refraction-networking/conjure/pkg/station/liveness"
"github.com/refraction-networking/conjure/pkg/station/log"
"github.com/refraction-networking/conjure/pkg/transports"
pb "github.com/refraction-networking/conjure/proto"
)

Expand Down Expand Up @@ -138,31 +139,32 @@ func (rm *RegistrationManager) ingestRegistration(reg *DecoyRegistration) {
return
}

// check existence and track if not exists in one mutex protected step to prevent toctou
// allowing more than one registration to complete the ingest pipeline for the same connection.
exists, err := rm.TrackRegIfNotExists(reg)
if err != nil {
logger.Errorln("error tracking registration: ", err)
Stat().AddErrReg()
rm.AddErrReg()
return
} else if exists {
if rm.RegistrationExists(reg) {
// log phantom IP, shared secret, ipv6 support
logger.Debugf("Duplicate registration: %v %s\n", reg.IDString(), reg.RegistrationSource)
Stat().AddDupReg()
rm.AddDupReg()

// Track the received registration, if it is already tracked it will just update the record
// Track the received registration, if it is already tracked
// it will just update the record
err := rm.TrackRegistration(reg)
if err != nil {
logger.Errorln("error tracking registration: ", err)
Stat().AddErrReg()
rm.AddErrReg()
}
return
} else {
// log phantom IP, shared secret, ipv6 support
logger.Debugf("New registration: %s %v\n", reg.IDString(), reg.String())
}

// log phantom IP, shared secret, ipv6 support
logger.Debugf("New registration: %s %v\n", reg.IDString(), reg.String())

// Track the received registration
err := rm.TrackRegistration(reg)
if err != nil {
logger.Errorln("error tracking registration: ", err)
Stat().AddErrReg()
rm.AddErrReg()
}

// If registration is trying to connect to a covert address that
Expand Down Expand Up @@ -346,7 +348,7 @@ func (rm *RegistrationManager) NewRegistration(c2s *pb.ClientToStation, conjureK
conjureKeys.ConjureSeed, gen, clientLibVer, includeV6)

if err != nil {
return nil, fmt.Errorf("failed phantom select: gen %d libv %d v6 %t err: %v",
return nil, fmt.Errorf("failed phantom select: gen %d libv %d v6 %t err: %w",
gen,
clientLibVer,
includeV6,
Expand All @@ -355,22 +357,22 @@ func (rm *RegistrationManager) NewRegistration(c2s *pb.ClientToStation, conjureK

var transport, ok = rm.registeredDecoys.transports[c2s.GetTransport()]
if !ok {
return nil, fmt.Errorf("unknown transport")
return nil, transports.ErrUnknownTransport
}

transportParams, err := rm.getTransportParams(c2s.GetTransport(), c2s.GetTransportParams(), clientLibVer)
if err != nil {
return nil, fmt.Errorf("error handling transport params: %s", err)
return nil, fmt.Errorf("error handling transport params: %w", err)
}

phantomPort, err := rm.getPhantomDstPort(c2s.GetTransport(), transportParams, conjureKeys.ConjureSeed, clientLibVer, phantomAddr.SupportRandomPort())
if err != nil {
return nil, fmt.Errorf("error selecting phantom dst port: %s", err)
return nil, fmt.Errorf("error selecting phantom dst port: %w", err)
}

phantomProto, err := rm.getTransportProto(c2s.GetTransport(), transportParams, clientLibVer)
if err != nil {
return nil, fmt.Errorf("error determining phantom connection proto: %s", err)
return nil, fmt.Errorf("error determining phantom connection proto: %w", err)
}

reg := DecoyRegistration{
Expand Down Expand Up @@ -408,7 +410,7 @@ func (rm *RegistrationManager) NewRegistrationC2SWrapper(c2sw *pb.C2SWrapper, in
// Generate keys from shared secret using HKDF
conjureKeys, err := core.GenSharedKeys(uint(c2s.GetClientLibVersion()), c2sw.GetSharedSecret(), c2s.GetTransport())
if err != nil {
return nil, fmt.Errorf("failed to generate keys: %v", err)
return nil, fmt.Errorf("failed to generate keys: %w", err)
}

regSrc := c2sw.GetRegistrationSource()
Expand All @@ -432,7 +434,7 @@ func (rm *RegistrationManager) NewRegistrationC2SWrapper(c2sw *pb.C2SWrapper, in

reg, err := rm.NewRegistration(c2s, &conjureKeys, includeV6, &regSrc)
if err != nil || reg == nil {
return nil, fmt.Errorf("failed to build registration: %s", err)
return nil, fmt.Errorf("failed to build registration: %w", err)
}

clientAddr := net.IP(c2sw.GetRegistrationAddress())
Expand Down
3 changes: 3 additions & 0 deletions pkg/transports/transports.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
)

var (
// ErrUnknownTransport provided id or name does npt match any enabled transport.
ErrUnknownTransport = errors.New("unknown transport")

// ErrTryAgain is returned by transports when it is inconclusive with the current amount of data
// whether the transport exists in the connection.
ErrTryAgain = errors.New("not enough information to determine transport")
Expand Down
3 changes: 3 additions & 0 deletions util/station-debug/README
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ pip3 install protobuf

./run.sh


DTLS transport is not added yet, so there will be NO registrations for sessions using a DTLS
transport seen printed. I am not sure if it will print an error or not.
7 changes: 4 additions & 3 deletions util/station-debug/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/libp2p/go-reuseport v0.4.0 // indirect
github.com/mroth/weightedrand v1.0.0 // indirect
Expand All @@ -31,10 +30,12 @@ require (
github.com/refraction-networking/ed25519 v0.1.2 // indirect
github.com/refraction-networking/obfs4 v0.1.2 // indirect
gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/goptlib v1.5.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/sys v0.13.0 // indirect
)

replace github.com/pion/dtls/v2 => github.com/mingyech/dtls/v2 v2.0.0

replace github.com/pion/transport/v2 => github.com/mingyech/transport/v2 v2.0.0

replace github.com/refraction-networking/conjure => ../../
21 changes: 5 additions & 16 deletions util/station-debug/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=
github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
Expand Down Expand Up @@ -53,8 +51,6 @@ github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4=
github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/refraction-networking/conjure v0.7.6 h1:cNTLrhFXTLGJaL3J6iiSncGDRAYzXbX7MGSvVlxn/Wk=
github.com/refraction-networking/conjure v0.7.6/go.mod h1:/UxAcot49ii6ejyvBrSo3g10yyUEavaGJT1Iy47oAfU=
github.com/refraction-networking/ed25519 v0.1.2 h1:08kJZUkAlY7a7cZGosl1teGytV+QEoNxPO7NnRvAB+g=
github.com/refraction-networking/ed25519 v0.1.2/go.mod h1:nxYLUAYt/hmNpAh64PNSQ/tQ9gTIB89wCaGKJlRtZ9I=
github.com/refraction-networking/obfs4 v0.1.2 h1:J842O4fGSkd2W8ogYj0KN6gqVVY+Cpqodw9qFGL7wVU=
Expand All @@ -71,28 +67,23 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t
gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/goptlib v1.5.0 h1:rzdY78Ox2T+VlXcxGxELF+6VyUXlZBhmRqZu5etLm+c=
gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/goptlib v1.5.0/go.mod h1:70bhd4JKW/+1HLfm+TMrgHJsUHG4coelMWwiVEJ2gAg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand All @@ -101,8 +92,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
Expand All @@ -117,11 +108,9 @@ golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
Expand Down
10 changes: 9 additions & 1 deletion util/station-debug/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

#PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python python3 phantom-sub.py

PATH="/usr/local/go/bin:$PATH"

go build zmqsub.go
PHANTOM_SUBNET_LOCATION=/var/lib/conjure/phantom_subnets.toml ./zmqsub
BUILD_RESULT=$?
if [ $BUILD_RESULT -ne 0 ]; then
echo "build failed"
exit ${BUILD_RESULT}
else
PHANTOM_SUBNET_LOCATION=/var/lib/conjure/phantom_subnets.toml ./zmqsub
fi

54 changes: 36 additions & 18 deletions util/station-debug/zmqsub.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package main

import (
"errors"
"flag"
//"fmt"
zmq "github.com/pebbe/zmq4"
golog "log"
"net"
"os"
"strconv"

zmq "github.com/pebbe/zmq4"

// "github.com/refraction-networking/conjure/pkg/dtls/dnat"
// "github.com/refraction-networking/conjure/pkg/transports/connecting/dtls"
"github.com/refraction-networking/conjure/pkg/station/log"
"github.com/refraction-networking/conjure/pkg/phantoms"
cj "github.com/refraction-networking/conjure/pkg/station/lib"
"github.com/refraction-networking/conjure/pkg/station/log"
"github.com/refraction-networking/conjure/pkg/transports"
"github.com/refraction-networking/conjure/pkg/transports/wrapping/min"
"github.com/refraction-networking/conjure/pkg/transports/wrapping/obfs4"
"github.com/refraction-networking/conjure/pkg/transports/wrapping/prefix"
Expand All @@ -27,9 +30,11 @@ var enabledTransports = map[pb.TransportType]cj.Transport{
pb.TransportType_Prefix: prefix.Transport{},
}

func handleReg(logger *log.Logger, source net.IP, reg *cj.DecoyRegistration) {
var i int = 0

logger.Printf("%v %v:%v %+v\n", source, reg.PhantomProto, net.JoinHostPort(reg.PhantomIp.String(), strconv.FormatUint(uint64(reg.PhantomPort), 10)), reg)
func handleReg(logger *log.Logger, source net.IP, reg *cj.DecoyRegistration) {
i += 1
logger.Printf("%d %v %v:%v %+v\n", i, source, reg.PhantomProto, net.JoinHostPort(reg.PhantomIp.String(), strconv.FormatUint(uint64(reg.PhantomPort), 10)), reg)
}

func main() {
Expand Down Expand Up @@ -73,7 +78,6 @@ func main() {
}
}


for {
msg, err := sub.RecvBytes(0)
if err != nil {
Expand All @@ -98,26 +102,40 @@ func main() {
}

// If client IP logging is disabled DO NOT parse source IP.
var sourceAddr net.IP
sourceAddr = net.IP(parsed.GetRegistrationAddress())
var sourceAddr = net.IP(parsed.GetRegistrationAddress())

if parsed.GetRegistrationPayload().GetV4Support() && sourceAddr.To4() != nil {
reg, err := regManager.NewRegistrationC2SWrapper(parsed, false)
if err != nil {
logger.Printf("Failed to create registration: %v", err)
return
if errors.Is(err, phantoms.ErrLegacyMissingAddrs) ||
errors.Is(err, phantoms.ErrLegacyAddrSelectBug) ||
errors.Is(err, phantoms.ErrLegacyV0SelectionBug) ||
errors.Is(err, transports.ErrUnknownTransport) {
continue
}

// print to stderr
println("unexpected err creating registration: %v, %v", err, reg)
continue
}
handleReg(logger, sourceAddr, reg)
}


if parsed.GetRegistrationPayload().GetV6Support() {
reg, err := regManager.NewRegistrationC2SWrapper(parsed, true)
if err != nil {
logger.Printf("Failed to create registration: %v", err)
return
}
handleReg(logger, sourceAddr, reg)
if parsed.GetRegistrationPayload().GetV6Support() {
reg, err := regManager.NewRegistrationC2SWrapper(parsed, true)
if err != nil {
if errors.Is(err, phantoms.ErrLegacyMissingAddrs) ||
errors.Is(err, phantoms.ErrLegacyAddrSelectBug) ||
errors.Is(err, phantoms.ErrLegacyV0SelectionBug) ||
errors.Is(err, transports.ErrUnknownTransport) {
continue
}

// print to stderr
println("unexpected err creating registration: %v, %v", err, reg)
continue
}
handleReg(logger, sourceAddr, reg)
}

}
Expand Down