diff options
author | cube <cube> | 2005-06-10 15:06:33 +0000 |
---|---|---|
committer | cube <cube> | 2005-06-10 15:06:33 +0000 |
commit | faea363e41f632781b0edc8619afb6e5df58fb29 (patch) | |
tree | dfbccb461bbff5efc37b2e8b9ce6db08327f9beb /net/netbsd-tap/files | |
parent | c613fb845138faef2ea439b813082eaca0d1d2b6 (diff) | |
download | pkgsrc-faea363e41f632781b0edc8619afb6e5df58fb29.tar.gz |
Sync with main tree:
- 1.8 (christos)
Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
- 1.9 (bouyer)
call (ifp->if_input) at splnet(). ifp->if_input points to ether_input()
which doesn't raise the IPL itself in all cases.
Should also fix PR 29546 (the pkgsrc kernel module needs to be updated).
Bump version to 20050610.
Diffstat (limited to 'net/netbsd-tap/files')
-rw-r--r-- | net/netbsd-tap/files/if_tap.c | 12 | ||||
-rw-r--r-- | net/netbsd-tap/files/if_tap_stub.c | 16 | ||||
-rw-r--r-- | net/netbsd-tap/files/if_tap_stub.h | 12 |
3 files changed, 33 insertions, 7 deletions
diff --git a/net/netbsd-tap/files/if_tap.c b/net/netbsd-tap/files/if_tap.c index 086e0191b3d..572ae10ec6b 100644 --- a/net/netbsd-tap/files/if_tap.c +++ b/net/netbsd-tap/files/if_tap.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_tap.c,v 1.5 2005/03/24 22:39:07 cube Exp $ */ +/* $NetBSD: if_tap.c,v 1.6 2005/06/10 15:06:33 cube Exp $ */ /* * Copyright (c) 2003, 2004 The NetBSD Foundation. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.5 2005/03/24 22:39:07 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.6 2005/06/10 15:06:33 cube Exp $"); #if defined(_KERNEL_OPT) #include "bpfilter.h" @@ -940,6 +940,7 @@ tap_dev_write(int unit, struct uio *uio, int flags) struct ifnet *ifp; struct mbuf *m, **mp; int error = 0; + int s; if (sc == NULL) return (ENXIO); @@ -980,7 +981,9 @@ tap_dev_write(int unit, struct uio *uio, int flags) if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m); #endif + s =splnet(); (*ifp->if_input)(ifp, m); + splx(s); return (0); } @@ -1380,7 +1383,6 @@ tap_ether_aton(u_char *dest, char *str) * @(#)if_ethersubr.c 8.2 (Berkeley) 4/4/96 */ -static char digits[] = "0123456789abcdef"; static char * tap_ether_sprintf(char *dest, const u_char *ap) { @@ -1388,8 +1390,8 @@ tap_ether_sprintf(char *dest, const u_char *ap) int i; for (i = 0; i < 6; i++) { - *cp++ = digits[*ap >> 4]; - *cp++ = digits[*ap++ & 0xf]; + *cp++ = tap_hexdigits[*ap >> 4]; + *cp++ = tap_hexdigits[*ap++ & 0xf]; *cp++ = ':'; } *--cp = 0; diff --git a/net/netbsd-tap/files/if_tap_stub.c b/net/netbsd-tap/files/if_tap_stub.c index 04cc7c19f8c..5cfd7a89aa0 100644 --- a/net/netbsd-tap/files/if_tap_stub.c +++ b/net/netbsd-tap/files/if_tap_stub.c @@ -1,7 +1,7 @@ -/* $NetBSD: if_tap_stub.c,v 1.2 2005/02/15 21:23:08 cube Exp $ */ +/* $NetBSD: if_tap_stub.c,v 1.3 2005/06/10 15:06:33 cube Exp $ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_tap_stub.c,v 1.2 2005/02/15 21:23:08 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tap_stub.c,v 1.3 2005/06/10 15:06:33 cube Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -12,6 +12,10 @@ __KERNEL_RCSID(0, "$NetBSD: if_tap_stub.c,v 1.2 2005/02/15 21:23:08 cube Exp $") #include "if_tap_stub.h" +/* + * fdclone() and friends + */ + /* 2.99.10 is gray area. Oh, well. */ #if __NetBSD_Version__ < 299001100 int @@ -47,3 +51,11 @@ tap_fbadop_stat(struct file *fp, struct stat *sb, struct proc *p) return EOPNOTSUPP; } #endif + +/* + * hexdigits + */ + +#if __NetBSD_Version__ < 399000400 +const char tap_hexdigits[] = "0123456789abcdef"; +#endif diff --git a/net/netbsd-tap/files/if_tap_stub.h b/net/netbsd-tap/files/if_tap_stub.h index 610c13e9a87..bb456b9c587 100644 --- a/net/netbsd-tap/files/if_tap_stub.h +++ b/net/netbsd-tap/files/if_tap_stub.h @@ -1,3 +1,6 @@ +/* + * fdclone() stuff + */ #if __NetBSD_Version__ < 299001100 int tap_fdclone(struct proc *, struct file *, int, int, struct fileops *, void *); int tap_fnullop_fcntl(struct file *, u_int, void *, struct proc *); @@ -12,3 +15,12 @@ int tap_fbadop_stat(struct file *, struct stat *, struct proc *); #define tap_fnullop_fcntl fnullop_fcntl #define tap_fbadop_stat fbadop_stat #endif + +/* + * hexdigits + */ +#if __NetBSD_Version__ < 399000400 +extern const char tap_hexdigits[]; +#else +#define tap_hexdigits hexdigits +#endif |