Deleted Added
full compact
0a1
> /* $FreeBSD: head/sys/contrib/pf/net/pf_norm.c 126261 2004-02-26 02:34:12Z mlaier $ */
27a29,35
> #if defined(__FreeBSD__)
> #include "opt_inet.h"
> #include "opt_inet6.h"
> #include "opt_random_ip_id.h" /* or ip_var does not export it */
> #include "opt_pf.h"
> #define NPFLOG DEV_PFLOG
> #else
28a37
> #endif
37a47
> #if !defined(__FreeBSD__)
38a49
> #endif
39a51
> #if !defined(__FreeBSD__)
40a53
> #endif
62a76,118
> #if defined(__FreeBSD__) && defined(INET6)
> /*
> * XXX: This should go to netinet/ip6.h (KAME)
> */
> /* IPv6 options: common part */
> struct ip6_opt {
> u_int8_t ip6o_type;
> u_int8_t ip6o_len;
> } __packed;
>
> /* Jumbo Payload Option */
> struct ip6_opt_jumbo {
> u_int8_t ip6oj_type;
> u_int8_t ip6oj_len;
> u_int8_t ip6oj_jumbo_len[4];
> } __packed;
>
> /* NSAP Address Option */
> struct ip6_opt_nsap {
> u_int8_t ip6on_type;
> u_int8_t ip6on_len;
> u_int8_t ip6on_src_nsap_len;
> u_int8_t ip6on_dst_nsap_len;
> /* followed by source NSAP */
> /* followed by destination NSAP */
> } __packed;
>
> /* Tunnel Limit Option */
> struct ip6_opt_tunnel {
> u_int8_t ip6ot_type;
> u_int8_t ip6ot_len;
> u_int8_t ip6ot_encap_limit;
> } __packed;
>
> /* Router Alert Option */
> struct ip6_opt_router {
> u_int8_t ip6or_type;
> u_int8_t ip6or_len;
> u_int8_t ip6or_value[2];
> } __packed;
> #endif /* __FreeBSD__ && INET6 */
>
> #if !defined(__FreeBSD__)
73a130
> #endif
79a137
> #if !defined(__FreeBSD__)
96a155
> #endif
107a167,169
> #ifndef RANDOM_IP_ID
> extern u_int16_t ip_randomid(void);
> #endif
124a187,190
> #if defined(__FreeBSD__)
> uma_zone_t pf_frent_pl, pf_frag_pl, pf_cache_pl, pf_cent_pl;
> uma_zone_t pf_state_scrub_pl;
> #else
126a193
> #endif
131a199,208
> #if defined(__FreeBSD__)
> /*
> * XXX
> * No high water mark support(It's hint not hard limit).
> * uma_zone_set_max(pf_frag_pl, PFFRAG_FRAG_HIWAT);
> */
> uma_zone_set_max(pf_frent_pl, PFFRAG_FRENT_HIWAT);
> uma_zone_set_max(pf_cache_pl, PFFRAG_FRCACHE_HIWAT);
> uma_zone_set_max(pf_cent_pl, PFFRAG_FRCENT_HIWAT);
> #else
146a224
> #endif
175a254,257
> #if defined(__FreeBSD__)
> u_int32_t expire = time_second -
> pf_default_rule.timeout[PFTM_FRAG];
> #else
177a260
> #endif
179a263,266
> #if defined(__FreeBSD__)
> KASSERT((BUFFER_FRAGMENTS(frag)),
> ("BUFFER_FRAGMENTS(frag) == 0: %s", __FUNCTION__));
> #else
180a268
> #endif
188a277,280
> #if defined(__FreeBSD__)
> KASSERT((!BUFFER_FRAGMENTS(frag)),
> ("BUFFER_FRAGMENTS(frag) != 0: %s", __FUNCTION__));
> #else
189a282
> #endif
194a288,293
> #if defined(__FreeBSD__)
> KASSERT((TAILQ_EMPTY(&pf_cachequeue) ||
> TAILQ_LAST(&pf_cachequeue, pf_cachequeue) != frag),
> ("!(TAILQ_EMPTY() || TAILQ_LAST() == farg): %s",
> __FUNCTION__));
> #else
196a296
> #endif
254a355,361
> #if defined(__FreeBSD__)
> KASSERT((LIST_EMPTY(&frag->fr_cache) ||
> LIST_FIRST(&frag->fr_cache)->fr_off >
> frcache->fr_end),
> ("! (LIST_EMPTY() || LIST_FIRST()->fr_off >"
> " frcache->fr_end): %s", __FUNCTION__));
> #else
257a365
> #endif
286a395,397
> #if defined(__FreeBSD__)
> frag->fr_timeout = time_second;
> #else
287a399
> #endif
329a442,445
> #if defined(__FreeBSD__)
> KASSERT((*frag == NULL || BUFFER_FRAGMENTS(*frag)),
> ("! (*frag == NULL || BUFFER_FRAGMENTS(*frag)): %s", __FUNCTION__));
> #else
330a447
> #endif
351a469,471
> #if defined(__FreeBSD__)
> (*frag)->fr_timeout = time_second;
> #else
352a473
> #endif
372a494,497
> #if defined(__FreeBSD__)
> KASSERT((frep != NULL || frea != NULL),
> ("!(frep != NULL || frea != NULL): %s", __FUNCTION__));;
> #else
373a499
> #endif
457a584,586
> #if defined(__FreeBSD__)
> KASSERT((frent != NULL), ("frent == NULL: %s", __FUNCTION__));
> #else
458a588
> #endif
526a657,660
> #if defined(__FreeBSD__)
> KASSERT((*frag == NULL || !BUFFER_FRAGMENTS(*frag)),
> ("!(*frag == NULL || !BUFFER_FRAGMENTS(*frag)): %s", __FUNCTION__));
> #else
527a662
> #endif
553a689,691
> #if defined(__FreeBSD__)
> (*frag)->fr_timeout = time_second;
> #else
554a693
> #endif
579a719,722
> #if defined(__FreeBSD__)
> KASSERT((frp != NULL || fra != NULL),
> ("!(frp != NULL || fra != NULL): %s", __FUNCTION__));
> #else
580a724
> #endif
621a766,771
> #if defined(__FreeBSD__)
> *m0 = m_dup(m, M_DONTWAIT);
> /* From KAME Project : We have missed this! */
> m_adj(*m0, (h->ip_hl << 2) -
> (*m0)->m_pkthdr.len);
> #else
622a773
> #endif
624a776,780
> #if defined(__FreeBSD__)
> KASSERT(((*m0)->m_next == NULL),
> ("(*m0)->m_next != NULL: %s",
> __FUNCTION__));
> #else
625a782
> #endif
640c797,801
<
---
> #if defined(__FreeBSD__)
> KASSERT(((int)m->m_len == ntohs(h->ip_len) - precut),
> ("m->m_len != ntohs(h->ip_len) - precut: %s",
> __FUNCTION__));
> #else
641a803
> #endif
695a858,862
> #if defined(__FreeBSD__)
> KASSERT(((int)m->m_len == ntohs(h->ip_len) - aftercut),
> ("m->m_len != ntohs(h->ip_len) - aftercut: %s",
> __FUNCTION__));
> #else
696a864
> #endif
733a902,905
> #if defined(__FreeBSD__)
> KASSERT((cur == NULL), ("cur != NULL: %s",
> __FUNCTION__));
> #else
734a907
> #endif
1286c1459
< m_copyback(m, off, sizeof(*th), th);
---
> m_copyback(m, off, sizeof(*th), (caddr_t)th);
1303a1477,1480
> #if defined(__FreeBSD__)
> KASSERT((src->scrub == NULL),
> ("pf_normalize_tcp_init: src->scrub != NULL"));
> #else
1304a1482
> #endif
1387a1566,1569
> #if defined(__FreeBSD__)
> KASSERT((src->scrub || dst->scrub),
> ("pf_normalize_tcp_statefull: src->scrub && dst->scrub!"));
> #else
1388a1571
> #endif