Skip to content

Commit

Permalink
fixed test actions
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovikov committed Jun 25, 2024
1 parent c8545bb commit d6c9320
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ require (
github.com/segmentio/asm v1.2.0 // indirect
github.com/segmentio/encoding v0.3.6
github.com/sipcapture/golua v0.0.0-20200610090950-538d24098d76 // indirect
github.com/stretchr/testify v1.8.2
github.com/stretchr/testify v1.9.0
golang.org/x/net v0.18.0
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
Expand Down Expand Up @@ -246,6 +247,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
Expand All @@ -254,6 +256,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/xhit/go-str2duration v1.2.0/go.mod h1:3cPSlfZlUHVlneIVfePFWcJZsuwf+P1v2SRTV4cUmp4=
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -584,6 +589,7 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
30 changes: 14 additions & 16 deletions ip6defrag/defrag.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,23 @@ const (
// the packet, a new IPv6 layer will be returned, and will be set to
// the entire defragmented packet,
//
// It use a map of all the running flows
// # It use a map of all the running flows
//
// Usage example:
//
// func HandlePacket(in *layers.IPv6, inFragment *layers.IPv6Fragment) err {
// defragger := ip6defrag.NewIPv6Defragmenter()
// in, err := defragger.DefragIPv6(in, inFragment)
// if err != nil {
// return err
// } else if in == nil {
// return nil // packet fragment, we don't have whole packet yet.
// }
// // At this point, we know that 'in' is defragmented.
// //It may be the same 'in' passed to
// // HandlePacket, or it may not, but we don't really care :)
// ... do stuff to 'in' ...
//}
//
// func HandlePacket(in *layers.IPv6, inFragment *layers.IPv6Fragment) err {
// defragger := ip6defrag.NewIPv6Defragmenter()
// in, err := defragger.DefragIPv6(in, inFragment)
// if err != nil {
// return err
// } else if in == nil {
// return nil // packet fragment, we don't have whole packet yet.
// }
// // At this point, we know that 'in' is defragmented.
// //It may be the same 'in' passed to
// // HandlePacket, or it may not, but we don't really care :)
// ... do stuff to 'in' ...
// }
func (d *IPv6Defragmenter) DefragIPv6(in *layers.IPv6, inFragment *layers.IPv6Fragment) (*layers.IPv6, error) {
return d.DefragIPv6WithTimestamp(in, inFragment, time.Now())
}
Expand All @@ -70,7 +69,6 @@ func (d *IPv6Defragmenter) DefragIPv6(in *layers.IPv6, inFragment *layers.IPv6Fr
// old fragments instead of time.Now()
//
// This is useful when operating on pcap files instead of live captured data
//
func (d *IPv6Defragmenter) DefragIPv6WithTimestamp(in *layers.IPv6, inFragment *layers.IPv6Fragment, t time.Time) (*layers.IPv6, error) {
// perfom security checks
st, err := d.securityChecks(inFragment)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/sipcapture/heplify/sniffer"
)

const version = "heplify 1.66.4"
const version = "heplify 1.66.5"

func createFlags() {

Expand Down
8 changes: 4 additions & 4 deletions sniffer/sniffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ LOOP:
// Listen for an incoming connection.
conn, err := sniffer.collectorTCPconn.Accept()
if err != nil {
logp.Err("Error accepting tcp connection: ", err.Error())
logp.Err("Error accepting tcp connection: %s", err.Error())
continue
}

Expand Down Expand Up @@ -714,7 +714,7 @@ func (sniffer *SnifferSetup) handleRequestExtended(conn net.Conn) {
// Read the incoming connection into the buffer.
n, err := conn.Read(message)
if err != nil {
logp.Err("closed tcp connection [1]:", err.Error())
logp.Err("closed tcp connection [1]: %s", err.Error())
break
}

Expand All @@ -728,7 +728,7 @@ func (sniffer *SnifferSetup) handleRequestExtended(conn net.Conn) {
n, err := bufferPool.Read(dataHeader)
if err != nil {
if err.Error() != "EOF" {
logp.Err("error during read buffer: ", err)
logp.Err("error during read buffer: %s", err.Error())
}
break
}
Expand Down Expand Up @@ -776,7 +776,7 @@ func (sniffer *SnifferSetup) handleRequestExtended(conn net.Conn) {
// Read the incoming connection into the buffer.
n, err := conn.Read(message)
if err != nil {
logp.Err("closed tcp connection [2]:", err.Error())
logp.Err("closed tcp connection [2]: %s", err.Error())
bufferPool.Reset()
break
}
Expand Down

0 comments on commit d6c9320

Please sign in to comment.