Skip to content

Commit

Permalink
[TIPC]: Validate entire interface name when locating bearer to enable.
Browse files Browse the repository at this point in the history
This fix prevents a bearer from being enabled using the wrong interface.
For example, specifying "eth:eth14" might enable "eth:eth1" by mistake.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
  • Loading branch information
Allan Stephens authored and David S. Miller committed Jun 26, 2006
1 parent a592ea6 commit 687a25f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/tipc/eth_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* net/tipc/eth_media.c: Ethernet bearer support for TIPC
*
* Copyright (c) 2001-2006, Ericsson AB
* Copyright (c) 2005, Wind River Systems
* Copyright (c) 2005-2006, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -127,8 +127,7 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)

/* Find device with specified name */

while (dev && dev->name &&
(memcmp(dev->name, driver_name, strlen(dev->name)))) {
while (dev && dev->name && strncmp(dev->name, driver_name, IFNAMSIZ)) {
dev = dev->next;
}
if (!dev)
Expand Down

0 comments on commit 687a25f

Please sign in to comment.