aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/arp.h2
-rw-r--r--include/net/ieee80211softmac.h3
-rw-r--r--include/net/inet6_hashtables.h70
-rw-r--r--include/net/ip.h1
-rw-r--r--include/net/ipv6.h2
-rw-r--r--include/net/sock.h1
-rw-r--r--include/net/x25device.h1
-rw-r--r--include/net/xfrm.h8
8 files changed, 17 insertions, 71 deletions
diff --git a/include/net/arp.h b/include/net/arp.h
index a13e30c35f42..643bded9f557 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -10,8 +10,6 @@
10extern struct neigh_table arp_tbl; 10extern struct neigh_table arp_tbl;
11 11
12extern void arp_init(void); 12extern void arp_init(void);
13extern int arp_rcv(struct sk_buff *skb, struct net_device *dev,
14 struct packet_type *pt, struct net_device *orig_dev);
15extern int arp_find(unsigned char *haddr, struct sk_buff *skb); 13extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
16extern int arp_ioctl(unsigned int cmd, void __user *arg); 14extern int arp_ioctl(unsigned int cmd, void __user *arg);
17extern void arp_send(int type, int ptype, u32 dest_ip, 15extern void arp_send(int type, int ptype, u32 dest_ip,
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
index b971d8c82bdd..6b3693f05ca0 100644
--- a/include/net/ieee80211softmac.h
+++ b/include/net/ieee80211softmac.h
@@ -267,8 +267,9 @@ extern void ieee80211softmac_stop(struct net_device *dev);
267#define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5 267#define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5
268#define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6 268#define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6
269#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7 269#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7
270#define IEEE80211SOFTMAC_EVENT_DISASSOCIATED 8
270/* keep this updated! */ 271/* keep this updated! */
271#define IEEE80211SOFTMAC_EVENT_LAST 7 272#define IEEE80211SOFTMAC_EVENT_LAST 8
272/* 273/*
273 * If you want to be notified of certain events, you can call 274 * If you want to be notified of certain events, you can call
274 * ieee80211softmac_notify[_atomic] with 275 * ieee80211softmac_notify[_atomic] with
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index 25f708ff020e..59f0c83d55a2 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -48,31 +48,7 @@ static inline int inet6_sk_ehashfn(const struct sock *sk)
48 return inet6_ehashfn(laddr, lport, faddr, fport); 48 return inet6_ehashfn(laddr, lport, faddr, fport);
49} 49}
50 50
51static inline void __inet6_hash(struct inet_hashinfo *hashinfo, 51extern void __inet6_hash(struct inet_hashinfo *hashinfo, struct sock *sk);
52 struct sock *sk)
53{
54 struct hlist_head *list;
55 rwlock_t *lock;
56
57 BUG_TRAP(sk_unhashed(sk));
58
59 if (sk->sk_state == TCP_LISTEN) {
60 list = &hashinfo->listening_hash[inet_sk_listen_hashfn(sk)];
61 lock = &hashinfo->lhash_lock;
62 inet_listen_wlock(hashinfo);
63 } else {
64 unsigned int hash;
65 sk->sk_hash = hash = inet6_sk_ehashfn(sk);
66 hash &= (hashinfo->ehash_size - 1);
67 list = &hashinfo->ehash[hash].chain;
68 lock = &hashinfo->ehash[hash].lock;
69 write_lock(lock);
70 }
71
72 __sk_add_node(sk, list);
73 sock_prot_inc_use(sk->sk_prot);
74 write_unlock(lock);
75}
76 52
77/* 53/*
78 * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so 54 * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so
@@ -80,52 +56,12 @@ static inline void __inet6_hash(struct inet_hashinfo *hashinfo,
80 * 56 *
81 * The sockhash lock must be held as a reader here. 57 * The sockhash lock must be held as a reader here.
82 */ 58 */
83static inline struct sock * 59extern struct sock *__inet6_lookup_established(struct inet_hashinfo *hashinfo,
84 __inet6_lookup_established(struct inet_hashinfo *hashinfo,
85 const struct in6_addr *saddr, 60 const struct in6_addr *saddr,
86 const u16 sport, 61 const u16 sport,
87 const struct in6_addr *daddr, 62 const struct in6_addr *daddr,
88 const u16 hnum, 63 const u16 hnum,
89 const int dif) 64 const int dif);
90{
91 struct sock *sk;
92 const struct hlist_node *node;
93 const __u32 ports = INET_COMBINED_PORTS(sport, hnum);
94 /* Optimize here for direct hit, only listening connections can
95 * have wildcards anyways.
96 */
97 unsigned int hash = inet6_ehashfn(daddr, hnum, saddr, sport);
98 struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash);
99
100 prefetch(head->chain.first);
101 read_lock(&head->lock);
102 sk_for_each(sk, node, &head->chain) {
103 /* For IPV6 do the cheaper port and family tests first. */
104 if (INET6_MATCH(sk, hash, saddr, daddr, ports, dif))
105 goto hit; /* You sunk my battleship! */
106 }
107 /* Must check for a TIME_WAIT'er before going to listener hash. */
108 sk_for_each(sk, node, &(head + hashinfo->ehash_size)->chain) {
109 const struct inet_timewait_sock *tw = inet_twsk(sk);
110
111 if(*((__u32 *)&(tw->tw_dport)) == ports &&
112 sk->sk_family == PF_INET6) {
113 const struct inet6_timewait_sock *tw6 = inet6_twsk(sk);
114
115 if (ipv6_addr_equal(&tw6->tw_v6_daddr, saddr) &&
116 ipv6_addr_equal(&tw6->tw_v6_rcv_saddr, daddr) &&
117 (!sk->sk_bound_dev_if || sk->sk_bound_dev_if == dif))
118 goto hit;
119 }
120 }
121 read_unlock(&head->lock);
122 return NULL;
123
124hit:
125 sock_hold(sk);
126 read_unlock(&head->lock);
127 return sk;
128}
129 65
130extern struct sock *inet6_lookup_listener(struct inet_hashinfo *hashinfo, 66extern struct sock *inet6_lookup_listener(struct inet_hashinfo *hashinfo,
131 const struct in6_addr *daddr, 67 const struct in6_addr *daddr,
diff --git a/include/net/ip.h b/include/net/ip.h
index 8fe6156ca9b0..3d2e5ca62a5a 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -95,6 +95,7 @@ extern int ip_local_deliver(struct sk_buff *skb);
95extern int ip_mr_input(struct sk_buff *skb); 95extern int ip_mr_input(struct sk_buff *skb);
96extern int ip_output(struct sk_buff *skb); 96extern int ip_output(struct sk_buff *skb);
97extern int ip_mc_output(struct sk_buff *skb); 97extern int ip_mc_output(struct sk_buff *skb);
98extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
98extern int ip_do_nat(struct sk_buff *skb); 99extern int ip_do_nat(struct sk_buff *skb);
99extern void ip_send_check(struct iphdr *ip); 100extern void ip_send_check(struct iphdr *ip);
100extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); 101extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 6d6f0634ae41..4abedb8eaece 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -230,7 +230,7 @@ extern int ip6_ra_control(struct sock *sk, int sel,
230 void (*destructor)(struct sock *)); 230 void (*destructor)(struct sock *));
231 231
232 232
233extern int ipv6_parse_hopopts(struct sk_buff *skb, int); 233extern int ipv6_parse_hopopts(struct sk_buff *skb);
234 234
235extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); 235extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt);
236extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, 236extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
diff --git a/include/net/sock.h b/include/net/sock.h
index af2b0544586e..ff8b0dad7b0f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -454,6 +454,7 @@ static inline void sk_stream_set_owner_r(struct sk_buff *skb, struct sock *sk)
454 454
455static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb) 455static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb)
456{ 456{
457 skb_truesize_check(skb);
457 sock_set_flag(sk, SOCK_QUEUE_SHRUNK); 458 sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
458 sk->sk_wmem_queued -= skb->truesize; 459 sk->sk_wmem_queued -= skb->truesize;
459 sk->sk_forward_alloc += skb->truesize; 460 sk->sk_forward_alloc += skb->truesize;
diff --git a/include/net/x25device.h b/include/net/x25device.h
index 1a318374faef..1d10c879f7e2 100644
--- a/include/net/x25device.h
+++ b/include/net/x25device.h
@@ -8,6 +8,7 @@
8static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev) 8static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev)
9{ 9{
10 skb->mac.raw = skb->data; 10 skb->mac.raw = skb->data;
11 skb->dev = dev;
11 skb->pkt_type = PACKET_HOST; 12 skb->pkt_type = PACKET_HOST;
12 13
13 return htons(ETH_P_X25); 14 return htons(ETH_P_X25);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 0d5529c382e8..afa508d92c93 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -143,6 +143,11 @@ struct xfrm_state
143 /* Replay detection state at the time we sent the last notification */ 143 /* Replay detection state at the time we sent the last notification */
144 struct xfrm_replay_state preplay; 144 struct xfrm_replay_state preplay;
145 145
146 /* internal flag that only holds state for delayed aevent at the
147 * moment
148 */
149 u32 xflags;
150
146 /* Replay detection notification settings */ 151 /* Replay detection notification settings */
147 u32 replay_maxage; 152 u32 replay_maxage;
148 u32 replay_maxdiff; 153 u32 replay_maxdiff;
@@ -168,6 +173,9 @@ struct xfrm_state
168 void *data; 173 void *data;
169}; 174};
170 175
176/* xflags - make enum if more show up */
177#define XFRM_TIME_DEFER 1
178
171enum { 179enum {
172 XFRM_STATE_VOID, 180 XFRM_STATE_VOID,
173 XFRM_STATE_ACQ, 181 XFRM_STATE_ACQ,