Skip to content

Commit

Permalink
Fix bridge setup delay for vlan mechanism (#674)
Browse files Browse the repository at this point in the history
Signed-off-by: Lugossy Zoltan <zoltan.lugossy@est.tech>

Signed-off-by: Lugossy Zoltan <zoltan.lugossy@est.tech>
  • Loading branch information
zolug authored Dec 19, 2022
1 parent 058c2aa commit 7def87a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/networkservice/xconnect/l2bridgedomain/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ func NewServer(vppConn api.Connection) networkservice.NetworkServiceServer {
}

func (v *l2BridgeDomainServer) Request(ctx context.Context, request *networkservice.NetworkServiceRequest) (*networkservice.Connection, error) {
vlanID, ok := vlan.Load(ctx, true)
// return if the belonging remote mechanism not vlan mechanism
if !ok || request.GetConnection().GetPayload() != payload.Ethernet {
if request.GetConnection().GetPayload() != payload.Ethernet {
return next.Server(ctx).Request(ctx, request)
}

Expand All @@ -59,6 +57,12 @@ func (v *l2BridgeDomainServer) Request(ctx context.Context, request *networkserv
return nil, err
}

// return if the belonging remote mechanism not vlan mechanism
vlanID, ok := vlan.Load(ctx, true)
if !ok {
return conn, nil
}

if err := addBridgeDomain(ctx, v.vppConn, &v.b, vlanID); err != nil {
closeCtx, cancelClose := postponeCtxFunc()
defer cancelClose()
Expand Down

0 comments on commit 7def87a

Please sign in to comment.