Skip to content

[backend] pcap hotfix #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions backend/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ func selectDev(adjAddr map[string]string, conf Config) (pcap.Interface, error) {
for _, dev := range devs {
for _, addr := range dev.Addresses {
if addr.IP.String() == adjAddr["backend"] {
println(dev.Name)
return dev, nil
}
}
Expand Down Expand Up @@ -583,8 +582,8 @@ func getIPIPfilter() string {
return "ip[9] == 4"
}

func getUDPFilter(addrs []net.IP, backendAddr net.IP, _ uint16) string {
udpPort := "udp" // TODO use proper ports for the filter
func getUDPFilter(addrs []net.IP, backendAddr net.IP, port uint16) string {
udpPort := fmt.Sprintf("udp port %d", port) // TODO use proper ports for the filter
srcUdpAddrs := common.Map(addrs, func(addr net.IP) string {
return fmt.Sprintf("(src host %s)", addr)
})
Expand Down
10 changes: 3 additions & 7 deletions backend/internal/adj/adj.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,17 @@ func NewADJ(AdjBranch string) (ADJ, error) {
}
}

type BoardList struct {
Boards map[string]string `json:"boards"`
}

var boardsList BoardList
var boardsList map[string]string
if err := json.Unmarshal(boardsRaw, &boardsList); err != nil {
return ADJ{}, err
}

boards, err := getBoards(boardsList.Boards)
boards, err := getBoards(boardsList)
if err != nil {
return ADJ{}, err
}

info.BoardIds, err = getBoardIds(boardsList.Boards)
info.BoardIds, err = getBoardIds(boardsList)
if err != nil {
return ADJ{}, err
}
Expand Down
Loading