mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-12-08 09:03:53 +01:00
psd: reduce size of struct host
We can use u16, saving 8 bytes total (weight cannot exceed PSD_MAX_RATE, 10000). Also re-format comments & struct initializers. No functional changes.
This commit is contained in:
committed by
Jan Engelhardt
parent
5b2649b1a2
commit
3736a265d8
@@ -61,9 +61,9 @@ struct host {
|
|||||||
unsigned long timestamp;
|
unsigned long timestamp;
|
||||||
struct in_addr src_addr;
|
struct in_addr src_addr;
|
||||||
struct in_addr dest_addr;
|
struct in_addr dest_addr;
|
||||||
unsigned short src_port;
|
__be16 src_port;
|
||||||
int count;
|
uint16_t count;
|
||||||
int weight;
|
uint8_t weight;
|
||||||
struct port ports[SCAN_MAX_COUNT-1];
|
struct port ports[SCAN_MAX_COUNT-1];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -77,6 +77,7 @@ static struct {
|
|||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
struct host list[LIST_SIZE];
|
struct host list[LIST_SIZE];
|
||||||
struct host *hash[HASH_SIZE];
|
struct host *hash[HASH_SIZE];
|
||||||
|
int index;
|
||||||
} state;
|
} state;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user