diff --git a/cmd/client/main.go b/cmd/client/main.go index 5b762d7..44166ac 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -51,7 +51,7 @@ it uses the icmp protocol.`, cmdSend.PersistentFlags().StringVarP(&listenAddr, "listen", "l", "0.0.0.0", "address used for listening echo reply") - cmdSend.PersistentFlags().IntVarP(&chunkSize, "size", "s", 65507, "Size of each ICMP data section send by packet") + cmdSend.PersistentFlags().IntVarP(&chunkSize, "size", "s", 65488, "Size of each ICMP data section send by packet") cmdSend.PersistentFlags().IntVarP(&delay, "delay", "d", 4, "delay between each packet sent") diff --git a/pkg/icmp/receive.go b/pkg/icmp/receive.go index d65eea1..874c9d3 100644 --- a/pkg/icmp/receive.go +++ b/pkg/icmp/receive.go @@ -22,7 +22,7 @@ func GetMessageSizeAndSender(listenAddr string) (size int, sender string) { } defer c.Close() - packet := make([]byte, 65507) + packet := make([]byte, 65535) n, peer, err := c.ReadFrom(packet) if err != nil { fmt.Println("Error while reading icmp packet:", err) @@ -136,7 +136,7 @@ func ServeTemporary(listenAddr string, n int, progressBar bool, delay int) (data //Get a single packet then add the data to the slice (= chunked data) and remove the index from the indexes func getPacket(c *icmp.PacketConn, data []string, indexes map[int]int) { - packet := make([]byte, 65507) + packet := make([]byte, 65535) n, peer, err := c.ReadFrom(packet) if err != nil { fmt.Println("Error while reading icmp packet:", err) @@ -161,7 +161,7 @@ func getPacket(c *icmp.PacketConn, data []string, indexes map[int]int) { //Get a single packet then add the data to the slice (= chunked data), remove the index from the indexes & update the crossbar func getPacketAndBarUpdate(bar *progressbar.ProgressBar, c *icmp.PacketConn, data []string, indexes map[int]int) { - packet := make([]byte, 65507) + packet := make([]byte, 65535) n, peer, err := c.ReadFrom(packet) if err != nil { fmt.Println("Error while reading icmp packet:", err) @@ -195,7 +195,7 @@ func IntegrityCheck(hash string) { defer c.Close() for { - packet := make([]byte, 65507) + packet := make([]byte, 65535) n, peer, err := c.ReadFrom(packet) if err != nil { fmt.Println("Error while reading icmp packet:", err) diff --git a/pkg/icmp/send.go b/pkg/icmp/send.go index 826ddb8..f798811 100644 --- a/pkg/icmp/send.go +++ b/pkg/icmp/send.go @@ -80,7 +80,7 @@ func IcmpSendAndWaitForReply(listeningReplyAddr string, remoteAddr string, data } // Wait for a reply - reply := make([]byte, 65507) + reply := make([]byte, 65535) err = c.SetReadDeadline(time.Now().Add(10 * time.Second)) if err != nil { return dst, 0, err