summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorAjit Khaparde <ajit.khaparde@broadcom.com>2019-10-02 16:25:51 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-08 12:14:31 +0200
commit40724480038911ecc3b1c7a2b5a57ecc3e793ffd (patch)
treee2b1f0822d1b491b3321debc196688d614bc9c3a /drivers/net
parent988562f0b7a6085fa9fa1b8c68efacd722c60c31 (diff)
downloaddpdk-40724480038911ecc3b1c7a2b5a57ecc3e793ffd.zip
dpdk-40724480038911ecc3b1c7a2b5a57ecc3e793ffd.tar.gz
dpdk-40724480038911ecc3b1c7a2b5a57ecc3e793ffd.tar.xz
net/bnxt: allow only unicast MAC address filter creation
Check if the application is trying to create filters using broadcast and multicast MAC address and reject it. Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com> Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bnxt/bnxt_flow.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 2e2b21d..4e6b4d7 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -219,6 +219,14 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
}
if (rte_is_broadcast_ether_addr(&eth_mask->dst)) {
+ if (!rte_is_unicast_ether_addr(&eth_spec->dst)) {
+ rte_flow_error_set(error,
+ EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "DMAC is invalid");
+ return -rte_errno;
+ }
rte_memcpy(filter->dst_macaddr,
&eth_spec->dst, RTE_ETHER_ADDR_LEN);
en |= use_ntuple ?
@@ -233,6 +241,14 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
}
if (rte_is_broadcast_ether_addr(&eth_mask->src)) {
+ if (!rte_is_unicast_ether_addr(&eth_spec->src)) {
+ rte_flow_error_set(error,
+ EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "SMAC is invalid");
+ return -rte_errno;
+ }
rte_memcpy(filter->src_macaddr,
&eth_spec->src, RTE_ETHER_ADDR_LEN);
en |= use_ntuple ?