Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Fix off by one in ether_aton_r(). Noticed by "arp i...



details:   https://anonhg.NetBSD.org/src/rev/9574a8bfad57
branches:  trunk
changeset: 760738:9574a8bfad57
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Jan 12 15:30:40 2011 +0000

description:
Fix off by one in ether_aton_r().  Noticed by "arp info overwritten" warning.
(how could it be missed for months?)

diffstat:

 sys/net/if_ethersubr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r e026f2b9d312 -r 9574a8bfad57 sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c    Wed Jan 12 12:52:16 2011 +0000
+++ b/sys/net/if_ethersubr.c    Wed Jan 12 15:30:40 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ethersubr.c,v 1.184 2010/11/17 00:20:49 dyoung Exp $        */
+/*     $NetBSD: if_ethersubr.c,v 1.185 2011/01/12 15:30:40 tsutsui Exp $       */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.184 2010/11/17 00:20:49 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.185 2011/01/12 15:30:40 tsutsui Exp $");
 
 #include "opt_inet.h"
 #include "opt_atalk.h"
@@ -1250,7 +1250,7 @@
         const u_char *cp = (const void *)str;
        u_char *ep;
 
-#define atox(c)        (((c) < '9') ? ((c) - '0') : ((toupper(c) - 'A') + 10))
+#define atox(c)        (((c) <= '9') ? ((c) - '0') : ((toupper(c) - 'A') + 10))
 
        if (len < ETHER_ADDR_LEN)
                return ENOSPC;



Home | Main Index | Thread Index | Old Index