Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bridge setup delay for vlan mechanism #674

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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