fix bug when adding ip rule for fwmark (#1178)

Co-authored-by: Kailun Shi <kailun.shi@bytedance.com>
This commit is contained in:
Kailun 2021-11-05 06:12:24 -07:00 committed by GitHub
parent 55a0dd10a6
commit bee2c2089f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1907,7 +1907,7 @@ func routeVIPTrafficToDirector(fwmark string) error {
if err != nil {
return errors.New("Failed to verify if `ip rule` exists due to: " + err.Error())
}
if !strings.Contains(string(out), fwmark) {
if !strings.Contains(string(out), fwmark+" ") {
err = exec.Command("ip", "rule", "add", "prio", "32764", "fwmark", fwmark, "table",
customDSRRouteTableID).Run()
if err != nil {