diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-06-27 23:00:25 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-06-27 23:00:25 -0700 |
| commit | 31881d74b6dd1a6c530cff61248def4f2da38bee (patch) | |
| tree | be62420cf39192074e13b25553d172b9d5e58a33 /net/core/utils.c | |
| parent | 8855f30cd2b68012571932c7b01290c20be4508c (diff) | |
| parent | 257867dc8d893690c175c1f717f91c3b6d44a63d (diff) | |
Merge branch 'for-next' of git://github.com/rydberg/linux into next
Pull in changes from Henrik: "a trivial MT documentation fix".
Diffstat (limited to 'net/core/utils.c')
| -rw-r--r-- | net/core/utils.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/core/utils.c b/net/core/utils.c index e3487e46193..3c7f5b51b97 100644 --- a/net/core/utils.c +++ b/net/core/utils.c @@ -17,6 +17,7 @@ #include <linux/module.h> #include <linux/jiffies.h> #include <linux/kernel.h> +#include <linux/ctype.h> #include <linux/inet.h> #include <linux/mm.h> #include <linux/net.h> @@ -348,9 +349,7 @@ int mac_pton(const char *s, u8 *mac) /* Don't dirty result unless string is valid MAC. */ for (i = 0; i < ETH_ALEN; i++) { - if (!strchr("0123456789abcdefABCDEF", s[i * 3])) - return 0; - if (!strchr("0123456789abcdefABCDEF", s[i * 3 + 1])) + if (!isxdigit(s[i * 3]) || !isxdigit(s[i * 3 + 1])) return 0; if (i != ETH_ALEN - 1 && s[i * 3 + 2] != ':') return 0; |
