From 7def87ae25df5e7508cf12f6fa469ea765857f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lugossy=20Zolt=C3=A1n?= <79148853+zolug@users.noreply.github.com> Date: Mon, 19 Dec 2022 11:31:52 +0100 Subject: [PATCH] Fix bridge setup delay for vlan mechanism (#674) Signed-off-by: Lugossy Zoltan Signed-off-by: Lugossy Zoltan --- pkg/networkservice/xconnect/l2bridgedomain/server.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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()