summaryrefslogtreecommitdiffstats
path: root/drivers/staging/bcm
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2014-07-29 16:52:13 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-30 17:14:22 -0700
commit7966988088f97b3643adf08f5c781806d55f5799 (patch)
treec6c566e7965c940dcd8b531a636085c2843d2af4 /drivers/staging/bcm
parent506da6a6f138e9702efc8a9075610768b067524c (diff)
downloadlinux-stable-7966988088f97b3643adf08f5c781806d55f5799.tar.gz
linux-stable-7966988088f97b3643adf08f5c781806d55f5799.tar.bz2
linux-stable-7966988088f97b3643adf08f5c781806d55f5799.zip
Staging: bcm: Qos.c: Replaced member accessing with variable in PruneQueue()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/bcm')
-rw-r--r--drivers/staging/bcm/Qos.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/staging/bcm/Qos.c b/drivers/staging/bcm/Qos.c
index 0eb78a8010fe..769adb7b32de 100644
--- a/drivers/staging/bcm/Qos.c
+++ b/drivers/staging/bcm/Qos.c
@@ -31,19 +31,30 @@ static VOID PruneQueue(struct bcm_mini_adapter *Adapter, INT iIndex);
*
* Returns - TRUE(If address matches) else FAIL .
*********************************************************************/
-static bool MatchSrcIpAddress(struct bcm_classifier_rule *pstClassifierRule, ULONG ulSrcIP)
+static bool MatchSrcIpAddress(struct bcm_classifier_rule *pstClassifierRule,
+ ULONG ulSrcIP)
{
UCHAR ucLoopIndex = 0;
struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
+ union u_ip_address *src_addr;
ulSrcIP = ntohl(ulSrcIP);
if (0 == pstClassifierRule->ucIPSourceAddressLength)
return TRUE;
for (ucLoopIndex = 0; ucLoopIndex < (pstClassifierRule->ucIPSourceAddressLength); ucLoopIndex++) {
- BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Src Ip Address Mask:0x%x PacketIp:0x%x and Classification:0x%x", (UINT)pstClassifierRule->stSrcIpAddress.ulIpv4Mask[ucLoopIndex], (UINT)ulSrcIP, (UINT)pstClassifierRule->stSrcIpAddress.ulIpv6Addr[ucLoopIndex]);
- if ((pstClassifierRule->stSrcIpAddress.ulIpv4Mask[ucLoopIndex] & ulSrcIP) ==
- (pstClassifierRule->stSrcIpAddress.ulIpv4Addr[ucLoopIndex] & pstClassifierRule->stSrcIpAddress.ulIpv4Mask[ucLoopIndex]))
+ src_addr = &pstClassifierRule->stSrcIpAddress;
+ BCM_DEBUG_PRINT(Adapter,
+ DBG_TYPE_TX,
+ IPV4_DBG,
+ DBG_LVL_ALL,
+ "Src Ip Address Mask:0x%x PacketIp:0x%x and Classification:0x%x",
+ (UINT)src_addr->ulIpv4Mask[ucLoopIndex],
+ (UINT)ulSrcIP,
+ (UINT)src_addr->ulIpv6Addr[ucLoopIndex]);
+
+ if ((src_addr->ulIpv4Mask[ucLoopIndex] & ulSrcIP) ==
+ (src_addr->ulIpv4Addr[ucLoopIndex] & src_addr->ulIpv4Mask[ucLoopIndex]))
return TRUE;
}
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Src Ip Address Not Matched");