diff options
author | 1997-06-19 10:49:05 +0000 | |
---|---|---|
committer | 1997-06-19 10:49:05 +0000 | |
commit | dcba40da1cadf2ef45ca4b415f9512c568650e6a (patch) | |
tree | 704f87d32867f03620148ce8b44b9a0ce8b7b093 /sys/netinet/tcp_output.c | |
parent | Xr nice (diff) | |
download | wireguard-openbsd-dcba40da1cadf2ef45ca4b415f9512c568650e6a.tar.xz wireguard-openbsd-dcba40da1cadf2ef45ca4b415f9512c568650e6a.zip |
ensure urgent is within window; TCP/IP Illustrated Vol 2, checked by Andreas.Gunnarsson@emw.ericsson.se
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r-- | sys/netinet/tcp_output.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index a95235a342c..8cf04f566aa 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tcp_output.c,v 1.5 1996/09/12 06:36:57 tholo Exp $ */ -/* $NetBSD: tcp_output.c,v 1.14 1996/02/13 23:43:53 christos Exp $ */ +/* $OpenBSD: tcp_output.c,v 1.6 1997/06/19 10:49:05 deraadt Exp $ */ +/* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 @@ -467,7 +467,10 @@ send: win = 0; ti->ti_win = htons((u_int16_t) (win>>tp->rcv_scale)); if (SEQ_GT(tp->snd_up, tp->snd_nxt)) { - ti->ti_urp = htons((u_int16_t)(tp->snd_up - tp->snd_nxt)); + u_int32_t urp = tp->snd_up - tp->snd_nxt; + if (urp > IP_MAXPACKET) + urp = IP_MAXPACKET; + ti->ti_urp = htons((u_int16_t)urp); ti->ti_flags |= TH_URG; } else /* |