Minor changes to allow libnetwork to compile on FreeBSD

This commit is contained in:
Hongjiang Zhang 2017-05-15 14:08:34 +08:00 committed by R. Tyler Croy
parent bab4b7e1ff
commit 3ed6a3a883
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
3 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,4 @@
// +build !freebsd
package iptables
import (

View File

@ -1,4 +1,4 @@
// +build !windows
// +build !windows,!freebsd
package libnetwork

View File

@ -18,6 +18,26 @@ func (c *controller) rmServiceBinding(name, sid, nid, eid string, vip net.IP, in
return fmt.Errorf("not supported")
}
func (c *controller) getLBIndex(sid, nid string, ingressPorts []*PortConfig) int {
skey := serviceKey{
id: sid,
ports: portConfigs(ingressPorts).String(),
}
c.Lock()
s, ok := c.serviceBindings[skey]
c.Unlock()
if !ok {
return 0
}
s.Lock()
lb := s.loadBalancers[nid]
s.Unlock()
return int(lb.fwMark)
}
func (sb *sandbox) populateLoadbalancers(ep *endpoint) {
}