Netgraph and ipfw for FreeBSD 13.0.

This commit is contained in:
fengbojiang 2021-10-12 18:59:42 +08:00
parent fae6b93557
commit da4b496cab
4 changed files with 273 additions and 248 deletions

View File

@ -609,7 +609,9 @@ ipfw_send_abort(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t vtag,
} }
chunk->chunk_length = htons(sizeof(struct sctp_chunkhdr)); chunk->chunk_length = htons(sizeof(struct sctp_chunkhdr));
#ifndef FSTACK /* Not support sctp now */
sctp->checksum = sctp_calculate_cksum(m, hlen); sctp->checksum = sctp_calculate_cksum(m, hlen);
#endif
return (m); return (m);
} }
@ -3444,7 +3446,9 @@ vnet_ipfw_init(const void *unused)
#ifdef LINEAR_SKIPTO #ifdef LINEAR_SKIPTO
ipfw_init_skipto_cache(chain); ipfw_init_skipto_cache(chain);
#endif #endif
#ifndef FSTACK /* WITHOUT_BPF */
ipfw_bpf_init(first); ipfw_bpf_init(first);
#endif
/* First set up some values that are compile time options */ /* First set up some values that are compile time options */
V_ipfw_vnet_ready = 1; /* Open for business */ V_ipfw_vnet_ready = 1; /* Open for business */
@ -3514,7 +3518,9 @@ vnet_ipfw_uninit(const void *unused)
IPFW_LOCK_DESTROY(chain); IPFW_LOCK_DESTROY(chain);
ipfw_dyn_uninit(1); /* free the remaining parts */ ipfw_dyn_uninit(1); /* free the remaining parts */
ipfw_destroy_counters(); ipfw_destroy_counters();
#ifndef FSTACK /* WITHOUT_BPF */
ipfw_bpf_uninit(last); ipfw_bpf_uninit(last);
#endif
return (0); return (0);
} }

View File

@ -106,6 +106,7 @@ ipfw_log(struct ip_fw_chain *chain, struct ip_fw *f, u_int hlen,
char action2[92], proto[128], fragment[32]; char action2[92], proto[128], fragment[32];
if (V_fw_verbose == 0) { if (V_fw_verbose == 0) {
#ifndef FSTACK /* WITHOUT_BPF */
if (args->flags & IPFW_ARGS_LENMASK) if (args->flags & IPFW_ARGS_LENMASK)
ipfw_bpf_tap(args->mem, IPFW_ARGS_LENGTH(args->flags)); ipfw_bpf_tap(args->mem, IPFW_ARGS_LENGTH(args->flags));
else if (args->flags & IPFW_ARGS_ETHER) else if (args->flags & IPFW_ARGS_ETHER)
@ -126,6 +127,7 @@ ipfw_log(struct ip_fw_chain *chain, struct ip_fw *f, u_int hlen,
ipfw_bpf_mtap2("DDDDDDSSSSSS\xff\xff", ipfw_bpf_mtap2("DDDDDDSSSSSS\xff\xff",
ETHER_HDR_LEN, args->m); ETHER_HDR_LEN, args->m);
} }
#endif
return; return;
} }
/* the old 'log' function */ /* the old 'log' function */

View File

@ -109,6 +109,7 @@ _Static_assert(ENTROPYSOURCE <= 32,
#define RANDOM_CACHED_BOOT_ENTROPY_MODULE "boot_entropy_cache" #define RANDOM_CACHED_BOOT_ENTROPY_MODULE "boot_entropy_cache"
#ifndef FSTACK
extern u_int hc_source_mask; extern u_int hc_source_mask;
void random_harvest_queue_(const void *, u_int, enum random_entropy_source); void random_harvest_queue_(const void *, u_int, enum random_entropy_source);
void random_harvest_fast_(const void *, u_int); void random_harvest_fast_(const void *, u_int);
@ -137,6 +138,11 @@ random_harvest_direct(const void *entropy, u_int size, enum random_entropy_sourc
if (hc_source_mask & (1 << origin)) if (hc_source_mask & (1 << origin))
random_harvest_direct_(entropy, size, origin); random_harvest_direct_(entropy, size, origin);
} }
#else
#define random_harvest_queue(a, b, c) do {} while (0)
#define random_harvest_fast(a, b, c) do {} while (0)
#define random_harvest_direct(a, b, c) do {} while (0)
#endif
void random_harvest_register_source(enum random_entropy_source); void random_harvest_register_source(enum random_entropy_source);
void random_harvest_deregister_source(enum random_entropy_source); void random_harvest_deregister_source(enum random_entropy_source);

File diff suppressed because it is too large Load Diff