diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kernel.h | 12 | ||||
-rw-r--r-- | include/linux/rculist.h | 17 | ||||
-rw-r--r-- | include/linux/skbuff.h | 15 | ||||
-rw-r--r-- | include/linux/sunrpc/svc_xprt.h | 4 | ||||
-rw-r--r-- | include/linux/xfrm.h | 14 | ||||
-rw-r--r-- | include/net/dst.h | 3 | ||||
-rw-r--r-- | include/net/ip_vs.h | 4 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_tuple.h | 6 | ||||
-rw-r--r-- | include/net/netlink.h | 22 | ||||
-rw-r--r-- | include/net/netns/ipv4.h | 2 | ||||
-rw-r--r-- | include/net/sctp/sctp.h | 4 | ||||
-rw-r--r-- | include/net/sock.h | 41 | ||||
-rw-r--r-- | include/net/udp.h | 25 | ||||
-rw-r--r-- | include/net/udplite.h | 2 | ||||
-rw-r--r-- | include/net/xfrm.h | 4 |
15 files changed, 125 insertions, 50 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index fba141d3ca07..ed60f8718d80 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -357,18 +357,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
357 | ((unsigned char *)&addr)[3] | 357 | ((unsigned char *)&addr)[3] |
358 | #define NIPQUAD_FMT "%u.%u.%u.%u" | 358 | #define NIPQUAD_FMT "%u.%u.%u.%u" |
359 | 359 | ||
360 | #define NIP6(addr) \ | ||
361 | ntohs((addr).s6_addr16[0]), \ | ||
362 | ntohs((addr).s6_addr16[1]), \ | ||
363 | ntohs((addr).s6_addr16[2]), \ | ||
364 | ntohs((addr).s6_addr16[3]), \ | ||
365 | ntohs((addr).s6_addr16[4]), \ | ||
366 | ntohs((addr).s6_addr16[5]), \ | ||
367 | ntohs((addr).s6_addr16[6]), \ | ||
368 | ntohs((addr).s6_addr16[7]) | ||
369 | #define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x" | ||
370 | #define NIP6_SEQFMT "%04x%04x%04x%04x%04x%04x%04x%04x" | ||
371 | |||
372 | #if defined(__LITTLE_ENDIAN) | 360 | #if defined(__LITTLE_ENDIAN) |
373 | #define HIPQUAD(addr) \ | 361 | #define HIPQUAD(addr) \ |
374 | ((unsigned char *)&addr)[3], \ | 362 | ((unsigned char *)&addr)[3], \ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index e649bd3f2c97..3ba2998b22ba 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -383,5 +383,22 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
383 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 383 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
384 | pos = rcu_dereference(pos->next)) | 384 | pos = rcu_dereference(pos->next)) |
385 | 385 | ||
386 | /** | ||
387 | * hlist_for_each_entry_rcu_safenext - iterate over rcu list of given type | ||
388 | * @tpos: the type * to use as a loop cursor. | ||
389 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
390 | * @head: the head for your list. | ||
391 | * @member: the name of the hlist_node within the struct. | ||
392 | * @next: the &struct hlist_node to use as a next cursor | ||
393 | * | ||
394 | * Special version of hlist_for_each_entry_rcu that make sure | ||
395 | * each next pointer is fetched before each iteration. | ||
396 | */ | ||
397 | #define hlist_for_each_entry_rcu_safenext(tpos, pos, head, member, next) \ | ||
398 | for (pos = rcu_dereference((head)->first); \ | ||
399 | pos && ({ next = pos->next; smp_rmb(); prefetch(next); 1; }) && \ | ||
400 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | ||
401 | pos = rcu_dereference(next)) | ||
402 | |||
386 | #endif /* __KERNEL__ */ | 403 | #endif /* __KERNEL__ */ |
387 | #endif | 404 | #endif |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2725f4e5a9bf..487e34507b41 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -269,8 +269,9 @@ struct sk_buff { | |||
269 | struct dst_entry *dst; | 269 | struct dst_entry *dst; |
270 | struct rtable *rtable; | 270 | struct rtable *rtable; |
271 | }; | 271 | }; |
272 | #ifdef CONFIG_XFRM | ||
272 | struct sec_path *sp; | 273 | struct sec_path *sp; |
273 | 274 | #endif | |
274 | /* | 275 | /* |
275 | * This is the control buffer. It is free to use for every | 276 | * This is the control buffer. It is free to use for every |
276 | * layer. Please put your private variables there. If you | 277 | * layer. Please put your private variables there. If you |
@@ -1864,6 +1865,18 @@ static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_bu | |||
1864 | to->queue_mapping = from->queue_mapping; | 1865 | to->queue_mapping = from->queue_mapping; |
1865 | } | 1866 | } |
1866 | 1867 | ||
1868 | #ifdef CONFIG_XFRM | ||
1869 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | ||
1870 | { | ||
1871 | return skb->sp; | ||
1872 | } | ||
1873 | #else | ||
1874 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | ||
1875 | { | ||
1876 | return NULL; | ||
1877 | } | ||
1878 | #endif | ||
1879 | |||
1867 | static inline int skb_is_gso(const struct sk_buff *skb) | 1880 | static inline int skb_is_gso(const struct sk_buff *skb) |
1868 | { | 1881 | { |
1869 | return skb_shinfo(skb)->gso_size; | 1882 | return skb_shinfo(skb)->gso_size; |
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 6fd7b016517f..51cb75ea42d5 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
@@ -145,8 +145,8 @@ static inline char *__svc_print_addr(struct sockaddr *addr, | |||
145 | break; | 145 | break; |
146 | 146 | ||
147 | case AF_INET6: | 147 | case AF_INET6: |
148 | snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", | 148 | snprintf(buf, len, "%pI6, port=%u", |
149 | NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), | 149 | &((struct sockaddr_in6 *)addr)->sin6_addr, |
150 | ntohs(((struct sockaddr_in6 *) addr)->sin6_port)); | 150 | ntohs(((struct sockaddr_in6 *) addr)->sin6_port)); |
151 | break; | 151 | break; |
152 | 152 | ||
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 4bc1e6b86cb2..52f3abd453a1 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -199,6 +199,9 @@ enum { | |||
199 | #define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO | 199 | #define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO |
200 | XFRM_MSG_GETSPDINFO, | 200 | XFRM_MSG_GETSPDINFO, |
201 | #define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO | 201 | #define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO |
202 | |||
203 | XFRM_MSG_MAPPING, | ||
204 | #define XFRM_MSG_MAPPING XFRM_MSG_MAPPING | ||
202 | __XFRM_MSG_MAX | 205 | __XFRM_MSG_MAX |
203 | }; | 206 | }; |
204 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) | 207 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) |
@@ -438,6 +441,15 @@ struct xfrm_user_migrate { | |||
438 | __u16 new_family; | 441 | __u16 new_family; |
439 | }; | 442 | }; |
440 | 443 | ||
444 | struct xfrm_user_mapping { | ||
445 | struct xfrm_usersa_id id; | ||
446 | __u32 reqid; | ||
447 | xfrm_address_t old_saddr; | ||
448 | xfrm_address_t new_saddr; | ||
449 | __be16 old_sport; | ||
450 | __be16 new_sport; | ||
451 | }; | ||
452 | |||
441 | #ifndef __KERNEL__ | 453 | #ifndef __KERNEL__ |
442 | /* backwards compatibility for userspace */ | 454 | /* backwards compatibility for userspace */ |
443 | #define XFRMGRP_ACQUIRE 1 | 455 | #define XFRMGRP_ACQUIRE 1 |
@@ -464,6 +476,8 @@ enum xfrm_nlgroups { | |||
464 | #define XFRMNLGRP_REPORT XFRMNLGRP_REPORT | 476 | #define XFRMNLGRP_REPORT XFRMNLGRP_REPORT |
465 | XFRMNLGRP_MIGRATE, | 477 | XFRMNLGRP_MIGRATE, |
466 | #define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE | 478 | #define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE |
479 | XFRMNLGRP_MAPPING, | ||
480 | #define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING | ||
467 | __XFRMNLGRP_MAX | 481 | __XFRMNLGRP_MAX |
468 | }; | 482 | }; |
469 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) | 483 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) |
diff --git a/include/net/dst.h b/include/net/dst.h index 8a8b71e5f3f1..f96c4ba4dd32 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -59,8 +59,9 @@ struct dst_entry | |||
59 | 59 | ||
60 | struct neighbour *neighbour; | 60 | struct neighbour *neighbour; |
61 | struct hh_cache *hh; | 61 | struct hh_cache *hh; |
62 | #ifdef CONFIG_XFRM | ||
62 | struct xfrm_state *xfrm; | 63 | struct xfrm_state *xfrm; |
63 | 64 | #endif | |
64 | int (*input)(struct sk_buff*); | 65 | int (*input)(struct sk_buff*); |
65 | int (*output)(struct sk_buff*); | 66 | int (*output)(struct sk_buff*); |
66 | 67 | ||
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index fe9fcf73c85e..af48cada561e 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -87,8 +87,8 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
87 | int len; | 87 | int len; |
88 | #ifdef CONFIG_IP_VS_IPV6 | 88 | #ifdef CONFIG_IP_VS_IPV6 |
89 | if (af == AF_INET6) | 89 | if (af == AF_INET6) |
90 | len = snprintf(&buf[*idx], buf_len - *idx, "[" NIP6_FMT "]", | 90 | len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6]", |
91 | NIP6(addr->in6)) + 1; | 91 | &addr->in6) + 1; |
92 | else | 92 | else |
93 | #endif | 93 | #endif |
94 | len = snprintf(&buf[*idx], buf_len - *idx, NIPQUAD_FMT, | 94 | len = snprintf(&buf[*idx], buf_len - *idx, NIPQUAD_FMT, |
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h index a6874ba22d54..42f1fc96f3ec 100644 --- a/include/net/netfilter/nf_conntrack_tuple.h +++ b/include/net/netfilter/nf_conntrack_tuple.h | |||
@@ -122,10 +122,10 @@ static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t) | |||
122 | static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t) | 122 | static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t) |
123 | { | 123 | { |
124 | #ifdef DEBUG | 124 | #ifdef DEBUG |
125 | printk("tuple %p: %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", | 125 | printk("tuple %p: %u %pI6 %hu -> %pI6 %hu\n", |
126 | t, t->dst.protonum, | 126 | t, t->dst.protonum, |
127 | NIP6(*(struct in6_addr *)t->src.u3.all), ntohs(t->src.u.all), | 127 | t->src.u3.all, ntohs(t->src.u.all), |
128 | NIP6(*(struct in6_addr *)t->dst.u3.all), ntohs(t->dst.u.all)); | 128 | t->dst.u3.all, ntohs(t->dst.u.all)); |
129 | #endif | 129 | #endif |
130 | } | 130 | } |
131 | 131 | ||
diff --git a/include/net/netlink.h b/include/net/netlink.h index 3643bbb8e585..46b7764f1774 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -233,7 +233,7 @@ extern int nla_parse(struct nlattr *tb[], int maxtype, | |||
233 | extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); | 233 | extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); |
234 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, | 234 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, |
235 | size_t dstsize); | 235 | size_t dstsize); |
236 | extern int nla_memcpy(void *dest, struct nlattr *src, int count); | 236 | extern int nla_memcpy(void *dest, const struct nlattr *src, int count); |
237 | extern int nla_memcmp(const struct nlattr *nla, const void *data, | 237 | extern int nla_memcmp(const struct nlattr *nla, const void *data, |
238 | size_t size); | 238 | size_t size); |
239 | extern int nla_strcmp(const struct nlattr *nla, const char *str); | 239 | extern int nla_strcmp(const struct nlattr *nla, const char *str); |
@@ -741,7 +741,7 @@ static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype) | |||
741 | * See nla_parse() | 741 | * See nla_parse() |
742 | */ | 742 | */ |
743 | static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, | 743 | static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, |
744 | struct nlattr *nla, | 744 | const struct nlattr *nla, |
745 | const struct nla_policy *policy) | 745 | const struct nla_policy *policy) |
746 | { | 746 | { |
747 | return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy); | 747 | return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy); |
@@ -875,7 +875,7 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, | |||
875 | * nla_get_u32 - return payload of u32 attribute | 875 | * nla_get_u32 - return payload of u32 attribute |
876 | * @nla: u32 netlink attribute | 876 | * @nla: u32 netlink attribute |
877 | */ | 877 | */ |
878 | static inline u32 nla_get_u32(struct nlattr *nla) | 878 | static inline u32 nla_get_u32(const struct nlattr *nla) |
879 | { | 879 | { |
880 | return *(u32 *) nla_data(nla); | 880 | return *(u32 *) nla_data(nla); |
881 | } | 881 | } |
@@ -884,7 +884,7 @@ static inline u32 nla_get_u32(struct nlattr *nla) | |||
884 | * nla_get_be32 - return payload of __be32 attribute | 884 | * nla_get_be32 - return payload of __be32 attribute |
885 | * @nla: __be32 netlink attribute | 885 | * @nla: __be32 netlink attribute |
886 | */ | 886 | */ |
887 | static inline __be32 nla_get_be32(struct nlattr *nla) | 887 | static inline __be32 nla_get_be32(const struct nlattr *nla) |
888 | { | 888 | { |
889 | return *(__be32 *) nla_data(nla); | 889 | return *(__be32 *) nla_data(nla); |
890 | } | 890 | } |
@@ -893,7 +893,7 @@ static inline __be32 nla_get_be32(struct nlattr *nla) | |||
893 | * nla_get_u16 - return payload of u16 attribute | 893 | * nla_get_u16 - return payload of u16 attribute |
894 | * @nla: u16 netlink attribute | 894 | * @nla: u16 netlink attribute |
895 | */ | 895 | */ |
896 | static inline u16 nla_get_u16(struct nlattr *nla) | 896 | static inline u16 nla_get_u16(const struct nlattr *nla) |
897 | { | 897 | { |
898 | return *(u16 *) nla_data(nla); | 898 | return *(u16 *) nla_data(nla); |
899 | } | 899 | } |
@@ -902,7 +902,7 @@ static inline u16 nla_get_u16(struct nlattr *nla) | |||
902 | * nla_get_be16 - return payload of __be16 attribute | 902 | * nla_get_be16 - return payload of __be16 attribute |
903 | * @nla: __be16 netlink attribute | 903 | * @nla: __be16 netlink attribute |
904 | */ | 904 | */ |
905 | static inline __be16 nla_get_be16(struct nlattr *nla) | 905 | static inline __be16 nla_get_be16(const struct nlattr *nla) |
906 | { | 906 | { |
907 | return *(__be16 *) nla_data(nla); | 907 | return *(__be16 *) nla_data(nla); |
908 | } | 908 | } |
@@ -911,7 +911,7 @@ static inline __be16 nla_get_be16(struct nlattr *nla) | |||
911 | * nla_get_le16 - return payload of __le16 attribute | 911 | * nla_get_le16 - return payload of __le16 attribute |
912 | * @nla: __le16 netlink attribute | 912 | * @nla: __le16 netlink attribute |
913 | */ | 913 | */ |
914 | static inline __le16 nla_get_le16(struct nlattr *nla) | 914 | static inline __le16 nla_get_le16(const struct nlattr *nla) |
915 | { | 915 | { |
916 | return *(__le16 *) nla_data(nla); | 916 | return *(__le16 *) nla_data(nla); |
917 | } | 917 | } |
@@ -920,7 +920,7 @@ static inline __le16 nla_get_le16(struct nlattr *nla) | |||
920 | * nla_get_u8 - return payload of u8 attribute | 920 | * nla_get_u8 - return payload of u8 attribute |
921 | * @nla: u8 netlink attribute | 921 | * @nla: u8 netlink attribute |
922 | */ | 922 | */ |
923 | static inline u8 nla_get_u8(struct nlattr *nla) | 923 | static inline u8 nla_get_u8(const struct nlattr *nla) |
924 | { | 924 | { |
925 | return *(u8 *) nla_data(nla); | 925 | return *(u8 *) nla_data(nla); |
926 | } | 926 | } |
@@ -929,7 +929,7 @@ static inline u8 nla_get_u8(struct nlattr *nla) | |||
929 | * nla_get_u64 - return payload of u64 attribute | 929 | * nla_get_u64 - return payload of u64 attribute |
930 | * @nla: u64 netlink attribute | 930 | * @nla: u64 netlink attribute |
931 | */ | 931 | */ |
932 | static inline u64 nla_get_u64(struct nlattr *nla) | 932 | static inline u64 nla_get_u64(const struct nlattr *nla) |
933 | { | 933 | { |
934 | u64 tmp; | 934 | u64 tmp; |
935 | 935 | ||
@@ -942,7 +942,7 @@ static inline u64 nla_get_u64(struct nlattr *nla) | |||
942 | * nla_get_flag - return payload of flag attribute | 942 | * nla_get_flag - return payload of flag attribute |
943 | * @nla: flag netlink attribute | 943 | * @nla: flag netlink attribute |
944 | */ | 944 | */ |
945 | static inline int nla_get_flag(struct nlattr *nla) | 945 | static inline int nla_get_flag(const struct nlattr *nla) |
946 | { | 946 | { |
947 | return !!nla; | 947 | return !!nla; |
948 | } | 948 | } |
@@ -953,7 +953,7 @@ static inline int nla_get_flag(struct nlattr *nla) | |||
953 | * | 953 | * |
954 | * Returns the number of milliseconds in jiffies. | 954 | * Returns the number of milliseconds in jiffies. |
955 | */ | 955 | */ |
956 | static inline unsigned long nla_get_msecs(struct nlattr *nla) | 956 | static inline unsigned long nla_get_msecs(const struct nlattr *nla) |
957 | { | 957 | { |
958 | u64 msecs = nla_get_u64(nla); | 958 | u64 msecs = nla_get_u64(nla); |
959 | 959 | ||
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index ece1c926b5d1..977f482d97a9 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -49,6 +49,8 @@ struct netns_ipv4 { | |||
49 | int sysctl_icmp_ratelimit; | 49 | int sysctl_icmp_ratelimit; |
50 | int sysctl_icmp_ratemask; | 50 | int sysctl_icmp_ratemask; |
51 | int sysctl_icmp_errors_use_inbound_ifaddr; | 51 | int sysctl_icmp_errors_use_inbound_ifaddr; |
52 | int sysctl_rt_cache_rebuild_count; | ||
53 | int current_rt_cache_rebuild_count; | ||
52 | 54 | ||
53 | struct timer_list rt_secret_timer; | 55 | struct timer_list rt_secret_timer; |
54 | atomic_t rt_genid; | 56 | atomic_t rt_genid; |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index ed71b110edf7..e71b0f7ce88e 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -285,9 +285,9 @@ extern int sctp_debug_flag; | |||
285 | if (sctp_debug_flag) { \ | 285 | if (sctp_debug_flag) { \ |
286 | if (saddr->sa.sa_family == AF_INET6) { \ | 286 | if (saddr->sa.sa_family == AF_INET6) { \ |
287 | printk(KERN_DEBUG \ | 287 | printk(KERN_DEBUG \ |
288 | lead NIP6_FMT trail, \ | 288 | lead "%pI6" trail, \ |
289 | leadparm, \ | 289 | leadparm, \ |
290 | NIP6(saddr->v6.sin6_addr), \ | 290 | &saddr->v6.sin6_addr, \ |
291 | otherparms); \ | 291 | otherparms); \ |
292 | } else { \ | 292 | } else { \ |
293 | printk(KERN_DEBUG \ | 293 | printk(KERN_DEBUG \ |
diff --git a/include/net/sock.h b/include/net/sock.h index c04f9e18ea22..941ad7c830a3 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -229,7 +229,9 @@ struct sock { | |||
229 | } sk_backlog; | 229 | } sk_backlog; |
230 | wait_queue_head_t *sk_sleep; | 230 | wait_queue_head_t *sk_sleep; |
231 | struct dst_entry *sk_dst_cache; | 231 | struct dst_entry *sk_dst_cache; |
232 | #ifdef CONFIG_XFRM | ||
232 | struct xfrm_policy *sk_policy[2]; | 233 | struct xfrm_policy *sk_policy[2]; |
234 | #endif | ||
233 | rwlock_t sk_dst_lock; | 235 | rwlock_t sk_dst_lock; |
234 | atomic_t sk_rmem_alloc; | 236 | atomic_t sk_rmem_alloc; |
235 | atomic_t sk_wmem_alloc; | 237 | atomic_t sk_wmem_alloc; |
@@ -361,6 +363,27 @@ static __inline__ int sk_del_node_init(struct sock *sk) | |||
361 | return rc; | 363 | return rc; |
362 | } | 364 | } |
363 | 365 | ||
366 | static __inline__ int __sk_del_node_init_rcu(struct sock *sk) | ||
367 | { | ||
368 | if (sk_hashed(sk)) { | ||
369 | hlist_del_init_rcu(&sk->sk_node); | ||
370 | return 1; | ||
371 | } | ||
372 | return 0; | ||
373 | } | ||
374 | |||
375 | static __inline__ int sk_del_node_init_rcu(struct sock *sk) | ||
376 | { | ||
377 | int rc = __sk_del_node_init_rcu(sk); | ||
378 | |||
379 | if (rc) { | ||
380 | /* paranoid for a while -acme */ | ||
381 | WARN_ON(atomic_read(&sk->sk_refcnt) == 1); | ||
382 | __sock_put(sk); | ||
383 | } | ||
384 | return rc; | ||
385 | } | ||
386 | |||
364 | static __inline__ void __sk_add_node(struct sock *sk, struct hlist_head *list) | 387 | static __inline__ void __sk_add_node(struct sock *sk, struct hlist_head *list) |
365 | { | 388 | { |
366 | hlist_add_head(&sk->sk_node, list); | 389 | hlist_add_head(&sk->sk_node, list); |
@@ -372,6 +395,17 @@ static __inline__ void sk_add_node(struct sock *sk, struct hlist_head *list) | |||
372 | __sk_add_node(sk, list); | 395 | __sk_add_node(sk, list); |
373 | } | 396 | } |
374 | 397 | ||
398 | static __inline__ void __sk_add_node_rcu(struct sock *sk, struct hlist_head *list) | ||
399 | { | ||
400 | hlist_add_head_rcu(&sk->sk_node, list); | ||
401 | } | ||
402 | |||
403 | static __inline__ void sk_add_node_rcu(struct sock *sk, struct hlist_head *list) | ||
404 | { | ||
405 | sock_hold(sk); | ||
406 | __sk_add_node_rcu(sk, list); | ||
407 | } | ||
408 | |||
375 | static __inline__ void __sk_del_bind_node(struct sock *sk) | 409 | static __inline__ void __sk_del_bind_node(struct sock *sk) |
376 | { | 410 | { |
377 | __hlist_del(&sk->sk_bind_node); | 411 | __hlist_del(&sk->sk_bind_node); |
@@ -385,6 +419,8 @@ static __inline__ void sk_add_bind_node(struct sock *sk, | |||
385 | 419 | ||
386 | #define sk_for_each(__sk, node, list) \ | 420 | #define sk_for_each(__sk, node, list) \ |
387 | hlist_for_each_entry(__sk, node, list, sk_node) | 421 | hlist_for_each_entry(__sk, node, list, sk_node) |
422 | #define sk_for_each_rcu_safenext(__sk, node, list, next) \ | ||
423 | hlist_for_each_entry_rcu_safenext(__sk, node, list, sk_node, next) | ||
388 | #define sk_for_each_from(__sk, node) \ | 424 | #define sk_for_each_from(__sk, node) \ |
389 | if (__sk && ({ node = &(__sk)->sk_node; 1; })) \ | 425 | if (__sk && ({ node = &(__sk)->sk_node; 1; })) \ |
390 | hlist_for_each_entry_from(__sk, node, sk_node) | 426 | hlist_for_each_entry_from(__sk, node, sk_node) |
@@ -587,8 +623,9 @@ struct proto { | |||
587 | int *sysctl_rmem; | 623 | int *sysctl_rmem; |
588 | int max_header; | 624 | int max_header; |
589 | 625 | ||
590 | struct kmem_cache *slab; | 626 | struct kmem_cache *slab; |
591 | unsigned int obj_size; | 627 | unsigned int obj_size; |
628 | int slab_flags; | ||
592 | 629 | ||
593 | atomic_t *orphan_count; | 630 | atomic_t *orphan_count; |
594 | 631 | ||
@@ -597,7 +634,7 @@ struct proto { | |||
597 | 634 | ||
598 | union { | 635 | union { |
599 | struct inet_hashinfo *hashinfo; | 636 | struct inet_hashinfo *hashinfo; |
600 | struct hlist_head *udp_hash; | 637 | struct udp_table *udp_table; |
601 | struct raw_hashinfo *raw_hash; | 638 | struct raw_hashinfo *raw_hash; |
602 | } h; | 639 | } h; |
603 | 640 | ||
diff --git a/include/net/udp.h b/include/net/udp.h index 1e205095ea68..df2bfe545374 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -50,8 +50,15 @@ struct udp_skb_cb { | |||
50 | }; | 50 | }; |
51 | #define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) | 51 | #define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) |
52 | 52 | ||
53 | extern struct hlist_head udp_hash[UDP_HTABLE_SIZE]; | 53 | struct udp_hslot { |
54 | extern rwlock_t udp_hash_lock; | 54 | struct hlist_head head; |
55 | spinlock_t lock; | ||
56 | } __attribute__((aligned(2 * sizeof(long)))); | ||
57 | struct udp_table { | ||
58 | struct udp_hslot hash[UDP_HTABLE_SIZE]; | ||
59 | }; | ||
60 | extern struct udp_table udp_table; | ||
61 | extern void udp_table_init(struct udp_table *); | ||
55 | 62 | ||
56 | 63 | ||
57 | /* Note: this must match 'valbool' in sock_setsockopt */ | 64 | /* Note: this must match 'valbool' in sock_setsockopt */ |
@@ -110,15 +117,7 @@ static inline void udp_lib_hash(struct sock *sk) | |||
110 | BUG(); | 117 | BUG(); |
111 | } | 118 | } |
112 | 119 | ||
113 | static inline void udp_lib_unhash(struct sock *sk) | 120 | extern void udp_lib_unhash(struct sock *sk); |
114 | { | ||
115 | write_lock_bh(&udp_hash_lock); | ||
116 | if (sk_del_node_init(sk)) { | ||
117 | inet_sk(sk)->num = 0; | ||
118 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); | ||
119 | } | ||
120 | write_unlock_bh(&udp_hash_lock); | ||
121 | } | ||
122 | 121 | ||
123 | static inline void udp_lib_close(struct sock *sk, long timeout) | 122 | static inline void udp_lib_close(struct sock *sk, long timeout) |
124 | { | 123 | { |
@@ -187,7 +186,7 @@ extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, | |||
187 | struct udp_seq_afinfo { | 186 | struct udp_seq_afinfo { |
188 | char *name; | 187 | char *name; |
189 | sa_family_t family; | 188 | sa_family_t family; |
190 | struct hlist_head *hashtable; | 189 | struct udp_table *udp_table; |
191 | struct file_operations seq_fops; | 190 | struct file_operations seq_fops; |
192 | struct seq_operations seq_ops; | 191 | struct seq_operations seq_ops; |
193 | }; | 192 | }; |
@@ -196,7 +195,7 @@ struct udp_iter_state { | |||
196 | struct seq_net_private p; | 195 | struct seq_net_private p; |
197 | sa_family_t family; | 196 | sa_family_t family; |
198 | int bucket; | 197 | int bucket; |
199 | struct hlist_head *hashtable; | 198 | struct udp_table *udp_table; |
200 | }; | 199 | }; |
201 | 200 | ||
202 | #ifdef CONFIG_PROC_FS | 201 | #ifdef CONFIG_PROC_FS |
diff --git a/include/net/udplite.h b/include/net/udplite.h index b76b2e377af4..afdffe607b24 100644 --- a/include/net/udplite.h +++ b/include/net/udplite.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */ | 11 | #define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */ |
12 | 12 | ||
13 | extern struct proto udplite_prot; | 13 | extern struct proto udplite_prot; |
14 | extern struct hlist_head udplite_hash[UDP_HTABLE_SIZE]; | 14 | extern struct udp_table udplite_table; |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Checksum computation is all in software, hence simpler getfrag. | 17 | * Checksum computation is all in software, hence simpler getfrag. |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 11c890ad8ebb..f2c5ba28a428 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -882,6 +882,7 @@ struct xfrm_dst | |||
882 | u32 path_cookie; | 882 | u32 path_cookie; |
883 | }; | 883 | }; |
884 | 884 | ||
885 | #ifdef CONFIG_XFRM | ||
885 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | 886 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) |
886 | { | 887 | { |
887 | dst_release(xdst->route); | 888 | dst_release(xdst->route); |
@@ -894,6 +895,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | |||
894 | xdst->partner = NULL; | 895 | xdst->partner = NULL; |
895 | #endif | 896 | #endif |
896 | } | 897 | } |
898 | #endif | ||
897 | 899 | ||
898 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); | 900 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); |
899 | 901 | ||
@@ -1536,9 +1538,11 @@ static inline void xfrm_states_delete(struct xfrm_state **states, int n) | |||
1536 | } | 1538 | } |
1537 | #endif | 1539 | #endif |
1538 | 1540 | ||
1541 | #ifdef CONFIG_XFRM | ||
1539 | static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb) | 1542 | static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb) |
1540 | { | 1543 | { |
1541 | return skb->sp->xvec[skb->sp->len - 1]; | 1544 | return skb->sp->xvec[skb->sp->len - 1]; |
1542 | } | 1545 | } |
1546 | #endif | ||
1543 | 1547 | ||
1544 | #endif /* _NET_XFRM_H */ | 1548 | #endif /* _NET_XFRM_H */ |