summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorVijay Khemka <vijaykhemka@fb.com>2020-01-07 11:30:33 -0800
committerDavid S. Miller <davem@davemloft.net>2020-01-08 13:09:18 -0800
commit7c7b58d46b7636ff3cfb01cc633dda852fda70c8 (patch)
tree0d8c7212dd2b994ddfc690cc04e4245f1ea9794a /net
parente102774588b3ac0d221ed2d03a5153e056f1354f (diff)
net/ncsi: Send device address as source address
After receiving device mac address from device, send this as a source address for further commands instead of broadcast address. This will help in multi host NIC cards. Signed-off-by: Vijay Khemka <vijaykhemka@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ncsi/ncsi-cmd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/ncsi/ncsi-cmd.c b/net/ncsi/ncsi-cmd.c
index 0187e65176c0..ba9ae482141b 100644
--- a/net/ncsi/ncsi-cmd.c
+++ b/net/ncsi/ncsi-cmd.c
@@ -369,7 +369,15 @@ int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca)
eh = skb_push(nr->cmd, sizeof(*eh));
eh->h_proto = htons(ETH_P_NCSI);
eth_broadcast_addr(eh->h_dest);
- eth_broadcast_addr(eh->h_source);
+
+ /* If mac address received from device then use it for
+ * source address as unicast address else use broadcast
+ * address as source address
+ */
+ if (nca->ndp->gma_flag == 1)
+ memcpy(eh->h_source, nca->ndp->ndev.dev->dev_addr, ETH_ALEN);
+ else
+ eth_broadcast_addr(eh->h_source);
/* Start the timer for the request that might not have
* corresponding response. Given NCSI is an internal