Skip to content

Commit

Permalink
Update jsonapi to v0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
louisroyer committed Jun 24, 2024
1 parent 264c820 commit 886e0f2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/google/gopacket v1.1.19
github.com/nextmn/gopacket-gtp v0.0.6
github.com/nextmn/gopacket-srv6 v0.0.7
github.com/nextmn/json-api v0.0.3
github.com/nextmn/json-api v0.0.4
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8
github.com/urfave/cli/v2 v2.27.2
gopkg.in/yaml.v3 v3.0.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ github.com/nextmn/json-api v0.0.2 h1:Xo18bv+eWPc+BBfjNP5MdA0bWokaupzEGW5kt1BwYxg
github.com/nextmn/json-api v0.0.2/go.mod h1:gi9IhsD+FFg7iEnJaZtEaY1WlZkQ75KBBk0z5FmSJBU=
github.com/nextmn/json-api v0.0.3 h1:COfRvrXsPOnkYTMoEfcX55n2H1dDKJh86AqT8+N6qZo=
github.com/nextmn/json-api v0.0.3/go.mod h1:gi9IhsD+FFg7iEnJaZtEaY1WlZkQ75KBBk0z5FmSJBU=
github.com/nextmn/json-api v0.0.4 h1:K8zNEesHMv8gHxP4zDoTbIhIhH85/8YY18hQaKpuUy4=
github.com/nextmn/json-api v0.0.4/go.mod h1:gi9IhsD+FFg7iEnJaZtEaY1WlZkQ75KBBk0z5FmSJBU=
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
10 changes: 7 additions & 3 deletions internal/netfunc/headend-encaps-ctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func (h HeadendEncapsWithCtrl) Handle(packet []byte) ([]byte, error) {
if err != nil {
return nil, err
}
src := net.ParseIP("::") // FIXME: don't hardcode
nextHop := net.ParseIP(action.SRH) // FIXME: allow multiple segments
src := net.ParseIP("::") // FIXME: don't hardcode
nextHop := action.NextHop.AsSlice() // FIXME: allow multiple segments
ipheader := &layers.IPv6{
SrcIP: src,
// S06. Set the IPv6 DA = B
Expand All @@ -54,7 +54,11 @@ func (h HeadendEncapsWithCtrl) Handle(packet []byte) ([]byte, error) {
}
// FIXME: allow multiple segments
//segList := append([]net.IP{seg0}, bsid.ReverseSegmentsList()...)
segList := []net.IP{nextHop}
segList := []net.IP{}
for _, seg := range action.SRH {
segList = append(segList, seg.AsSlice())
}

srh := &gopacket_srv6.IPv6Routing{
RoutingType: 4,
// the first item on segments list is the next endpoint
Expand Down

0 comments on commit 886e0f2

Please sign in to comment.