Skip to content

Commit 81bc9e2

Browse files
committed
fix(nsc): don't modify netmask during flag setup
There is absolutely no reason that we should ever assume netmasks, and even if we did, we shouldn't modify them as a side-effect of a completely different operation. No idea was this was ever coded this way. Netmask is now set upstream to the appropriate mask for the IP family.
1 parent 903466b commit 81bc9e2

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

pkg/controllers/proxy/network_services_controller.go

-9
Original file line numberDiff line numberDiff line change
@@ -1421,11 +1421,9 @@ func ipvsDestinationString(d *ipvs.Destination) string {
14211421
func ipvsSetPersistence(svc *ipvs.Service, p bool, timeout int32) {
14221422
if p {
14231423
svc.Flags |= ipvsPersistentFlagHex
1424-
svc.Netmask |= 0xFFFFFFFF
14251424
svc.Timeout = uint32(timeout)
14261425
} else {
14271426
svc.Flags &^= ipvsPersistentFlagHex
1428-
svc.Netmask &^= 0xFFFFFFFF
14291427
svc.Timeout = 0
14301428
}
14311429
}
@@ -1448,13 +1446,6 @@ func ipvsSetSchedFlags(svc *ipvs.Service, s schedFlags) {
14481446
} else {
14491447
svc.Flags &^= ipvsSched3FlagHex
14501448
}
1451-
1452-
/* Keep netmask which is set by ipvsSetPersistence() before */
1453-
if (svc.Netmask&0xFFFFFFFF != 0) || (s.flag1 || s.flag2 || s.flag3) {
1454-
svc.Netmask |= 0xFFFFFFFF
1455-
} else {
1456-
svc.Netmask &^= 0xFFFFFFFF
1457-
}
14581449
}
14591450

14601451
/* Compare service scheduler flags with ipvs service */

0 commit comments

Comments
 (0)