[VOL-4706] Tollerate table attributes in MIB Upload Next responses
Change-Id: Iddc07665cd0b71c8ddc5f2557094ab2db8d34061
diff --git a/internal/pkg/common/omci_cc.go b/internal/pkg/common/omci_cc.go
index 4505474..ffe44ea 100755
--- a/internal/pkg/common/omci_cc.go
+++ b/internal/pkg/common/omci_cc.go
@@ -24,6 +24,7 @@
"encoding/hex"
"fmt"
"strconv"
+ "strings"
"sync"
"time" //by now for testing
@@ -4690,8 +4691,18 @@
} else if failure := (*packet).ErrorLayer(); failure != nil {
// message layer could not be decoded, but at least check if additional failure information is available
if decodeFailure, ok := failure.(*gopacket.DecodeFailure); ok && decodeFailure != nil {
+ errMsg := decodeFailure.String()
+ if nextLayer == omci.LayerTypeMibUploadNextResponse {
+ if strings.Contains(strings.ToLower(errMsg), "table decode") {
+ // In the case of MibUploadNextResponse with non-standard table attributes, we let the packet pass
+ // so that later processing can deal with it
+ logger.Infow(ctx, "omci-message: MibUploadNextResponse packet with table attributes - let it pass",
+ log.Fields{"device-id": oo.deviceID, "error": failure.Error()})
+ return false, nil
+ }
+ }
logger.Errorw(ctx, "omci-message: could not decode msgLayer of packet, further info available - skip it!",
- log.Fields{"device-id": oo.deviceID, "error": failure.Error(), "decodeFailure": decodeFailure.String()})
+ log.Fields{"device-id": oo.deviceID, "error": failure.Error(), "decodeFailure": errMsg})
return false, fmt.Errorf("could not decode msgLayer of packet, further info available - %s", oo.deviceID)
}
logger.Errorw(ctx, "omci-message: could not decode msgLayer of packet, ErrorLayer available",