Commit 687a25f1cdfc6ee1f2f60f299dbd294908eb0d59
Committed by
David S. Miller
1 parent
a592ea6362
Exists in
master
and in
7 other branches
[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>
Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff
net/tipc/eth_media.c
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | * net/tipc/eth_media.c: Ethernet bearer support for TIPC |
3 | 3 | * |
4 | 4 | * Copyright (c) 2001-2006, Ericsson AB |
5 | - * Copyright (c) 2005, Wind River Systems | |
5 | + * Copyright (c) 2005-2006, Wind River Systems | |
6 | 6 | * All rights reserved. |
7 | 7 | * |
8 | 8 | * Redistribution and use in source and binary forms, with or without |
... | ... | @@ -127,8 +127,7 @@ |
127 | 127 | |
128 | 128 | /* Find device with specified name */ |
129 | 129 | |
130 | - while (dev && dev->name && | |
131 | - (memcmp(dev->name, driver_name, strlen(dev->name)))) { | |
130 | + while (dev && dev->name && strncmp(dev->name, driver_name, IFNAMSIZ)) { | |
132 | 131 | dev = dev->next; |
133 | 132 | } |
134 | 133 | if (!dev) |