Skip to content

Commit 309c803

Browse files
authored
Merge pull request #928 from eeeeeta/fix-generate-fwmark
fix unintentional Sprint of two-argument generateFwmark() call
2 parents a23017d + a2ac2f0 commit 309c803

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/controllers/proxy/service_endpoints_sync.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,12 @@ func (nsc *NetworkServicesController) setupExternalIPServices(serviceInfoMap ser
337337
externalIpServiceId = generateIpPortId(externalIP, svc.protocol, strconv.Itoa(svc.port))
338338

339339
// ensure there is NO iptables mangle table rule to FWMARK the packet
340-
fwMark := fmt.Sprint(generateFwmark(externalIP, svc.protocol, strconv.Itoa(svc.port)))
340+
fwmark, err := generateFwmark(externalIP, svc.protocol, strconv.Itoa(svc.port))
341+
if err != nil {
342+
glog.Errorf("Failed to generate a fwmark due to " + err.Error())
343+
continue
344+
}
345+
fwMark := fmt.Sprint(fwmark)
341346
err = nsc.ln.cleanupMangleTableRule(externalIP, svc.protocol, strconv.Itoa(svc.port), fwMark)
342347
if err != nil {
343348
glog.Errorf("Failed to verify and cleanup any mangle table rule to FMWARD the traffic to external IP due to " + err.Error())

0 commit comments

Comments
 (0)