diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2006-06-26 08:43:21 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-06-26 08:43:21 +0200 |
commit | 687a25f1cdfc6ee1f2f60f299dbd294908eb0d59 (patch) | |
tree | ca7953096dcc44c8250fc18d0a6eb0e28d97d33f /net/tipc | |
parent | [TIPC]: Added support for MODULE_VERSION capability. (diff) | |
download | linux-687a25f1cdfc6ee1f2f60f299dbd294908eb0d59.tar.xz linux-687a25f1cdfc6ee1f2f60f299dbd294908eb0d59.zip |
[TIPC]: Validate entire interface name when locating bearer to enable.
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>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/eth_media.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c index 3ecb1006a42d..682da4a28041 100644 --- a/net/tipc/eth_media.c +++ b/net/tipc/eth_media.c @@ -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 @@ -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) |