Skip to content

Commit 7c7b58d

Browse files
vijaykhemkadavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e102774 commit 7c7b58d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

net/ncsi/ncsi-cmd.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,15 @@ int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca)
369369
eh = skb_push(nr->cmd, sizeof(*eh));
370370
eh->h_proto = htons(ETH_P_NCSI);
371371
eth_broadcast_addr(eh->h_dest);
372-
eth_broadcast_addr(eh->h_source);
372+
373+
/* If mac address received from device then use it for
374+
* source address as unicast address else use broadcast
375+
* address as source address
376+
*/
377+
if (nca->ndp->gma_flag == 1)
378+
memcpy(eh->h_source, nca->ndp->ndev.dev->dev_addr, ETH_ALEN);
379+
else
380+
eth_broadcast_addr(eh->h_source);
373381

374382
/* Start the timer for the request that might not have
375383
* corresponding response. Given NCSI is an internal

0 commit comments

Comments
 (0)