Skip to content

Commit

Permalink
Merge pull request #177 from sbezverk/adj_sid
Browse files Browse the repository at this point in the history
fix isis sid tag in Unmarshal func
  • Loading branch information
sbezverk authored Aug 24, 2021
2 parents 27cacc6 + 48eb70e commit 237c0a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/sr/sr-adjacencysid.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (a *AdjacencySIDTLV) MarshalJSON() ([]byte, error) {
return json.Marshal(struct {
Flags *AdjOSPFFlags `json:"flags,omitempty"`
Weight uint8 `json:"weight"`
SID uint32 `json:"prefix_sid,omitempty"`
SID uint32 `json:"sid,omitempty"`
}{
Flags: f,
Weight: a.Weight,
Expand All @@ -52,7 +52,7 @@ func (a *AdjacencySIDTLV) MarshalJSON() ([]byte, error) {
return json.Marshal(struct {
Flags *UnknownProtoFlags `json:"flags,omitempty"`
Weight uint8 `json:"weight"`
SID uint32 `json:"prefix_sid,omitempty"`
SID uint32 `json:"sid,omitempty"`
}{
Flags: f,
Weight: a.Weight,
Expand Down Expand Up @@ -101,8 +101,8 @@ func (a *AdjacencySIDTLV) UnmarshalJSON(b []byte) error {
return err
}
}
// SID uint32 `json:"prefix_sid,omitempty"`
if v, ok := objVal["prefix_sid"]; ok {
// SID uint32 `json:"sid,omitempty"`
if v, ok := objVal["sid"]; ok {
if err := json.Unmarshal(v, &result.SID); err != nil {
return err
}
Expand Down

0 comments on commit 237c0a7

Please sign in to comment.