File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1239,8 +1239,8 @@ const (
1239
1239
)
1240
1240
1241
1241
// /* TCA_PEDIT_KEY_EX_HDR_TYPE_NETWROK is a special case for legacy users. It
1242
- // * means no specific header type - offset is relative to the network layer
1243
- // */
1242
+ // - means no specific header type - offset is relative to the network layer
1243
+ // */
1244
1244
type PeditHeaderType uint16
1245
1245
1246
1246
const (
@@ -1460,15 +1460,15 @@ func (p *TcPedit) SetIPv6Src(ip6 net.IP) {
1460
1460
1461
1461
func (p * TcPedit ) SetDstIP (ip net.IP ) {
1462
1462
if ip .To4 () != nil {
1463
- p .SetIPv4Dst (ip )
1463
+ p .SetIPv4Dst (ip . To4 () )
1464
1464
} else {
1465
1465
p .SetIPv6Dst (ip )
1466
1466
}
1467
1467
}
1468
1468
1469
1469
func (p * TcPedit ) SetSrcIP (ip net.IP ) {
1470
1470
if ip .To4 () != nil {
1471
- p .SetIPv4Src (ip )
1471
+ p .SetIPv4Src (ip . To4 () )
1472
1472
} else {
1473
1473
p .SetIPv6Src (ip )
1474
1474
}
@@ -1533,7 +1533,7 @@ func (p *TcPedit) SetIPv6Dst(ip6 net.IP) {
1533
1533
}
1534
1534
1535
1535
func (p * TcPedit ) SetIPv4Src (ip net.IP ) {
1536
- u32 := NativeEndian ().Uint32 (ip [12 : 16 ])
1536
+ u32 := NativeEndian ().Uint32 (ip [: 4 ])
1537
1537
1538
1538
tKey := TcPeditKey {}
1539
1539
tKeyEx := TcPeditKeyEx {}
@@ -1549,7 +1549,7 @@ func (p *TcPedit) SetIPv4Src(ip net.IP) {
1549
1549
}
1550
1550
1551
1551
func (p * TcPedit ) SetIPv4Dst (ip net.IP ) {
1552
- u32 := NativeEndian ().Uint32 (ip [12 : 16 ])
1552
+ u32 := NativeEndian ().Uint32 (ip [: 4 ])
1553
1553
1554
1554
tKey := TcPeditKey {}
1555
1555
tKeyEx := TcPeditKeyEx {}
You can’t perform that action at this time.
0 commit comments