Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167761742
D21302.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D21302.diff
View Options
Index: head/sys/net/if_tuntap.c
===================================================================
--- head/sys/net/if_tuntap.c
+++ head/sys/net/if_tuntap.c
@@ -110,7 +110,6 @@
u_short tun_flags; /* misc flags */
#define TUN_OPEN 0x0001
#define TUN_INITED 0x0002
-#define TUN_RCOLL 0x0004
#define TUN_IASET 0x0008
#define TUN_DSTADDR 0x0010
#define TUN_LMODE 0x0020
@@ -168,9 +167,9 @@
SYSCTL_DECL(_net_link);
/* tun */
static SYSCTL_NODE(_net_link, OID_AUTO, tun, CTLFLAG_RW, 0,
- "IP tunnel software network interface.");
+ "IP tunnel software network interface");
SYSCTL_INT(_net_link_tun, OID_AUTO, devfs_cloning, CTLFLAG_RWTUN, &tundclone, 0,
- "Enable legacy devfs interface creation.");
+ "Enable legacy devfs interface creation");
/* tap */
static SYSCTL_NODE(_net_link, OID_AUTO, tap, CTLFLAG_RW, 0,
@@ -442,7 +441,7 @@
return (ENXIO);
if (unit != -1) {
- /* If this unit number is still available that/s okay. */
+ /* If this unit number is still available that's okay. */
if (alloc_unr_specific(drv->unrhdr, unit) == -1)
return (EEXIST);
} else {
@@ -1435,22 +1434,22 @@
tp->tun_flags &= ~TUN_RWAIT;
- do {
+ for (;;) {
IFQ_DEQUEUE(&ifp->if_snd, m);
- if (m == NULL) {
- if (flag & O_NONBLOCK) {
- TUN_UNLOCK(tp);
- return (EWOULDBLOCK);
- }
- tp->tun_flags |= TUN_RWAIT;
- error = mtx_sleep(tp, &tp->tun_mtx, PCATCH | (PZERO + 1),
- "tunread", 0);
- if (error != 0) {
- TUN_UNLOCK(tp);
- return (error);
- }
+ if (m != NULL)
+ break;
+ if (flag & O_NONBLOCK) {
+ TUN_UNLOCK(tp);
+ return (EWOULDBLOCK);
}
- } while (m == NULL);
+ tp->tun_flags |= TUN_RWAIT;
+ error = mtx_sleep(tp, &tp->tun_mtx, PCATCH | (PZERO + 1),
+ "tunread", 0);
+ if (error != 0) {
+ TUN_UNLOCK(tp);
+ return (error);
+ }
+ }
TUN_UNLOCK(tp);
if ((tp->tun_flags & TUN_L2) != 0)
@@ -1629,8 +1628,7 @@
}
IFQ_UNLOCK(&ifp->if_snd);
}
- if (events & (POLLOUT | POLLWRNORM))
- revents |= events & (POLLOUT | POLLWRNORM);
+ revents |= events & (POLLOUT | POLLWRNORM);
return (revents);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 25, 8:51 AM (37 m, 17 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37228779
Default Alt Text
D21302.diff (2 KB)
Attached To
Mode
D21302: if_tuntap: minor improvements
Attached
Detach File
Event Timeline
Log In to Comment