Merge branch '1.4'

This commit is contained in:
Bryan Boreham committed 2016-02-29 14:07:02 -08:00
commit 246f394731
2 files changed
+9 -8

No files matched your search

+8 -4
View File
@@ -765,10 +765,10 @@ func (fwd *fastDatapathForwarder) Forward(key ForwardPacketKey) FlowOp {
defer fwd.lock.RUnlock()
if fwd.remoteAddr == nil {
// Returning nil would discard the packet, but also
// result in a flow rule, which we would have to
// invalidate when we learn the remote IP. So for
// now, just prevent flows.
// Returning a DiscardingFlowOp would discard the
// packet, but also result in a flow rule, which we
// would have to invalidate when we learn the remote
// IP. So for now, just prevent flows.
return vetoFlowCreationFlowOp{}
}
@@ -1076,6 +1076,10 @@ func (fastdp *FastDatapath) send(fops FlowOp, frame []byte, lock *fastDatapathLo
case vetoFlowCreationFlowOp:
createFlow = false
default:
if xfop.Discards() {
continue
}
// A foreign FlowOp (e.g. a sleeve forwarding
// FlowOp), so send the packet through the
// FlowOp interface, decoding the packet
+1 -4
View File
@@ -84,15 +84,12 @@ func (mfop *MultiFlowOp) Discards() bool {
return true
}
// Flatten out a FlowOp to eliminate any MultiFlowOps
func FlattenFlowOp(fop FlowOp) []FlowOp {
return collectFlowOps(nil, fop)
}
func collectFlowOps(into []FlowOp, fop FlowOp) []FlowOp {
if fop == nil {
return into
}
if mfop, ok := fop.(*MultiFlowOp); ok {
for _, op := range mfop.ops {
into = collectFlowOps(into, op)