diff --git a/pkg/networkservice/xconnect/l2bridgedomain/server.go b/pkg/networkservice/xconnect/l2bridgedomain/server.go index 8267936b..95abce15 100644 --- a/pkg/networkservice/xconnect/l2bridgedomain/server.go +++ b/pkg/networkservice/xconnect/l2bridgedomain/server.go @@ -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) } @@ -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()