Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168963
b: refs/heads/master
c: 3e98484
h: refs/heads/master
i:
  168961: 2ee9e0b
  168959: 490e891
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 24, 2009
1 parent 7032539 commit e8d13da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c2acc53fd7987493f11640e266cf7130591e764
refs/heads/master: 3e9848403ad59c53b31facb30b43ca80135ae0b9
16 changes: 11 additions & 5 deletions trunk/net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static const char version[] =
static int pktgen_remove_device(struct pktgen_thread *t, struct pktgen_dev *i);
static int pktgen_add_device(struct pktgen_thread *t, const char *ifname);
static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
const char *ifname);
const char *ifname, bool exact);
static int pktgen_device_event(struct notifier_block *, unsigned long, void *);
static void pktgen_run_all_threads(void);
static void pktgen_reset_all_threads(void);
Expand Down Expand Up @@ -1818,9 +1818,10 @@ static struct pktgen_dev *__pktgen_NN_threads(const char *ifname, int remove)
{
struct pktgen_thread *t;
struct pktgen_dev *pkt_dev = NULL;
bool exact = (remove == FIND);

list_for_each_entry(t, &pktgen_threads, th_list) {
pkt_dev = pktgen_find_dev(t, ifname);
pkt_dev = pktgen_find_dev(t, ifname, exact);
if (pkt_dev) {
if (remove) {
if_lock(t);
Expand Down Expand Up @@ -3567,13 +3568,18 @@ static int pktgen_thread_worker(void *arg)
}

static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
const char *ifname)
const char *ifname, bool exact)
{
struct pktgen_dev *p, *pkt_dev = NULL;
if_lock(t);
size_t len = strlen(ifname);

if_lock(t);
list_for_each_entry(p, &t->if_list, list)
if (strncmp(p->odevname, ifname, IFNAMSIZ) == 0) {
if (strncmp(p->odevname, ifname, len) == 0) {
if (p->odevname[len]) {
if (exact || p->odevname[len] != '@')
continue;
}
pkt_dev = p;
break;
}
Expand Down

0 comments on commit e8d13da

Please sign in to comment.