Skip to content

Commit

Permalink
bugfix: parse ipv4 src/dst error
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie17Li committed Sep 11, 2024
1 parent b1ce50c commit dbe3452
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nl/tc_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ func (p *TcPedit) SetIPv6Dst(ip6 net.IP) {
}

func (p *TcPedit) SetIPv4Src(ip net.IP) {
u32 := NativeEndian().Uint32(ip[:4])
u32 := NativeEndian().Uint32(ip.To4())

tKey := TcPeditKey{}
tKeyEx := TcPeditKeyEx{}
Expand All @@ -1549,7 +1549,7 @@ func (p *TcPedit) SetIPv4Src(ip net.IP) {
}

func (p *TcPedit) SetIPv4Dst(ip net.IP) {
u32 := NativeEndian().Uint32(ip[:4])
u32 := NativeEndian().Uint32(ip.To4())

tKey := TcPeditKey{}
tKeyEx := TcPeditKeyEx{}
Expand Down

0 comments on commit dbe3452

Please sign in to comment.