diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 17 | ||||
-rw-r--r-- | include/net/dn.h | 5 | ||||
-rw-r--r-- | include/net/flow.h | 5 | ||||
-rw-r--r-- | include/net/ieee80211softmac.h | 35 | ||||
-rw-r--r-- | include/net/inet_ecn.h | 2 | ||||
-rw-r--r-- | include/net/inet_timewait_sock.h | 1 | ||||
-rw-r--r-- | include/net/inetpeer.h | 24 | ||||
-rw-r--r-- | include/net/ip6_route.h | 7 | ||||
-rw-r--r-- | include/net/ip_fib.h | 5 | ||||
-rw-r--r-- | include/net/ip_vs.h | 1 | ||||
-rw-r--r-- | include/net/ipx.h | 26 | ||||
-rw-r--r-- | include/net/netlabel.h | 62 | ||||
-rw-r--r-- | include/net/sctp/sctp.h | 14 | ||||
-rw-r--r-- | include/net/sctp/ulpevent.h | 1 | ||||
-rw-r--r-- | include/net/sock.h | 3 | ||||
-rw-r--r-- | include/net/timewait_sock.h | 7 | ||||
-rw-r--r-- | include/net/xfrm.h | 3 |
17 files changed, 129 insertions, 89 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index df22efcfcc0b..c0fc39620f36 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -153,6 +153,7 @@ struct hci_conn { | |||
153 | __u8 mode; | 153 | __u8 mode; |
154 | __u8 type; | 154 | __u8 type; |
155 | __u8 out; | 155 | __u8 out; |
156 | __u8 attempt; | ||
156 | __u8 dev_class[3]; | 157 | __u8 dev_class[3]; |
157 | __u8 features[8]; | 158 | __u8 features[8]; |
158 | __u16 interval; | 159 | __u16 interval; |
@@ -289,6 +290,22 @@ static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev, | |||
289 | return NULL; | 290 | return NULL; |
290 | } | 291 | } |
291 | 292 | ||
293 | static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev, | ||
294 | __u8 type, __u16 state) | ||
295 | { | ||
296 | struct hci_conn_hash *h = &hdev->conn_hash; | ||
297 | struct list_head *p; | ||
298 | struct hci_conn *c; | ||
299 | |||
300 | list_for_each(p, &h->list) { | ||
301 | c = list_entry(p, struct hci_conn, list); | ||
302 | if (c->type == type && c->state == state) | ||
303 | return c; | ||
304 | } | ||
305 | return NULL; | ||
306 | } | ||
307 | |||
308 | void hci_acl_connect(struct hci_conn *conn); | ||
292 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); | 309 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); |
293 | void hci_add_sco(struct hci_conn *conn, __u16 handle); | 310 | void hci_add_sco(struct hci_conn *conn, __u16 handle); |
294 | 311 | ||
diff --git a/include/net/dn.h b/include/net/dn.h index 465b78302782..ac4ce9091747 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
@@ -199,11 +199,6 @@ static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) | |||
199 | { | 199 | { |
200 | fl->uli_u.dnports.sport = scp->addrloc; | 200 | fl->uli_u.dnports.sport = scp->addrloc; |
201 | fl->uli_u.dnports.dport = scp->addrrem; | 201 | fl->uli_u.dnports.dport = scp->addrrem; |
202 | fl->uli_u.dnports.objnum = scp->addr.sdn_objnum; | ||
203 | if (fl->uli_u.dnports.objnum == 0) { | ||
204 | fl->uli_u.dnports.objnamel = (__u8)dn_ntohs(scp->addr.sdn_objnamel); | ||
205 | memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16); | ||
206 | } | ||
207 | } | 202 | } |
208 | 203 | ||
209 | extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu); | 204 | extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu); |
diff --git a/include/net/flow.h b/include/net/flow.h index ddf5f3ca1720..5cda27cd9deb 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -68,9 +68,6 @@ struct flowi { | |||
68 | struct { | 68 | struct { |
69 | __le16 sport; | 69 | __le16 sport; |
70 | __le16 dport; | 70 | __le16 dport; |
71 | __u8 objnum; | ||
72 | __u8 objnamel; /* Not 16 bits since max val is 16 */ | ||
73 | __u8 objname[16]; /* Not zero terminated */ | ||
74 | } dnports; | 71 | } dnports; |
75 | 72 | ||
76 | __be32 spi; | 73 | __be32 spi; |
@@ -97,7 +94,7 @@ struct flowi { | |||
97 | #define FLOW_DIR_FWD 2 | 94 | #define FLOW_DIR_FWD 2 |
98 | 95 | ||
99 | struct sock; | 96 | struct sock; |
100 | typedef void (*flow_resolve_t)(struct flowi *key, u16 family, u8 dir, | 97 | typedef int (*flow_resolve_t)(struct flowi *key, u16 family, u8 dir, |
101 | void **objp, atomic_t **obj_refp); | 98 | void **objp, atomic_t **obj_refp); |
102 | 99 | ||
103 | extern void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir, | 100 | extern void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir, |
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h index 425b3a57ac74..617b672b1132 100644 --- a/include/net/ieee80211softmac.h +++ b/include/net/ieee80211softmac.h | |||
@@ -63,13 +63,11 @@ struct ieee80211softmac_wpa { | |||
63 | 63 | ||
64 | /* | 64 | /* |
65 | * Information about association | 65 | * Information about association |
66 | * | ||
67 | * Do we need a lock for this? | ||
68 | * We only ever use this structure inlined | ||
69 | * into our global struct. I've used its lock, | ||
70 | * but maybe we need a local one here? | ||
71 | */ | 66 | */ |
72 | struct ieee80211softmac_assoc_info { | 67 | struct ieee80211softmac_assoc_info { |
68 | |||
69 | struct mutex mutex; | ||
70 | |||
73 | /* | 71 | /* |
74 | * This is the requested ESSID. It is written | 72 | * This is the requested ESSID. It is written |
75 | * only by the WX handlers. | 73 | * only by the WX handlers. |
@@ -99,12 +97,13 @@ struct ieee80211softmac_assoc_info { | |||
99 | * | 97 | * |
100 | * bssfixed is used for SIOCSIWAP. | 98 | * bssfixed is used for SIOCSIWAP. |
101 | */ | 99 | */ |
102 | u8 static_essid:1, | 100 | u8 static_essid; |
103 | short_preamble_available:1, | 101 | u8 short_preamble_available; |
104 | associating:1, | 102 | u8 associating; |
105 | assoc_wait:1, | 103 | u8 associated; |
106 | bssvalid:1, | 104 | u8 assoc_wait; |
107 | bssfixed:1; | 105 | u8 bssvalid; |
106 | u8 bssfixed; | ||
108 | 107 | ||
109 | /* Scan retries remaining */ | 108 | /* Scan retries remaining */ |
110 | int scan_retry; | 109 | int scan_retry; |
@@ -229,12 +228,10 @@ struct ieee80211softmac_device { | |||
229 | /* private stuff follows */ | 228 | /* private stuff follows */ |
230 | /* this lock protects this structure */ | 229 | /* this lock protects this structure */ |
231 | spinlock_t lock; | 230 | spinlock_t lock; |
232 | 231 | ||
233 | /* couple of flags */ | 232 | u8 running; /* SoftMAC started? */ |
234 | u8 scanning:1, /* protects scanning from being done multiple times at once */ | 233 | u8 scanning; |
235 | associated:1, | 234 | |
236 | running:1; | ||
237 | |||
238 | struct ieee80211softmac_scaninfo *scaninfo; | 235 | struct ieee80211softmac_scaninfo *scaninfo; |
239 | struct ieee80211softmac_assoc_info associnfo; | 236 | struct ieee80211softmac_assoc_info associnfo; |
240 | struct ieee80211softmac_bss_info bssinfo; | 237 | struct ieee80211softmac_bss_info bssinfo; |
@@ -250,7 +247,7 @@ struct ieee80211softmac_device { | |||
250 | 247 | ||
251 | /* we need to keep a list of network structs we copied */ | 248 | /* we need to keep a list of network structs we copied */ |
252 | struct list_head network_list; | 249 | struct list_head network_list; |
253 | 250 | ||
254 | /* This must be the last item so that it points to the data | 251 | /* This must be the last item so that it points to the data |
255 | * allocated beyond this structure by alloc_ieee80211 */ | 252 | * allocated beyond this structure by alloc_ieee80211 */ |
256 | u8 priv[0]; | 253 | u8 priv[0]; |
@@ -295,7 +292,7 @@ static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device | |||
295 | { | 292 | { |
296 | struct ieee80211softmac_txrates *txrates = &mac->txrates; | 293 | struct ieee80211softmac_txrates *txrates = &mac->txrates; |
297 | 294 | ||
298 | if (!mac->associated) | 295 | if (!mac->associnfo.associated) |
299 | return txrates->mgt_mcast_rate; | 296 | return txrates->mgt_mcast_rate; |
300 | 297 | ||
301 | /* We are associated, sending unicast frame */ | 298 | /* We are associated, sending unicast frame */ |
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h index d599c6bfbb86..7849844a4911 100644 --- a/include/net/inet_ecn.h +++ b/include/net/inet_ecn.h | |||
@@ -48,7 +48,7 @@ static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) | |||
48 | 48 | ||
49 | #define IP6_ECN_flow_xmit(sk, label) do { \ | 49 | #define IP6_ECN_flow_xmit(sk, label) do { \ |
50 | if (INET_ECN_is_capable(inet_sk(sk)->tos)) \ | 50 | if (INET_ECN_is_capable(inet_sk(sk)->tos)) \ |
51 | (label) |= __constant_htons(INET_ECN_ECT_0 << 4); \ | 51 | (label) |= htonl(INET_ECN_ECT_0 << 20); \ |
52 | } while (0) | 52 | } while (0) |
53 | 53 | ||
54 | static inline int IP_ECN_set_ce(struct iphdr *iph) | 54 | static inline int IP_ECN_set_ce(struct iphdr *iph) |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 6d14c22a00c5..5f48748fe017 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -196,6 +196,7 @@ static inline void inet_twsk_put(struct inet_timewait_sock *tw) | |||
196 | { | 196 | { |
197 | if (atomic_dec_and_test(&tw->tw_refcnt)) { | 197 | if (atomic_dec_and_test(&tw->tw_refcnt)) { |
198 | struct module *owner = tw->tw_prot->owner; | 198 | struct module *owner = tw->tw_prot->owner; |
199 | twsk_destructor((struct sock *)tw); | ||
199 | #ifdef SOCK_REFCNT_DEBUG | 200 | #ifdef SOCK_REFCNT_DEBUG |
200 | printk(KERN_DEBUG "%s timewait_sock %p released\n", | 201 | printk(KERN_DEBUG "%s timewait_sock %p released\n", |
201 | tw->tw_prot->name, tw); | 202 | tw->tw_prot->name, tw); |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 925573fd2aed..aa10a8178e70 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -17,14 +17,15 @@ | |||
17 | 17 | ||
18 | struct inet_peer | 18 | struct inet_peer |
19 | { | 19 | { |
20 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ | ||
20 | struct inet_peer *avl_left, *avl_right; | 21 | struct inet_peer *avl_left, *avl_right; |
21 | struct inet_peer *unused_next, **unused_prevp; | ||
22 | unsigned long dtime; /* the time of last use of not | ||
23 | * referenced entries */ | ||
24 | atomic_t refcnt; | ||
25 | __be32 v4daddr; /* peer's address */ | 22 | __be32 v4daddr; /* peer's address */ |
26 | __u16 avl_height; | 23 | __u16 avl_height; |
27 | __u16 ip_id_count; /* IP ID for the next packet */ | 24 | __u16 ip_id_count; /* IP ID for the next packet */ |
25 | struct inet_peer *unused_next, **unused_prevp; | ||
26 | __u32 dtime; /* the time of last use of not | ||
27 | * referenced entries */ | ||
28 | atomic_t refcnt; | ||
28 | atomic_t rid; /* Frag reception counter */ | 29 | atomic_t rid; /* Frag reception counter */ |
29 | __u32 tcp_ts; | 30 | __u32 tcp_ts; |
30 | unsigned long tcp_ts_stamp; | 31 | unsigned long tcp_ts_stamp; |
@@ -35,21 +36,8 @@ void inet_initpeers(void) __init; | |||
35 | /* can be called with or without local BH being disabled */ | 36 | /* can be called with or without local BH being disabled */ |
36 | struct inet_peer *inet_getpeer(__be32 daddr, int create); | 37 | struct inet_peer *inet_getpeer(__be32 daddr, int create); |
37 | 38 | ||
38 | extern spinlock_t inet_peer_unused_lock; | ||
39 | extern struct inet_peer **inet_peer_unused_tailp; | ||
40 | /* can be called from BH context or outside */ | 39 | /* can be called from BH context or outside */ |
41 | static inline void inet_putpeer(struct inet_peer *p) | 40 | extern void inet_putpeer(struct inet_peer *p); |
42 | { | ||
43 | spin_lock_bh(&inet_peer_unused_lock); | ||
44 | if (atomic_dec_and_test(&p->refcnt)) { | ||
45 | p->unused_prevp = inet_peer_unused_tailp; | ||
46 | p->unused_next = NULL; | ||
47 | *inet_peer_unused_tailp = p; | ||
48 | inet_peer_unused_tailp = &p->unused_next; | ||
49 | p->dtime = jiffies; | ||
50 | } | ||
51 | spin_unlock_bh(&inet_peer_unused_lock); | ||
52 | } | ||
53 | 41 | ||
54 | extern spinlock_t inet_peer_idlock; | 42 | extern spinlock_t inet_peer_idlock; |
55 | /* can be called with or without local BH being disabled */ | 43 | /* can be called with or without local BH being disabled */ |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 6ca6b71dfe0f..c14b70ed4c57 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -36,13 +36,6 @@ struct route_info { | |||
36 | #define RT6_LOOKUP_F_REACHABLE 0x2 | 36 | #define RT6_LOOKUP_F_REACHABLE 0x2 |
37 | #define RT6_LOOKUP_F_HAS_SADDR 0x4 | 37 | #define RT6_LOOKUP_F_HAS_SADDR 0x4 |
38 | 38 | ||
39 | struct pol_chain { | ||
40 | int type; | ||
41 | int priority; | ||
42 | struct fib6_node *rules; | ||
43 | struct pol_chain *next; | ||
44 | }; | ||
45 | |||
46 | extern struct rt6_info ip6_null_entry; | 39 | extern struct rt6_info ip6_null_entry; |
47 | 40 | ||
48 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 41 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 82229146bac7..949b932d2f08 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -21,17 +21,14 @@ | |||
21 | #include <net/fib_rules.h> | 21 | #include <net/fib_rules.h> |
22 | 22 | ||
23 | struct fib_config { | 23 | struct fib_config { |
24 | u8 fc_family; | ||
25 | u8 fc_dst_len; | 24 | u8 fc_dst_len; |
26 | u8 fc_src_len; | ||
27 | u8 fc_tos; | 25 | u8 fc_tos; |
28 | u8 fc_protocol; | 26 | u8 fc_protocol; |
29 | u8 fc_scope; | 27 | u8 fc_scope; |
30 | u8 fc_type; | 28 | u8 fc_type; |
31 | /* 1 byte unused */ | 29 | /* 3 bytes unused */ |
32 | u32 fc_table; | 30 | u32 fc_table; |
33 | __be32 fc_dst; | 31 | __be32 fc_dst; |
34 | __be32 fc_src; | ||
35 | __be32 fc_gw; | 32 | __be32 fc_gw; |
36 | int fc_oif; | 33 | int fc_oif; |
37 | u32 fc_flags; | 34 | u32 fc_flags; |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 49c717e3b040..903108e583f8 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #define _IP_VS_H | 7 | #define _IP_VS_H |
8 | 8 | ||
9 | #include <asm/types.h> /* For __uXX types */ | 9 | #include <asm/types.h> /* For __uXX types */ |
10 | #include <linux/types.h> /* For __beXX types in userland */ | ||
10 | 11 | ||
11 | #define IP_VS_VERSION_CODE 0x010201 | 12 | #define IP_VS_VERSION_CODE 0x010201 |
12 | #define NVERSION(version) \ | 13 | #define NVERSION(version) \ |
diff --git a/include/net/ipx.h b/include/net/ipx.h index 5c0cf33826c5..c6b2ee610866 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h | |||
@@ -15,9 +15,9 @@ | |||
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | 16 | ||
17 | struct ipx_address { | 17 | struct ipx_address { |
18 | __u32 net; | 18 | __be32 net; |
19 | __u8 node[IPX_NODE_LEN]; | 19 | __u8 node[IPX_NODE_LEN]; |
20 | __u16 sock; | 20 | __be16 sock; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | #define ipx_broadcast_node "\377\377\377\377\377\377" | 23 | #define ipx_broadcast_node "\377\377\377\377\377\377" |
@@ -26,9 +26,9 @@ struct ipx_address { | |||
26 | #define IPX_MAX_PPROP_HOPS 8 | 26 | #define IPX_MAX_PPROP_HOPS 8 |
27 | 27 | ||
28 | struct ipxhdr { | 28 | struct ipxhdr { |
29 | __u16 ipx_checksum __attribute__ ((packed)); | 29 | __be16 ipx_checksum __attribute__ ((packed)); |
30 | #define IPX_NO_CHECKSUM 0xFFFF | 30 | #define IPX_NO_CHECKSUM __constant_htons(0xFFFF) |
31 | __u16 ipx_pktsize __attribute__ ((packed)); | 31 | __be16 ipx_pktsize __attribute__ ((packed)); |
32 | __u8 ipx_tctrl; | 32 | __u8 ipx_tctrl; |
33 | __u8 ipx_type; | 33 | __u8 ipx_type; |
34 | #define IPX_TYPE_UNKNOWN 0x00 | 34 | #define IPX_TYPE_UNKNOWN 0x00 |
@@ -48,14 +48,14 @@ static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb) | |||
48 | 48 | ||
49 | struct ipx_interface { | 49 | struct ipx_interface { |
50 | /* IPX address */ | 50 | /* IPX address */ |
51 | __u32 if_netnum; | 51 | __be32 if_netnum; |
52 | unsigned char if_node[IPX_NODE_LEN]; | 52 | unsigned char if_node[IPX_NODE_LEN]; |
53 | atomic_t refcnt; | 53 | atomic_t refcnt; |
54 | 54 | ||
55 | /* physical device info */ | 55 | /* physical device info */ |
56 | struct net_device *if_dev; | 56 | struct net_device *if_dev; |
57 | struct datalink_proto *if_dlink; | 57 | struct datalink_proto *if_dlink; |
58 | unsigned short if_dlink_type; | 58 | __be16 if_dlink_type; |
59 | 59 | ||
60 | /* socket support */ | 60 | /* socket support */ |
61 | unsigned short if_sknum; | 61 | unsigned short if_sknum; |
@@ -71,7 +71,7 @@ struct ipx_interface { | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | struct ipx_route { | 73 | struct ipx_route { |
74 | __u32 ir_net; | 74 | __be32 ir_net; |
75 | struct ipx_interface *ir_intrfc; | 75 | struct ipx_interface *ir_intrfc; |
76 | unsigned char ir_routed; | 76 | unsigned char ir_routed; |
77 | unsigned char ir_router_node[IPX_NODE_LEN]; | 77 | unsigned char ir_router_node[IPX_NODE_LEN]; |
@@ -82,10 +82,10 @@ struct ipx_route { | |||
82 | #ifdef __KERNEL__ | 82 | #ifdef __KERNEL__ |
83 | struct ipx_cb { | 83 | struct ipx_cb { |
84 | u8 ipx_tctrl; | 84 | u8 ipx_tctrl; |
85 | u32 ipx_dest_net; | 85 | __be32 ipx_dest_net; |
86 | u32 ipx_source_net; | 86 | __be32 ipx_source_net; |
87 | struct { | 87 | struct { |
88 | u32 netnum; | 88 | __be32 netnum; |
89 | int index; | 89 | int index; |
90 | } last_hop; | 90 | } last_hop; |
91 | }; | 91 | }; |
@@ -97,7 +97,7 @@ struct ipx_sock { | |||
97 | struct sock sk; | 97 | struct sock sk; |
98 | struct ipx_address dest_addr; | 98 | struct ipx_address dest_addr; |
99 | struct ipx_interface *intrfc; | 99 | struct ipx_interface *intrfc; |
100 | unsigned short port; | 100 | __be16 port; |
101 | #ifdef CONFIG_IPX_INTERN | 101 | #ifdef CONFIG_IPX_INTERN |
102 | unsigned char node[IPX_NODE_LEN]; | 102 | unsigned char node[IPX_NODE_LEN]; |
103 | #endif | 103 | #endif |
@@ -132,7 +132,7 @@ extern struct ipx_interface *ipx_primary_net; | |||
132 | extern int ipx_proc_init(void); | 132 | extern int ipx_proc_init(void); |
133 | extern void ipx_proc_exit(void); | 133 | extern void ipx_proc_exit(void); |
134 | 134 | ||
135 | extern const char *ipx_frame_name(unsigned short); | 135 | extern const char *ipx_frame_name(__be16); |
136 | extern const char *ipx_device_name(struct ipx_interface *intrfc); | 136 | extern const char *ipx_device_name(struct ipx_interface *intrfc); |
137 | 137 | ||
138 | static __inline__ void ipxitf_hold(struct ipx_interface *intrfc) | 138 | static __inline__ void ipxitf_hold(struct ipx_interface *intrfc) |
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index c63a58058e21..12c214b9eadf 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/net.h> | 34 | #include <linux/net.h> |
35 | #include <linux/skbuff.h> | 35 | #include <linux/skbuff.h> |
36 | #include <net/netlink.h> | 36 | #include <net/netlink.h> |
37 | #include <asm/atomic.h> | ||
37 | 38 | ||
38 | /* | 39 | /* |
39 | * NetLabel - A management interface for maintaining network packet label | 40 | * NetLabel - A management interface for maintaining network packet label |
@@ -106,6 +107,7 @@ int netlbl_domhsh_remove(const char *domain, struct netlbl_audit *audit_info); | |||
106 | 107 | ||
107 | /* LSM security attributes */ | 108 | /* LSM security attributes */ |
108 | struct netlbl_lsm_cache { | 109 | struct netlbl_lsm_cache { |
110 | atomic_t refcount; | ||
109 | void (*free) (const void *data); | 111 | void (*free) (const void *data); |
110 | void *data; | 112 | void *data; |
111 | }; | 113 | }; |
@@ -117,7 +119,7 @@ struct netlbl_lsm_secattr { | |||
117 | unsigned char *mls_cat; | 119 | unsigned char *mls_cat; |
118 | size_t mls_cat_len; | 120 | size_t mls_cat_len; |
119 | 121 | ||
120 | struct netlbl_lsm_cache cache; | 122 | struct netlbl_lsm_cache *cache; |
121 | }; | 123 | }; |
122 | 124 | ||
123 | /* | 125 | /* |
@@ -126,6 +128,43 @@ struct netlbl_lsm_secattr { | |||
126 | 128 | ||
127 | 129 | ||
128 | /** | 130 | /** |
131 | * netlbl_secattr_cache_alloc - Allocate and initialize a secattr cache | ||
132 | * @flags: the memory allocation flags | ||
133 | * | ||
134 | * Description: | ||
135 | * Allocate and initialize a netlbl_lsm_cache structure. Returns a pointer | ||
136 | * on success, NULL on failure. | ||
137 | * | ||
138 | */ | ||
139 | static inline struct netlbl_lsm_cache *netlbl_secattr_cache_alloc(gfp_t flags) | ||
140 | { | ||
141 | struct netlbl_lsm_cache *cache; | ||
142 | |||
143 | cache = kzalloc(sizeof(*cache), flags); | ||
144 | if (cache) | ||
145 | atomic_set(&cache->refcount, 1); | ||
146 | return cache; | ||
147 | } | ||
148 | |||
149 | /** | ||
150 | * netlbl_secattr_cache_free - Frees a netlbl_lsm_cache struct | ||
151 | * @cache: the struct to free | ||
152 | * | ||
153 | * Description: | ||
154 | * Frees @secattr including all of the internal buffers. | ||
155 | * | ||
156 | */ | ||
157 | static inline void netlbl_secattr_cache_free(struct netlbl_lsm_cache *cache) | ||
158 | { | ||
159 | if (!atomic_dec_and_test(&cache->refcount)) | ||
160 | return; | ||
161 | |||
162 | if (cache->free) | ||
163 | cache->free(cache->data); | ||
164 | kfree(cache); | ||
165 | } | ||
166 | |||
167 | /** | ||
129 | * netlbl_secattr_init - Initialize a netlbl_lsm_secattr struct | 168 | * netlbl_secattr_init - Initialize a netlbl_lsm_secattr struct |
130 | * @secattr: the struct to initialize | 169 | * @secattr: the struct to initialize |
131 | * | 170 | * |
@@ -143,20 +182,16 @@ static inline int netlbl_secattr_init(struct netlbl_lsm_secattr *secattr) | |||
143 | /** | 182 | /** |
144 | * netlbl_secattr_destroy - Clears a netlbl_lsm_secattr struct | 183 | * netlbl_secattr_destroy - Clears a netlbl_lsm_secattr struct |
145 | * @secattr: the struct to clear | 184 | * @secattr: the struct to clear |
146 | * @clear_cache: cache clear flag | ||
147 | * | 185 | * |
148 | * Description: | 186 | * Description: |
149 | * Destroys the @secattr struct, including freeing all of the internal buffers. | 187 | * Destroys the @secattr struct, including freeing all of the internal buffers. |
150 | * If @clear_cache is true then free the cache fields, otherwise leave them | 188 | * The struct must be reset with a call to netlbl_secattr_init() before reuse. |
151 | * intact. The struct must be reset with a call to netlbl_secattr_init() | ||
152 | * before reuse. | ||
153 | * | 189 | * |
154 | */ | 190 | */ |
155 | static inline void netlbl_secattr_destroy(struct netlbl_lsm_secattr *secattr, | 191 | static inline void netlbl_secattr_destroy(struct netlbl_lsm_secattr *secattr) |
156 | u32 clear_cache) | ||
157 | { | 192 | { |
158 | if (clear_cache && secattr->cache.data != NULL && secattr->cache.free) | 193 | if (secattr->cache) |
159 | secattr->cache.free(secattr->cache.data); | 194 | netlbl_secattr_cache_free(secattr->cache); |
160 | kfree(secattr->domain); | 195 | kfree(secattr->domain); |
161 | kfree(secattr->mls_cat); | 196 | kfree(secattr->mls_cat); |
162 | } | 197 | } |
@@ -178,17 +213,14 @@ static inline struct netlbl_lsm_secattr *netlbl_secattr_alloc(int flags) | |||
178 | /** | 213 | /** |
179 | * netlbl_secattr_free - Frees a netlbl_lsm_secattr struct | 214 | * netlbl_secattr_free - Frees a netlbl_lsm_secattr struct |
180 | * @secattr: the struct to free | 215 | * @secattr: the struct to free |
181 | * @clear_cache: cache clear flag | ||
182 | * | 216 | * |
183 | * Description: | 217 | * Description: |
184 | * Frees @secattr including all of the internal buffers. If @clear_cache is | 218 | * Frees @secattr including all of the internal buffers. |
185 | * true then free the cache fields, otherwise leave them intact. | ||
186 | * | 219 | * |
187 | */ | 220 | */ |
188 | static inline void netlbl_secattr_free(struct netlbl_lsm_secattr *secattr, | 221 | static inline void netlbl_secattr_free(struct netlbl_lsm_secattr *secattr) |
189 | u32 clear_cache) | ||
190 | { | 222 | { |
191 | netlbl_secattr_destroy(secattr, clear_cache); | 223 | netlbl_secattr_destroy(secattr); |
192 | kfree(secattr); | 224 | kfree(secattr); |
193 | } | 225 | } |
194 | 226 | ||
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index ee68a3124076..764e3af5be93 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -139,6 +139,7 @@ int sctp_inet_listen(struct socket *sock, int backlog); | |||
139 | void sctp_write_space(struct sock *sk); | 139 | void sctp_write_space(struct sock *sk); |
140 | unsigned int sctp_poll(struct file *file, struct socket *sock, | 140 | unsigned int sctp_poll(struct file *file, struct socket *sock, |
141 | poll_table *wait); | 141 | poll_table *wait); |
142 | void sctp_sock_rfree(struct sk_buff *skb); | ||
142 | 143 | ||
143 | /* | 144 | /* |
144 | * sctp/primitive.c | 145 | * sctp/primitive.c |
@@ -444,6 +445,19 @@ static inline struct list_head *sctp_list_dequeue(struct list_head *list) | |||
444 | return result; | 445 | return result; |
445 | } | 446 | } |
446 | 447 | ||
448 | /* SCTP version of skb_set_owner_r. We need this one because | ||
449 | * of the way we have to do receive buffer accounting on bundled | ||
450 | * chunks. | ||
451 | */ | ||
452 | static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | ||
453 | { | ||
454 | struct sctp_ulpevent *event = sctp_skb2event(skb); | ||
455 | |||
456 | skb->sk = sk; | ||
457 | skb->destructor = sctp_sock_rfree; | ||
458 | atomic_add(event->rmem_len, &sk->sk_rmem_alloc); | ||
459 | } | ||
460 | |||
447 | /* Tests if the list has one and only one entry. */ | 461 | /* Tests if the list has one and only one entry. */ |
448 | static inline int sctp_list_single_entry(struct list_head *head) | 462 | static inline int sctp_list_single_entry(struct list_head *head) |
449 | { | 463 | { |
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h index 6c40cfc4832d..1a4ddc1ec7d2 100644 --- a/include/net/sctp/ulpevent.h +++ b/include/net/sctp/ulpevent.h | |||
@@ -63,6 +63,7 @@ struct sctp_ulpevent { | |||
63 | __u32 cumtsn; | 63 | __u32 cumtsn; |
64 | int msg_flags; | 64 | int msg_flags; |
65 | int iif; | 65 | int iif; |
66 | unsigned int rmem_len; | ||
66 | }; | 67 | }; |
67 | 68 | ||
68 | /* Retrieve the skb this event sits inside of. */ | 69 | /* Retrieve the skb this event sits inside of. */ |
diff --git a/include/net/sock.h b/include/net/sock.h index 40bb90ebb2d1..ac286a353032 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -884,8 +884,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb) | |||
884 | 884 | ||
885 | /** | 885 | /** |
886 | * sk_filter_release: Release a socket filter | 886 | * sk_filter_release: Release a socket filter |
887 | * @sk: socket | 887 | * @rcu: rcu_head that contains the sk_filter info to remove |
888 | * @fp: filter to remove | ||
889 | * | 888 | * |
890 | * Remove a filter from a socket and release its resources. | 889 | * Remove a filter from a socket and release its resources. |
891 | */ | 890 | */ |
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h index 2544281e1d5e..be293d795e38 100644 --- a/include/net/timewait_sock.h +++ b/include/net/timewait_sock.h | |||
@@ -19,6 +19,7 @@ struct timewait_sock_ops { | |||
19 | unsigned int twsk_obj_size; | 19 | unsigned int twsk_obj_size; |
20 | int (*twsk_unique)(struct sock *sk, | 20 | int (*twsk_unique)(struct sock *sk, |
21 | struct sock *sktw, void *twp); | 21 | struct sock *sktw, void *twp); |
22 | void (*twsk_destructor)(struct sock *sk); | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | 25 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) |
@@ -28,4 +29,10 @@ static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | |||
28 | return 0; | 29 | return 0; |
29 | } | 30 | } |
30 | 31 | ||
32 | static inline void twsk_destructor(struct sock *sk) | ||
33 | { | ||
34 | if (sk->sk_prot->twsk_prot->twsk_destructor != NULL) | ||
35 | sk->sk_prot->twsk_prot->twsk_destructor(sk); | ||
36 | } | ||
37 | |||
31 | #endif /* _TIMEWAIT_SOCK_H */ | 38 | #endif /* _TIMEWAIT_SOCK_H */ |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 1e2a4ddec96e..737fdb2ee8a4 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -995,7 +995,8 @@ struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, | |||
995 | int create, unsigned short family); | 995 | int create, unsigned short family); |
996 | extern void xfrm_policy_flush(u8 type); | 996 | extern void xfrm_policy_flush(u8 type); |
997 | extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); | 997 | extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); |
998 | extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family, int strict); | 998 | extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, |
999 | struct flowi *fl, int family, int strict); | ||
999 | extern void xfrm_init_pmtu(struct dst_entry *dst); | 1000 | extern void xfrm_init_pmtu(struct dst_entry *dst); |
1000 | 1001 | ||
1001 | extern wait_queue_head_t km_waitq; | 1002 | extern wait_queue_head_t km_waitq; |