Skip to content

Commit

Permalink
net/ncsi: Send device address as source address
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
vijaykhemka authored and davem330 committed Jan 8, 2020
1 parent e102774 commit 7c7b58d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion net/ncsi/ncsi-cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7c7b58d

Please sign in to comment.