Skip to content

Commit

Permalink
loxilb-iogh-61 Changes as per gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
PacketCrunch committed Nov 9, 2022
1 parent 43d1e2a commit e74f68f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 40 deletions.
2 changes: 1 addition & 1 deletion api/loxinlp/nlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ func DelNeigh(neigh nlp.Neigh, link nlp.Link) int {
}

if len(brLink.Attrs().HardwareAddr) != 6 {
brMac = [6]byte{ 0, 0, 0, 0, 0, 0}
brMac = [6]byte{0, 0, 0, 0, 0, 0}
} else {
copy(brMac[:], brLink.Attrs().HardwareAddr[:6])
}
Expand Down
74 changes: 37 additions & 37 deletions cicd/scenario7/server.go
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
package main

import (
"fmt"
"net"
"os"
"fmt"
"net"
"os"
)

func main() {
arguments := os.Args
if len(arguments) == 1 {
fmt.Println("Please provide a valid port!")
return
}
ADDR := ":"+arguments[1]
arguments := os.Args
if len(arguments) == 1 {
fmt.Println("Please provide a valid port!")
return
}
ADDR := ":" + arguments[1]

s, err := net.ResolveUDPAddr("udp4", ADDR)
if err != nil {
fmt.Println(err)
return
}
s, err := net.ResolveUDPAddr("udp4", ADDR)
if err != nil {
fmt.Println(err)
return
}

connection, err := net.ListenUDP("udp4", s)
if err != nil {
fmt.Println(err)
return
}
connection, err := net.ListenUDP("udp4", s)
if err != nil {
fmt.Println(err)
return
}

defer connection.Close()
buffer := make([]byte, 1024)
count := 0
for {
if count == 5 {
return
}
defer connection.Close()
buffer := make([]byte, 1024)
count := 0
for {
if count == 5 {
return
}

_, addr, err := connection.ReadFromUDP(buffer)
//fmt.Print("-> ", string(buffer[0:n-1]))
count++
data := []byte(arguments[2])
//fmt.Printf("data: %s\n", string(data))
_, err = connection.WriteToUDP(data, addr)
if err != nil {
fmt.Println(err)
return
}
}
_, addr, err := connection.ReadFromUDP(buffer)
//fmt.Print("-> ", string(buffer[0:n-1]))
count++
data := []byte(arguments[2])
//fmt.Printf("data: %s\n", string(data))
_, err = connection.WriteToUDP(data, addr)
if err != nil {
fmt.Println(err)
return
}
}
}
1 change: 0 additions & 1 deletion loxinet/layer3.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ func (l3 *L3H) IfaSelectAny(addr net.IP) (int, net.IP) {
return L3AddrErr, net.IPv4(0, 0, 0, 0)
}


// Ifa2String - Format an ifa to a string
func Ifa2String(ifa *Ifa, it IterIntf) {
var str string
Expand Down
2 changes: 1 addition & 1 deletion loxinet/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ func (a *ruleAct) String() string {
if a.actType == RtActDrop {
ks += fmt.Sprintf("%s", "drop")
} else if a.actType == RtActDnat ||
a.actType == RtActSnat ||
a.actType == RtActSnat ||
a.actType == RtActFullNat {
if a.actType == RtActSnat {
ks += fmt.Sprintf("%s", "do-snat:")
Expand Down

0 comments on commit e74f68f

Please sign in to comment.