From bbf786885cf31f407ce30bf0ced6ddf371f430db Mon Sep 17 00:00:00 2001 From: Sony Chacko Date: Thu, 19 Aug 2010 05:08:27 +0000 Subject: [PATCH] --- yaml --- r: 213875 b: refs/heads/master c: fe4d434da8e96142e36eb22fc5cf29ef2c2df9c2 h: refs/heads/master i: 213873: 33a747276636b41c174393eaf28ebba43bd09231 213871: 258e52853bc89480631ac353998a177283b7ce2e v: v3 --- [refs] | 2 +- trunk/drivers/net/qlcnic/qlcnic.h | 1 + trunk/drivers/net/qlcnic/qlcnic_main.c | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c762a0dcdfa7..c63cfd3a3433 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0325d69b2a1feb72f11413dbfcc1705ccfc203c1 +refs/heads/master: fe4d434da8e96142e36eb22fc5cf29ef2c2df9c2 diff --git a/trunk/drivers/net/qlcnic/qlcnic.h b/trunk/drivers/net/qlcnic/qlcnic.h index 9433a05555f1..b58c4119f279 100644 --- a/trunk/drivers/net/qlcnic/qlcnic.h +++ b/trunk/drivers/net/qlcnic/qlcnic.h @@ -900,6 +900,7 @@ struct qlcnic_mac_req { #define QLCNIC_BRIDGE_ENABLED 0X10 #define QLCNIC_DIAG_ENABLED 0x20 #define QLCNIC_ESWITCH_ENABLED 0x40 +#define QLCNIC_MACSPOOF 0x200 #define QLCNIC_IS_MSI_FAMILY(adapter) \ ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) diff --git a/trunk/drivers/net/qlcnic/qlcnic_main.c b/trunk/drivers/net/qlcnic/qlcnic_main.c index aa1f6b3c3b80..de4be00e31e5 100644 --- a/trunk/drivers/net/qlcnic/qlcnic_main.c +++ b/trunk/drivers/net/qlcnic/qlcnic_main.c @@ -762,6 +762,11 @@ static void qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter, struct qlcnic_esw_func_cfg *esw_cfg) { + adapter->flags &= ~QLCNIC_MACSPOOF; + if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC) + if (esw_cfg->mac_anti_spoof) + adapter->flags |= QLCNIC_MACSPOOF; + qlcnic_set_netdev_features(adapter, esw_cfg); } @@ -1912,6 +1917,12 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) return NETDEV_TX_BUSY; } + if (adapter->flags & QLCNIC_MACSPOOF) { + if (compare_ether_addr(eth_hdr(skb)->h_source, + adapter->mac_addr)) + goto drop_packet; + } + frag_count = skb_shinfo(skb)->nr_frags + 1; /* 4 fragments per cmd des */