Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Vijay Khemka and committed by
David S. Miller
7c7b58d4 e1027745

+9 -1
+9 -1
net/ncsi/ncsi-cmd.c
··· 369 369 eh = skb_push(nr->cmd, sizeof(*eh)); 370 370 eh->h_proto = htons(ETH_P_NCSI); 371 371 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); 373 381 374 382 /* Start the timer for the request that might not have 375 383 * corresponding response. Given NCSI is an internal