Skip to content

Commit d6c9320

Browse files
committed
fixed test actions
1 parent c8545bb commit d6c9320

File tree

5 files changed

+26
-22
lines changed

5 files changed

+26
-22
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ require (
1313
github.com/segmentio/asm v1.2.0 // indirect
1414
github.com/segmentio/encoding v0.3.6
1515
github.com/sipcapture/golua v0.0.0-20200610090950-538d24098d76 // indirect
16-
github.com/stretchr/testify v1.8.2
16+
github.com/stretchr/testify v1.9.0
1717
golang.org/x/net v0.18.0
1818
)

go.sum

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
6666
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
6767
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
6868
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
69+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6970
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7071
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
7172
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -246,6 +247,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
246247
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
247248
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
248249
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
250+
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
249251
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
250252
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
251253
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
@@ -254,6 +256,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
254256
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
255257
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
256258
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
259+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
260+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
261+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
257262
github.com/xhit/go-str2duration v1.2.0/go.mod h1:3cPSlfZlUHVlneIVfePFWcJZsuwf+P1v2SRTV4cUmp4=
258263
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
259264
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -584,6 +589,7 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
584589
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
585590
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
586591
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
592+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
587593
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
588594
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
589595
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

ip6defrag/defrag.go

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,23 @@ const (
4343
// the packet, a new IPv6 layer will be returned, and will be set to
4444
// the entire defragmented packet,
4545
//
46-
// It use a map of all the running flows
46+
// # It use a map of all the running flows
4747
//
4848
// Usage example:
4949
//
50-
// func HandlePacket(in *layers.IPv6, inFragment *layers.IPv6Fragment) err {
51-
// defragger := ip6defrag.NewIPv6Defragmenter()
52-
// in, err := defragger.DefragIPv6(in, inFragment)
53-
// if err != nil {
54-
// return err
55-
// } else if in == nil {
56-
// return nil // packet fragment, we don't have whole packet yet.
57-
// }
58-
// // At this point, we know that 'in' is defragmented.
59-
// //It may be the same 'in' passed to
60-
// // HandlePacket, or it may not, but we don't really care :)
61-
// ... do stuff to 'in' ...
62-
//}
63-
//
50+
// func HandlePacket(in *layers.IPv6, inFragment *layers.IPv6Fragment) err {
51+
// defragger := ip6defrag.NewIPv6Defragmenter()
52+
// in, err := defragger.DefragIPv6(in, inFragment)
53+
// if err != nil {
54+
// return err
55+
// } else if in == nil {
56+
// return nil // packet fragment, we don't have whole packet yet.
57+
// }
58+
// // At this point, we know that 'in' is defragmented.
59+
// //It may be the same 'in' passed to
60+
// // HandlePacket, or it may not, but we don't really care :)
61+
// ... do stuff to 'in' ...
62+
// }
6463
func (d *IPv6Defragmenter) DefragIPv6(in *layers.IPv6, inFragment *layers.IPv6Fragment) (*layers.IPv6, error) {
6564
return d.DefragIPv6WithTimestamp(in, inFragment, time.Now())
6665
}
@@ -70,7 +69,6 @@ func (d *IPv6Defragmenter) DefragIPv6(in *layers.IPv6, inFragment *layers.IPv6Fr
7069
// old fragments instead of time.Now()
7170
//
7271
// This is useful when operating on pcap files instead of live captured data
73-
//
7472
func (d *IPv6Defragmenter) DefragIPv6WithTimestamp(in *layers.IPv6, inFragment *layers.IPv6Fragment, t time.Time) (*layers.IPv6, error) {
7573
// perfom security checks
7674
st, err := d.securityChecks(inFragment)

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/sipcapture/heplify/sniffer"
1616
)
1717

18-
const version = "heplify 1.66.4"
18+
const version = "heplify 1.66.5"
1919

2020
func createFlags() {
2121

sniffer/sniffer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ LOOP:
373373
// Listen for an incoming connection.
374374
conn, err := sniffer.collectorTCPconn.Accept()
375375
if err != nil {
376-
logp.Err("Error accepting tcp connection: ", err.Error())
376+
logp.Err("Error accepting tcp connection: %s", err.Error())
377377
continue
378378
}
379379

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

@@ -728,7 +728,7 @@ func (sniffer *SnifferSetup) handleRequestExtended(conn net.Conn) {
728728
n, err := bufferPool.Read(dataHeader)
729729
if err != nil {
730730
if err.Error() != "EOF" {
731-
logp.Err("error during read buffer: ", err)
731+
logp.Err("error during read buffer: %s", err.Error())
732732
}
733733
break
734734
}
@@ -776,7 +776,7 @@ func (sniffer *SnifferSetup) handleRequestExtended(conn net.Conn) {
776776
// Read the incoming connection into the buffer.
777777
n, err := conn.Read(message)
778778
if err != nil {
779-
logp.Err("closed tcp connection [2]:", err.Error())
779+
logp.Err("closed tcp connection [2]: %s", err.Error())
780780
bufferPool.Reset()
781781
break
782782
}

0 commit comments

Comments
 (0)