pf_osfp.c (aae6f281) pf_osfp.c (bc77e309)
1/* $OpenBSD: pf_osfp.c,v 1.2 2003/08/27 16:13:21 frantzen Exp $ */
1/* $OpenBSD: pf_osfp.c,v 1.3 2003/08/27 18:23:36 frantzen Exp $ */
2
3/*
4 * Copyright (c) 2003 Mike Frantzen <frantzen@w4g.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *

--- 109 unchanged lines hidden (view full) ---

119 if (ip->ip_off & htons(IP_DF))
120 fp.fp_flags |= PF_OSFP_DF;
121 fp.fp_wsize = ntohs(tcp->th_win);
122
123
124 cnt = (tcp->th_off << 2) - sizeof(*tcp);
125 optp = (caddr_t)tcp + sizeof(*tcp);
126 for (; cnt > 0; cnt -= optlen, optp += optlen) {
2
3/*
4 * Copyright (c) 2003 Mike Frantzen <frantzen@w4g.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *

--- 109 unchanged lines hidden (view full) ---

119 if (ip->ip_off & htons(IP_DF))
120 fp.fp_flags |= PF_OSFP_DF;
121 fp.fp_wsize = ntohs(tcp->th_win);
122
123
124 cnt = (tcp->th_off << 2) - sizeof(*tcp);
125 optp = (caddr_t)tcp + sizeof(*tcp);
126 for (; cnt > 0; cnt -= optlen, optp += optlen) {
127 fp.fp_optcnt++;
128 if (*optp == TCPOPT_EOL)
129 break;
127 if (*optp == TCPOPT_EOL)
128 break;
130 else if (*optp == TCPOPT_NOP) {
129
130 fp.fp_optcnt++;
131 if (*optp == TCPOPT_NOP) {
131 fp.fp_tcpopts = (fp.fp_tcpopts << PF_OSFP_TCPOPT_BITS) |
132 PF_OSFP_TCPOPT_NOP;
133 optlen = 1;
134 } else {
135 if (cnt < 2)
136 return (NULL);
137 optlen = optp[1];
138 if (optlen > cnt || optlen < 2)

--- 385 unchanged lines hidden ---
132 fp.fp_tcpopts = (fp.fp_tcpopts << PF_OSFP_TCPOPT_BITS) |
133 PF_OSFP_TCPOPT_NOP;
134 optlen = 1;
135 } else {
136 if (cnt < 2)
137 return (NULL);
138 optlen = optp[1];
139 if (optlen > cnt || optlen < 2)

--- 385 unchanged lines hidden ---