diff options
| author | Takashi Iwai <tiwai@suse.de> | 2009-12-15 04:29:06 -0500 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2009-12-15 04:29:06 -0500 |
| commit | 709334c87dbdb44150ce436b3d13c814db0dcae9 (patch) | |
| tree | 5861a45f70c1f283720337abd864498f5afb3dbe /include/linux/udp.h | |
| parent | 0d64b568fcd48b133721c1d322e7c51d85eb12df (diff) | |
| parent | f74890277a196949e4004fe2955e1d4fb3930f98 (diff) | |
Merge branch 'fixes' of git://git.alsa-project.org/alsa-kernel into for-linus
Diffstat (limited to 'include/linux/udp.h')
| -rw-r--r-- | include/linux/udp.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/linux/udp.h b/include/linux/udp.h index 0cf5c4c0ec81..03f72a2ba028 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
| @@ -45,16 +45,19 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | |||
| 45 | return (struct udphdr *)skb_transport_header(skb); | 45 | return (struct udphdr *)skb_transport_header(skb); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | #define UDP_HTABLE_SIZE 128 | 48 | #define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256) |
| 49 | 49 | ||
| 50 | static inline int udp_hashfn(struct net *net, const unsigned num) | 50 | static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask) |
| 51 | { | 51 | { |
| 52 | return (num + net_hash_mix(net)) & (UDP_HTABLE_SIZE - 1); | 52 | return (num + net_hash_mix(net)) & mask; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | struct udp_sock { | 55 | struct udp_sock { |
| 56 | /* inet_sock has to be the first member */ | 56 | /* inet_sock has to be the first member */ |
| 57 | struct inet_sock inet; | 57 | struct inet_sock inet; |
| 58 | #define udp_port_hash inet.sk.__sk_common.skc_u16hashes[0] | ||
| 59 | #define udp_portaddr_hash inet.sk.__sk_common.skc_u16hashes[1] | ||
| 60 | #define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node | ||
| 58 | int pending; /* Any pending frames ? */ | 61 | int pending; /* Any pending frames ? */ |
| 59 | unsigned int corkflag; /* Cork is required */ | 62 | unsigned int corkflag; /* Cork is required */ |
| 60 | __u16 encap_type; /* Is this an Encapsulation socket? */ | 63 | __u16 encap_type; /* Is this an Encapsulation socket? */ |
| @@ -85,6 +88,12 @@ static inline struct udp_sock *udp_sk(const struct sock *sk) | |||
| 85 | return (struct udp_sock *)sk; | 88 | return (struct udp_sock *)sk; |
| 86 | } | 89 | } |
| 87 | 90 | ||
| 91 | #define udp_portaddr_for_each_entry(__sk, node, list) \ | ||
| 92 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) | ||
| 93 | |||
| 94 | #define udp_portaddr_for_each_entry_rcu(__sk, node, list) \ | ||
| 95 | hlist_nulls_for_each_entry_rcu(__sk, node, list, __sk_common.skc_portaddr_node) | ||
| 96 | |||
| 88 | #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) | 97 | #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) |
| 89 | 98 | ||
| 90 | #endif | 99 | #endif |
