Skip to content

Commit

Permalink
Fixed to remove rule VIP on state changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TrekkieCoder committed Feb 8, 2024
1 parent 6cd2a82 commit 99d0169
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion loxinet/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ func (R *RuleH) DeleteNatLbRule(serv cmn.LbServiceArg) (int, error) {
}
dev := fmt.Sprintf("llb-rule-%s", sNetAddr.IP.String())
ret, _ := mh.zr.L3.IfaFind(dev, sNetAddr.IP)
if ret != 0 {
if ret == 0 {
mh.zr.L3.IfaDelete(dev, sNetAddr.IP.String()+"/32")
}
delete(R.vipMap, sNetAddr.IP.String())
Expand Down Expand Up @@ -2539,6 +2539,11 @@ func (r *ruleEnt) DP(work DpWorkT) int {
func (R *RuleH) AdvRuleVIPIfL2(IP net.IP) error {
ciState, _ := mh.has.CIStateGetInst(cmn.CIDefault)
if ciState == "MASTER" {
dev := fmt.Sprintf("llb-rule-%s", IP.String())
ret, _ := mh.zr.L3.IfaFind(dev, IP)
if ret == 0 {
mh.zr.L3.IfaDelete(dev, IP.String()+"/32")
}
ev, _, iface := R.zone.L3.IfaSelectAny(IP, false)
if ev == 0 {
if !IsIPHostAddr(IP.String()) {
Expand Down

0 comments on commit 99d0169

Please sign in to comment.