X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=xdp.c;h=b473ace29b3ed0c1ccbefa8ee1461945e059dad2;hb=31c91503a07f942531da55ac861630bfdf8d00fb;hp=506d4224030168ff32f98032199bf144e6630ec0;hpb=2400b2559ac2947300b90173a3fe25d632dba523;p=flowspec-xdp diff --git a/xdp.c b/xdp.c index 506d422..b473ace 100644 --- a/xdp.c +++ b/xdp.c @@ -172,7 +172,10 @@ struct { #ifdef RATE_CNT struct ratelimit { struct bpf_spin_lock lock; - int64_t sent_bytes; + union { + int64_t sent_bytes; + int64_t sent_packets; + } rate; int64_t sent_time; }; struct { @@ -183,8 +186,10 @@ struct { } rate_map SEC(".maps"); #endif +#ifndef HAVE_WRAPPER // Set this to call xdp_drop externally SEC("xdp_drop") #endif +#endif int xdp_drop_prog(struct xdp_md *ctx) { const void *const data_end = (void *)(size_t)ctx->data_end;