diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-06-19 10:49:06 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-06-19 10:49:06 +0000 |
commit | d70fd816bbcfe3ed69974e4c2a2dd94318c675c9 (patch) | |
tree | e22f42933007cdc51a24f72c0b3ce59b9010138b /sys | |
parent | b52e878a65d6ee6a4e9cfd6e83afef25533c9242 (diff) |
ensure urgent is within window; TCP/IP Illustrated Vol 2, checked by Andreas.Gunnarsson@emw.ericsson.se
Diffstat (limited to 'sys')
-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 /* |