Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64992
b: refs/heads/master
c: ce5d0b4
h: refs/heads/master
v: v3
  • Loading branch information
Adit Ranadive authored and David S. Miller committed Sep 16, 2007
1 parent 996eb09 commit e2d2f8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6ae5f983cf8de769214d2d9e8a783c881eccd4cd
refs/heads/master: ce5d0b47f13f83dfb9fbb8ac91adad7120747aaf
10 changes: 10 additions & 0 deletions trunk/net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
*
* 802.1Q/Q-in-Q support by Francesco Fondelli (FF) <francesco.fondelli@gmail.com>
*
* Fixed src_mac command to set source mac of packet to value specified in
* command by Adit Ranadive <adit.262@gmail.com>
*
*/
#include <linux/sys.h>
#include <linux/types.h>
Expand Down Expand Up @@ -1451,8 +1454,11 @@ static ssize_t pktgen_if_write(struct file *file,
}
if (!strcmp(name, "src_mac")) {
char *v = valstr;
unsigned char old_smac[ETH_ALEN];
unsigned char *m = pkt_dev->src_mac;

memcpy(old_smac, pkt_dev->src_mac, ETH_ALEN);

len = strn_len(&user_buffer[i], sizeof(valstr) - 1);
if (len < 0) {
return len;
Expand Down Expand Up @@ -1481,6 +1487,10 @@ static ssize_t pktgen_if_write(struct file *file,
}
}

/* Set up Src MAC */
if (compare_ether_addr(old_smac, pkt_dev->src_mac))
memcpy(&(pkt_dev->hh[6]), pkt_dev->src_mac, ETH_ALEN);

sprintf(pg_result, "OK: srcmac");
return count;
}
Expand Down

0 comments on commit e2d2f8e

Please sign in to comment.