From f0547621d7c8c0c1d5db77bc54074ac9675f62aa Mon Sep 17 00:00:00 2001 From: Lionel Jouin Date: Wed, 23 Feb 2022 13:18:38 +0100 Subject: [PATCH] IPContext merged in begin chain element (#1231) Using the Client chain, the network service client cannot update the IPContext without the mergeConnectionContext function implemented. A NSC might want to update it if it needs to add, update or delete routes, src IP addresses (VIPs...), policies... Signed-off-by: Lionel Jouin --- pkg/networkservice/common/begin/merge.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/networkservice/common/begin/merge.go b/pkg/networkservice/common/begin/merge.go index 3d92174b9b..d92cc83f0c 100644 --- a/pkg/networkservice/common/begin/merge.go +++ b/pkg/networkservice/common/begin/merge.go @@ -36,7 +36,8 @@ func mergeConnection(returnedConnection, requestedConnection, connection *networ func mergeConnectionContext(returnedConnectionContext, requestedConnectionContext, connectioncontext *networkservice.ConnectionContext) *networkservice.ConnectionContext { rv := proto.Clone(connectioncontext).(*networkservice.ConnectionContext) if !proto.Equal(returnedConnectionContext, requestedConnectionContext) { - // TODO: IPContext, DNSContext, EthernetContext, do we need to do MTU? + // TODO: DNSContext, EthernetContext, do we need to do MTU? + rv.IpContext = requestedConnectionContext.IpContext rv.ExtraContext = mergeMapStringString(returnedConnectionContext.GetExtraContext(), requestedConnectionContext.GetExtraContext(), connectioncontext.GetExtraContext()) } return rv