diff --git a/net/netbsd-tap/Makefile b/net/netbsd-tap/Makefile index 3fc1959a1665..e5492dd7b0e6 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 086e0191b3d7..572ae10ec6b4 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 -__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 04cc7c19f8cc..5cfd7a89aa01 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 -__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 #include @@ -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 610c13e9a874..bb456b9c587f 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