summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/lib/ipft_tx.c
diff options
context:
space:
mode:
authordarrenr <darrenr@FreeBSD.org>2007-10-18 21:42:51 +0000
committerdarrenr <darrenr@FreeBSD.org>2007-10-18 21:42:51 +0000
commit71e82d94e82560b20789833f60056506de34de8b (patch)
treeda6aaa7272c76c9c4cad931122fd1f4e4db237a5 /contrib/ipfilter/lib/ipft_tx.c
parente2e28d4361fc9bdb67694eedaf349bdc7ca088a3 (diff)
downloadFreeBSD-src-71e82d94e82560b20789833f60056506de34de8b.zip
FreeBSD-src-71e82d94e82560b20789833f60056506de34de8b.tar.gz
Import IPFilter 4.1.28
Diffstat (limited to 'contrib/ipfilter/lib/ipft_tx.c')
-rw-r--r--contrib/ipfilter/lib/ipft_tx.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/contrib/ipfilter/lib/ipft_tx.c b/contrib/ipfilter/lib/ipft_tx.c
index 302f177..5dc65b4 100644
--- a/contrib/ipfilter/lib/ipft_tx.c
+++ b/contrib/ipfilter/lib/ipft_tx.c
@@ -3,11 +3,11 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * $Id: ipft_tx.c,v 1.15.2.9 2006/06/16 17:21:04 darrenr Exp $
+ * $Id: ipft_tx.c,v 1.15.2.10 2007/09/03 21:54:44 darrenr Exp $
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ipft_tx.c 1.7 6/5/96 (C) 1993 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ipft_tx.c,v 1.15.2.9 2006/06/16 17:21:04 darrenr Exp $";
+static const char rcsid[] = "@(#)$Id: ipft_tx.c,v 1.15.2.10 2007/09/03 21:54:44 darrenr Exp $";
#endif
#include <ctype.h>
@@ -257,19 +257,30 @@ int *out;
}
ip->ip_dst.s_addr = tx_hostnum(*cpp, &r);
cpp++;
- if (*cpp && ip->ip_p == IPPROTO_TCP) {
- char *s, *t;
-
- tcp->th_flags = 0;
- for (s = *cpp; *s; s++)
- if ((t = strchr(myflagset, *s)))
- tcp->th_flags |= myflags[t - myflagset];
- if (tcp->th_flags)
- cpp++;
- if (tcp->th_flags == 0)
- abort();
+ if (ip->ip_p == IPPROTO_TCP) {
+ if (*cpp != NULL) {
+ char *s, *t;
+
+ tcp->th_flags = 0;
+ for (s = *cpp; *s; s++)
+ if ((t = strchr(myflagset, *s)))
+ tcp->th_flags |= myflags[t-myflagset];
+ if (tcp->th_flags)
+ cpp++;
+ }
+
if (tcp->th_flags & TH_URG)
tcp->th_urp = htons(1);
+
+ if (*cpp && !strncasecmp(*cpp, "seq=", 4)) {
+ tcp->th_seq = htonl(atoi(*cpp + 4));
+ cpp++;
+ }
+
+ if (*cpp && !strncasecmp(*cpp, "ack=", 4)) {
+ tcp->th_ack = htonl(atoi(*cpp + 4));
+ cpp++;
+ }
} else if (*cpp && ip->ip_p == IPPROTO_ICMP) {
extern char *tx_icmptypes[];
char **s, *t;
OpenPOWER on IntegriCloud