Skip to content

Commit 7844664

Browse files
committed
fixed size. Thanks SIPFront for report
1 parent 0908c70 commit 7844664

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package config
22

3-
const Version = "heplify-server 1.59.8"
3+
const Version = "heplify-server 1.59.9"
44

55
var Setting HeplifyServer
66

server/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ type HEPStats struct {
4848
}
4949

5050
const maxPktLen = 65507
51+
const minPktLen = 6
5152

5253
func NewHEPInput() *HEPInput {
5354
h := &HEPInput{

server/tcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (h *HEPInput) handleStream(c net.Conn, protocol string) {
8383
return
8484
} else {
8585
size := binary.BigEndian.Uint16(hb[4:6])
86-
if size > maxPktLen {
86+
if size > maxPktLen || size < minPktLen {
8787
logp.Warn("wrong or too big HEP packet size with %d bytes", size)
8888
//r.Reset(c)
8989
//continue

0 commit comments

Comments
 (0)