wlan: Fix probe response dropped by ValidateAndRectifyIEs

Some APs will include extra bytes with 0 value after IEs in probe
response. ValidateAndRectifyIEs() takes it as malformed packet due
to which driver drops the packet.

This change introduces a workaround to interop with such AP's by
making ValidateAndRectifyIEs() returning TRUE if extra bytes are
all 0 value.

Change-Id: Ifdf8d6a1d0c7296713fc23d002beed8a6ac29cc7
CRs-Fixed: 984851
diff --git a/CORE/SYS/legacy/src/utils/src/parserApi.c b/CORE/SYS/legacy/src/utils/src/parserApi.c
index eb65a7d..fd22112 100644
--- a/CORE/SYS/legacy/src/utils/src/parserApi.c
+++ b/CORE/SYS/legacy/src/utils/src/parserApi.c
@@ -2108,7 +2108,27 @@
                        FL("Added RSN Capability to the RSNIE as 0x00 0x00"));
 
                 return eHAL_STATUS_SUCCESS;
+            } else {
+                /* Workaround: Some APs may add extra 0x00 padding after IEs.
+                 * Return true to allow these probe response frames proceed.
+                 */
+                if (nFrameBytes - length > 0) {
+                    tANI_U32 i;
+                    tANI_BOOLEAN zero_padding = VOS_TRUE;
+
+                    for (i = length; i < nFrameBytes; i ++) {
+                        if (pMgmtFrame[i-1] != 0x0) {
+                            zero_padding = VOS_FALSE;
+                            break;
+                        }
+                    }
+
+                    if (zero_padding) {
+                        return eHAL_STATUS_SUCCESS;
+                    }
+                }
             }
+
             return eSIR_FAILURE;
         }
     }