diff options
author | cube <cube@pkgsrc.org> | 2005-06-10 15:06:33 +0000 |
---|---|---|
committer | cube <cube@pkgsrc.org> | 2005-06-10 15:06:33 +0000 |
commit | 96065fa189b0780902b14eedbb9df245d0d667da (patch) | |
tree | dfbccb461bbff5efc37b2e8b9ce6db08327f9beb | |
parent | dae83bc787df7ee53e363a43ae23b8a3488f2c25 (diff) | |
download | pkgsrc-96065fa189b0780902b14eedbb9df245d0d667da.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.
-rw-r--r-- | net/netbsd-tap/Makefile | 4 | ||||
-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 |
4 files changed, 35 insertions, 9 deletions
diff --git a/net/netbsd-tap/Makefile b/net/netbsd-tap/Makefile index 3fc1959a166..e5492dd7b0e 100644 --- a/net/netbsd-tap/Makefile +++ b/net/netbsd-tap/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2005/03/24 22:39:07 cube Exp $ +# $NetBSD: Makefile,v 1.5 2005/06/10 15:06:33 cube Exp $ # This package relies on a correct configuration of pkgsrc WRT NetBSD # source directory information, otherwise the build will fail in a non- @@ -22,7 +22,7 @@ # aware that it can lead to some confusion of pkgsrc, which is why # MAKECONF was set to /dev/null in the first place. -DISTNAME= netbsd-tap-20050324 +DISTNAME= netbsd-tap-20050610 CATEGORIES= net MASTER_SITES= # empty DISTFILES= # empty 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 |