aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/if_link.h23
-rw-r--r--include/linux/if_macvlan.h3
-rw-r--r--include/linux/ipv6.h1
-rw-r--r--include/linux/mroute6.h35
-rw-r--r--include/linux/netdevice.h1
-rw-r--r--include/linux/netfilter/x_tables.h45
-rw-r--r--include/linux/rtnetlink.h3
-rw-r--r--include/linux/skbuff.h58
-rw-r--r--include/linux/sysctl.h2
-rw-r--r--include/linux/tipc.h6
-rw-r--r--include/linux/tipc_config.h1
-rw-r--r--include/net/dst.h48
-rw-r--r--include/net/ip.h6
-rw-r--r--include/net/netns/ipv6.h14
-rw-r--r--include/net/route.h17
-rw-r--r--include/net/sock.h21
-rw-r--r--include/net/tcp.h21
-rw-r--r--include/net/tipc/tipc.h16
-rw-r--r--include/net/x25.h10
19 files changed, 222 insertions, 109 deletions
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index cfd420ba72df..c3af67fce3f2 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -111,10 +111,7 @@ enum {
111 IFLA_NET_NS_PID, 111 IFLA_NET_NS_PID,
112 IFLA_IFALIAS, 112 IFLA_IFALIAS,
113 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */ 113 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
114 IFLA_VF_MAC, /* Hardware queue specific attributes */ 114 IFLA_VFINFO_LIST,
115 IFLA_VF_VLAN,
116 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
117 IFLA_VFINFO,
118 IFLA_STATS64, 115 IFLA_STATS64,
119 __IFLA_MAX 116 __IFLA_MAX
120}; 117};
@@ -236,6 +233,24 @@ enum macvlan_mode {
236 233
237/* SR-IOV virtual function managment section */ 234/* SR-IOV virtual function managment section */
238 235
236enum {
237 IFLA_VF_INFO_UNSPEC,
238 IFLA_VF_INFO,
239 __IFLA_VF_INFO_MAX,
240};
241
242#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
243
244enum {
245 IFLA_VF_UNSPEC,
246 IFLA_VF_MAC, /* Hardware queue specific attributes */
247 IFLA_VF_VLAN,
248 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
249 __IFLA_VF_MAX,
250};
251
252#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
253
239struct ifla_vf_mac { 254struct ifla_vf_mac {
240 __u32 vf; 255 __u32 vf;
241 __u8 mac[32]; /* MAX_ADDR_LEN */ 256 __u8 mac[32]; /* MAX_ADDR_LEN */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index b78a712247da..9ea047aca795 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -85,6 +85,7 @@ extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
85 struct net_device *dev); 85 struct net_device *dev);
86 86
87 87
88extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); 88extern struct sk_buff *(*macvlan_handle_frame_hook)(struct macvlan_port *,
89 struct sk_buff *);
89 90
90#endif /* _LINUX_IF_MACVLAN_H */ 91#endif /* _LINUX_IF_MACVLAN_H */
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 0e269038bb38..99e1ab7e3eec 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -383,6 +383,7 @@ struct raw6_sock {
383 __u32 checksum; /* perform checksum */ 383 __u32 checksum; /* perform checksum */
384 __u32 offset; /* checksum offset */ 384 __u32 offset; /* checksum offset */
385 struct icmp6_filter filter; 385 struct icmp6_filter filter;
386 __u32 ip6mr_table;
386 /* ipv6_pinfo has to be the last member of raw6_sock, see inet6_sk_generic */ 387 /* ipv6_pinfo has to be the last member of raw6_sock, see inet6_sk_generic */
387 struct ipv6_pinfo inet6; 388 struct ipv6_pinfo inet6;
388}; 389};
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index 2caa1a8e525d..6091ab77f388 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -24,7 +24,8 @@
24#define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */ 24#define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */
25#define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */ 25#define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */
26#define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */ 26#define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */
27#define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */ 27#define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */
28#define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */
28 29
29#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */ 30#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */
30#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1) 31#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)
@@ -182,10 +183,7 @@ struct mif_device {
182#define VIFF_STATIC 0x8000 183#define VIFF_STATIC 0x8000
183 184
184struct mfc6_cache { 185struct mfc6_cache {
185 struct mfc6_cache *next; /* Next entry on cache line */ 186 struct list_head list;
186#ifdef CONFIG_NET_NS
187 struct net *mfc6_net;
188#endif
189 struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */ 187 struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */
190 struct in6_addr mf6c_origin; /* Source of packet */ 188 struct in6_addr mf6c_origin; /* Source of packet */
191 mifi_t mf6c_parent; /* Source interface */ 189 mifi_t mf6c_parent; /* Source interface */
@@ -208,18 +206,6 @@ struct mfc6_cache {
208 } mfc_un; 206 } mfc_un;
209}; 207};
210 208
211static inline
212struct net *mfc6_net(const struct mfc6_cache *mfc)
213{
214 return read_pnet(&mfc->mfc6_net);
215}
216
217static inline
218void mfc6_net_set(struct mfc6_cache *mfc, struct net *net)
219{
220 write_pnet(&mfc->mfc6_net, hold_net(net));
221}
222
223#define MFC_STATIC 1 209#define MFC_STATIC 1
224#define MFC_NOTIFY 2 210#define MFC_NOTIFY 2
225 211
@@ -244,14 +230,17 @@ extern int ip6mr_get_route(struct net *net, struct sk_buff *skb,
244 struct rtmsg *rtm, int nowait); 230 struct rtmsg *rtm, int nowait);
245 231
246#ifdef CONFIG_IPV6_MROUTE 232#ifdef CONFIG_IPV6_MROUTE
247static inline struct sock *mroute6_socket(struct net *net) 233extern struct sock *mroute6_socket(struct net *net, struct sk_buff *skb);
248{
249 return net->ipv6.mroute6_sk;
250}
251extern int ip6mr_sk_done(struct sock *sk); 234extern int ip6mr_sk_done(struct sock *sk);
252#else 235#else
253static inline struct sock *mroute6_socket(struct net *net) { return NULL; } 236static inline struct sock *mroute6_socket(struct net *net, struct sk_buff *skb)
254static inline int ip6mr_sk_done(struct sock *sk) { return 0; } 237{
238 return NULL;
239}
240static inline int ip6mr_sk_done(struct sock *sk)
241{
242 return 0;
243}
255#endif 244#endif
256#endif 245#endif
257 246
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 69022d47d6f2..c1b2341897c2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2100,6 +2100,7 @@ extern const struct net_device_stats *dev_get_stats(struct net_device *dev);
2100extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); 2100extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats);
2101 2101
2102extern int netdev_max_backlog; 2102extern int netdev_max_backlog;
2103extern int netdev_tstamp_prequeue;
2103extern int weight_p; 2104extern int weight_p;
2104extern int netdev_set_master(struct net_device *dev, struct net_device *master); 2105extern int netdev_set_master(struct net_device *dev, struct net_device *master);
2105extern int skb_checksum_help(struct sk_buff *skb); 2106extern int skb_checksum_help(struct sk_buff *skb);
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index eeb4884c30be..c2ee5d8550cf 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -183,29 +183,39 @@ struct xt_counters_info {
183#include <linux/netdevice.h> 183#include <linux/netdevice.h>
184 184
185/** 185/**
186 * struct xt_match_param - parameters for match extensions' match functions 186 * struct xt_action_param - parameters for matches/targets
187 * 187 *
188 * @match: the match extension
189 * @target: the target extension
190 * @matchinfo: per-match data
191 * @targetinfo: per-target data
188 * @in: input netdevice 192 * @in: input netdevice
189 * @out: output netdevice 193 * @out: output netdevice
190 * @match: struct xt_match through which this function was invoked
191 * @matchinfo: per-match data
192 * @fragoff: packet is a fragment, this is the data offset 194 * @fragoff: packet is a fragment, this is the data offset
193 * @thoff: position of transport header relative to skb->data 195 * @thoff: position of transport header relative to skb->data
194 * @hook: hook number given packet came from 196 * @hook: hook number given packet came from
195 * @family: Actual NFPROTO_* through which the function is invoked 197 * @family: Actual NFPROTO_* through which the function is invoked
196 * (helpful when match->family == NFPROTO_UNSPEC) 198 * (helpful when match->family == NFPROTO_UNSPEC)
199 *
200 * Fields written to by extensions:
201 *
197 * @hotdrop: drop packet if we had inspection problems 202 * @hotdrop: drop packet if we had inspection problems
198 * Network namespace obtainable using dev_net(in/out) 203 * Network namespace obtainable using dev_net(in/out)
199 */ 204 */
200struct xt_match_param { 205struct xt_action_param {
206 union {
207 const struct xt_match *match;
208 const struct xt_target *target;
209 };
210 union {
211 const void *matchinfo, *targinfo;
212 };
201 const struct net_device *in, *out; 213 const struct net_device *in, *out;
202 const struct xt_match *match;
203 const void *matchinfo;
204 int fragoff; 214 int fragoff;
205 unsigned int thoff; 215 unsigned int thoff;
206 unsigned int hooknum; 216 unsigned int hooknum;
207 u_int8_t family; 217 u_int8_t family;
208 bool *hotdrop; 218 bool hotdrop;
209}; 219};
210 220
211/** 221/**
@@ -243,23 +253,6 @@ struct xt_mtdtor_param {
243}; 253};
244 254
245/** 255/**
246 * struct xt_target_param - parameters for target extensions' target functions
247 *
248 * @hooknum: hook through which this target was invoked
249 * @target: struct xt_target through which this function was invoked
250 * @targinfo: per-target data
251 *
252 * Other fields see above.
253 */
254struct xt_target_param {
255 const struct net_device *in, *out;
256 const struct xt_target *target;
257 const void *targinfo;
258 unsigned int hooknum;
259 u_int8_t family;
260};
261
262/**
263 * struct xt_tgchk_param - parameters for target extensions' 256 * struct xt_tgchk_param - parameters for target extensions'
264 * checkentry functions 257 * checkentry functions
265 * 258 *
@@ -298,7 +291,7 @@ struct xt_match {
298 non-linear skb, using skb_header_pointer and 291 non-linear skb, using skb_header_pointer and
299 skb_ip_make_writable. */ 292 skb_ip_make_writable. */
300 bool (*match)(const struct sk_buff *skb, 293 bool (*match)(const struct sk_buff *skb,
301 const struct xt_match_param *); 294 struct xt_action_param *);
302 295
303 /* Called when user tries to insert an entry of this type. */ 296 /* Called when user tries to insert an entry of this type. */
304 int (*checkentry)(const struct xt_mtchk_param *); 297 int (*checkentry)(const struct xt_mtchk_param *);
@@ -335,7 +328,7 @@ struct xt_target {
335 must now handle non-linear skbs, using skb_copy_bits and 328 must now handle non-linear skbs, using skb_copy_bits and
336 skb_ip_make_writable. */ 329 skb_ip_make_writable. */
337 unsigned int (*target)(struct sk_buff *skb, 330 unsigned int (*target)(struct sk_buff *skb,
338 const struct xt_target_param *); 331 const struct xt_action_param *);
339 332
340 /* Called when user tries to insert an entry of this type: 333 /* Called when user tries to insert an entry of this type:
341 hook_mask is a bitmask of hooks from which it can be 334 hook_mask is a bitmask of hooks from which it can be
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 5a42c36cb6aa..fbc8cb0d48c3 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -11,7 +11,8 @@
11 * families, values above 128 may be used arbitrarily. 11 * families, values above 128 may be used arbitrarily.
12 */ 12 */
13#define RTNL_FAMILY_IPMR 128 13#define RTNL_FAMILY_IPMR 128
14#define RTNL_FAMILY_MAX 128 14#define RTNL_FAMILY_IP6MR 129
15#define RTNL_FAMILY_MAX 129
15 16
16/**** 17/****
17 * Routing/neighbour discovery messages. 18 * Routing/neighbour discovery messages.
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c9525bce80f6..7cdfb4d52847 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -264,7 +264,7 @@ typedef unsigned char *sk_buff_data_t;
264 * @transport_header: Transport layer header 264 * @transport_header: Transport layer header
265 * @network_header: Network layer header 265 * @network_header: Network layer header
266 * @mac_header: Link layer header 266 * @mac_header: Link layer header
267 * @_skb_dst: destination entry 267 * @_skb_refdst: destination entry (with norefcount bit)
268 * @sp: the security path, used for xfrm 268 * @sp: the security path, used for xfrm
269 * @cb: Control buffer. Free for use by every layer. Put private vars here 269 * @cb: Control buffer. Free for use by every layer. Put private vars here
270 * @len: Length of actual data 270 * @len: Length of actual data
@@ -328,7 +328,7 @@ struct sk_buff {
328 */ 328 */
329 char cb[48] __aligned(8); 329 char cb[48] __aligned(8);
330 330
331 unsigned long _skb_dst; 331 unsigned long _skb_refdst;
332#ifdef CONFIG_XFRM 332#ifdef CONFIG_XFRM
333 struct sec_path *sp; 333 struct sec_path *sp;
334#endif 334#endif
@@ -419,14 +419,64 @@ struct sk_buff {
419 419
420#include <asm/system.h> 420#include <asm/system.h>
421 421
422/*
423 * skb might have a dst pointer attached, refcounted or not.
424 * _skb_refdst low order bit is set if refcount was _not_ taken
425 */
426#define SKB_DST_NOREF 1UL
427#define SKB_DST_PTRMASK ~(SKB_DST_NOREF)
428
429/**
430 * skb_dst - returns skb dst_entry
431 * @skb: buffer
432 *
433 * Returns skb dst_entry, regardless of reference taken or not.
434 */
422static inline struct dst_entry *skb_dst(const struct sk_buff *skb) 435static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
423{ 436{
424 return (struct dst_entry *)skb->_skb_dst; 437 /* If refdst was not refcounted, check we still are in a
438 * rcu_read_lock section
439 */
440 WARN_ON((skb->_skb_refdst & SKB_DST_NOREF) &&
441 !rcu_read_lock_held() &&
442 !rcu_read_lock_bh_held());
443 return (struct dst_entry *)(skb->_skb_refdst & SKB_DST_PTRMASK);
425} 444}
426 445
446/**
447 * skb_dst_set - sets skb dst
448 * @skb: buffer
449 * @dst: dst entry
450 *
451 * Sets skb dst, assuming a reference was taken on dst and should
452 * be released by skb_dst_drop()
453 */
427static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) 454static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
428{ 455{
429 skb->_skb_dst = (unsigned long)dst; 456 skb->_skb_refdst = (unsigned long)dst;
457}
458
459/**
460 * skb_dst_set_noref - sets skb dst, without a reference
461 * @skb: buffer
462 * @dst: dst entry
463 *
464 * Sets skb dst, assuming a reference was not taken on dst
465 * skb_dst_drop() should not dst_release() this dst
466 */
467static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst)
468{
469 WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held());
470 skb->_skb_refdst = (unsigned long)dst | SKB_DST_NOREF;
471}
472
473/**
474 * skb_dst_is_noref - Test if skb dst isnt refcounted
475 * @skb: buffer
476 */
477static inline bool skb_dst_is_noref(const struct sk_buff *skb)
478{
479 return (skb->_skb_refdst & SKB_DST_NOREF) && skb_dst(skb);
430} 480}
431 481
432static inline struct rtable *skb_rtable(const struct sk_buff *skb) 482static inline struct rtable *skb_rtable(const struct sk_buff *skb)
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index f66014c90c9f..7bb5cb64f3b8 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -980,6 +980,8 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int,
980 void __user *, size_t *, loff_t *); 980 void __user *, size_t *, loff_t *);
981extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, 981extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
982 void __user *, size_t *, loff_t *); 982 void __user *, size_t *, loff_t *);
983extern int proc_do_large_bitmap(struct ctl_table *, int,
984 void __user *, size_t *, loff_t *);
983 985
984/* 986/*
985 * Register a set of sysctl names by calling register_sysctl_table 987 * Register a set of sysctl names by calling register_sysctl_table
diff --git a/include/linux/tipc.h b/include/linux/tipc.h
index 9536d8aeadf1..181c8d0e6f73 100644
--- a/include/linux/tipc.h
+++ b/include/linux/tipc.h
@@ -107,7 +107,7 @@ static inline unsigned int tipc_node(__u32 addr)
107 * Message importance levels 107 * Message importance levels
108 */ 108 */
109 109
110#define TIPC_LOW_IMPORTANCE 0 /* default */ 110#define TIPC_LOW_IMPORTANCE 0
111#define TIPC_MEDIUM_IMPORTANCE 1 111#define TIPC_MEDIUM_IMPORTANCE 1
112#define TIPC_HIGH_IMPORTANCE 2 112#define TIPC_HIGH_IMPORTANCE 2
113#define TIPC_CRITICAL_IMPORTANCE 3 113#define TIPC_CRITICAL_IMPORTANCE 3
@@ -182,7 +182,7 @@ struct sockaddr_tipc {
182 struct tipc_name_seq nameseq; 182 struct tipc_name_seq nameseq;
183 struct { 183 struct {
184 struct tipc_name name; 184 struct tipc_name name;
185 __u32 domain; /* 0: own zone */ 185 __u32 domain;
186 } name; 186 } name;
187 } addr; 187 } addr;
188}; 188};
@@ -200,7 +200,7 @@ struct sockaddr_tipc {
200 */ 200 */
201 201
202#define TIPC_IMPORTANCE 127 /* Default: TIPC_LOW_IMPORTANCE */ 202#define TIPC_IMPORTANCE 127 /* Default: TIPC_LOW_IMPORTANCE */
203#define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */ 203#define TIPC_SRC_DROPPABLE 128 /* Default: based on socket type */
204#define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */ 204#define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */
205#define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */ 205#define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */
206#define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ 206#define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 2bc6fa4adeb5..9cde86c32412 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -74,6 +74,7 @@
74#define TIPC_CMD_SHOW_NAME_TABLE 0x0005 /* tx name_tbl_query, rx ultra_string */ 74#define TIPC_CMD_SHOW_NAME_TABLE 0x0005 /* tx name_tbl_query, rx ultra_string */
75#define TIPC_CMD_SHOW_PORTS 0x0006 /* tx none, rx ultra_string */ 75#define TIPC_CMD_SHOW_PORTS 0x0006 /* tx none, rx ultra_string */
76#define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */ 76#define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */
77#define TIPC_CMD_SHOW_STATS 0x000F /* tx unsigned, rx ultra_string */
77 78
78#if 0 79#if 0
79#define TIPC_CMD_SHOW_PORT_STATS 0x0008 /* tx port_ref, rx ultra_string */ 80#define TIPC_CMD_SHOW_PORT_STATS 0x0008 /* tx port_ref, rx ultra_string */
diff --git a/include/net/dst.h b/include/net/dst.h
index aac5a5fcfda9..27207a13f2a6 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -168,6 +168,12 @@ static inline void dst_use(struct dst_entry *dst, unsigned long time)
168 dst->lastuse = time; 168 dst->lastuse = time;
169} 169}
170 170
171static inline void dst_use_noref(struct dst_entry *dst, unsigned long time)
172{
173 dst->__use++;
174 dst->lastuse = time;
175}
176
171static inline 177static inline
172struct dst_entry * dst_clone(struct dst_entry * dst) 178struct dst_entry * dst_clone(struct dst_entry * dst)
173{ 179{
@@ -177,11 +183,47 @@ struct dst_entry * dst_clone(struct dst_entry * dst)
177} 183}
178 184
179extern void dst_release(struct dst_entry *dst); 185extern void dst_release(struct dst_entry *dst);
186
187static inline void refdst_drop(unsigned long refdst)
188{
189 if (!(refdst & SKB_DST_NOREF))
190 dst_release((struct dst_entry *)(refdst & SKB_DST_PTRMASK));
191}
192
193/**
194 * skb_dst_drop - drops skb dst
195 * @skb: buffer
196 *
197 * Drops dst reference count if a reference was taken.
198 */
180static inline void skb_dst_drop(struct sk_buff *skb) 199static inline void skb_dst_drop(struct sk_buff *skb)
181{ 200{
182 if (skb->_skb_dst) 201 if (skb->_skb_refdst) {
183 dst_release(skb_dst(skb)); 202 refdst_drop(skb->_skb_refdst);
184 skb->_skb_dst = 0UL; 203 skb->_skb_refdst = 0UL;
204 }
205}
206
207static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb)
208{
209 nskb->_skb_refdst = oskb->_skb_refdst;
210 if (!(nskb->_skb_refdst & SKB_DST_NOREF))
211 dst_clone(skb_dst(nskb));
212}
213
214/**
215 * skb_dst_force - makes sure skb dst is refcounted
216 * @skb: buffer
217 *
218 * If dst is not yet refcounted, let's do it
219 */
220static inline void skb_dst_force(struct sk_buff *skb)
221{
222 if (skb_dst_is_noref(skb)) {
223 WARN_ON(!rcu_read_lock_held());
224 skb->_skb_refdst &= ~SKB_DST_NOREF;
225 dst_clone(skb_dst(skb));
226 }
185} 227}
186 228
187/* Children define the path of the packet through the 229/* Children define the path of the packet through the
diff --git a/include/net/ip.h b/include/net/ip.h
index 8149b77cea9b..63548f0a44b1 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -184,6 +184,12 @@ extern struct local_ports {
184} sysctl_local_ports; 184} sysctl_local_ports;
185extern void inet_get_local_port_range(int *low, int *high); 185extern void inet_get_local_port_range(int *low, int *high);
186 186
187extern unsigned long *sysctl_local_reserved_ports;
188static inline int inet_is_reserved_local_port(int port)
189{
190 return test_bit(port, sysctl_local_reserved_ports);
191}
192
187extern int sysctl_ip_default_ttl; 193extern int sysctl_ip_default_ttl;
188extern int sysctl_ip_nonlocal_bind; 194extern int sysctl_ip_nonlocal_bind;
189 195
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 1f11ebc22151..81abfcb2eb4e 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -59,15 +59,11 @@ struct netns_ipv6 {
59 struct sock *tcp_sk; 59 struct sock *tcp_sk;
60 struct sock *igmp_sk; 60 struct sock *igmp_sk;
61#ifdef CONFIG_IPV6_MROUTE 61#ifdef CONFIG_IPV6_MROUTE
62 struct sock *mroute6_sk; 62#ifndef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
63 struct mfc6_cache **mfc6_cache_array; 63 struct mr6_table *mrt6;
64 struct mif_device *vif6_table; 64#else
65 int maxvif; 65 struct list_head mr6_tables;
66 atomic_t cache_resolve_queue_len; 66 struct fib_rules_ops *mr6_rules_ops;
67 int mroute_do_assert;
68 int mroute_do_pim;
69#ifdef CONFIG_IPV6_PIMSM_V2
70 int mroute_reg_vif_num;
71#endif 67#endif
72#endif 68#endif
73}; 69};
diff --git a/include/net/route.h b/include/net/route.h
index 2c9fba7f7731..af6cf4b4c9dc 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -112,7 +112,22 @@ extern void rt_cache_flush_batch(void);
112extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); 112extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
113extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); 113extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
114extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); 114extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
115extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin); 115
116extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src,
117 u8 tos, struct net_device *devin, bool noref);
118
119static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src,
120 u8 tos, struct net_device *devin)
121{
122 return ip_route_input_common(skb, dst, src, tos, devin, false);
123}
124
125static inline int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src,
126 u8 tos, struct net_device *devin)
127{
128 return ip_route_input_common(skb, dst, src, tos, devin, true);
129}
130
116extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev); 131extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev);
117extern void ip_rt_send_redirect(struct sk_buff *skb); 132extern void ip_rt_send_redirect(struct sk_buff *skb);
118 133
diff --git a/include/net/sock.h b/include/net/sock.h
index 328e03f47dd1..5697caf8cc76 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -177,6 +177,7 @@ struct sock_common {
177 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings 177 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings
178 * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets 178 * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets
179 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) 179 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
180 * @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK)
180 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) 181 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4)
181 * @sk_gso_max_size: Maximum GSO segment size to build 182 * @sk_gso_max_size: Maximum GSO segment size to build
182 * @sk_lingertime: %SO_LINGER l_linger setting 183 * @sk_lingertime: %SO_LINGER l_linger setting
@@ -276,6 +277,7 @@ struct sock {
276 int sk_forward_alloc; 277 int sk_forward_alloc;
277 gfp_t sk_allocation; 278 gfp_t sk_allocation;
278 int sk_route_caps; 279 int sk_route_caps;
280 int sk_route_nocaps;
279 int sk_gso_type; 281 int sk_gso_type;
280 unsigned int sk_gso_max_size; 282 unsigned int sk_gso_max_size;
281 int sk_rcvlowat; 283 int sk_rcvlowat;
@@ -598,12 +600,15 @@ static inline int sk_stream_memory_free(struct sock *sk)
598/* OOB backlog add */ 600/* OOB backlog add */
599static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) 601static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)
600{ 602{
601 if (!sk->sk_backlog.tail) { 603 /* dont let skb dst not refcounted, we are going to leave rcu lock */
602 sk->sk_backlog.head = sk->sk_backlog.tail = skb; 604 skb_dst_force(skb);
603 } else { 605
606 if (!sk->sk_backlog.tail)
607 sk->sk_backlog.head = skb;
608 else
604 sk->sk_backlog.tail->next = skb; 609 sk->sk_backlog.tail->next = skb;
605 sk->sk_backlog.tail = skb; 610
606 } 611 sk->sk_backlog.tail = skb;
607 skb->next = NULL; 612 skb->next = NULL;
608} 613}
609 614
@@ -1335,6 +1340,12 @@ static inline int sk_can_gso(const struct sock *sk)
1335 1340
1336extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst); 1341extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst);
1337 1342
1343static inline void sk_nocaps_add(struct sock *sk, int flags)
1344{
1345 sk->sk_route_nocaps |= flags;
1346 sk->sk_route_caps &= ~flags;
1347}
1348
1338static inline int skb_copy_to_page(struct sock *sk, char __user *from, 1349static inline int skb_copy_to_page(struct sock *sk, char __user *from,
1339 struct sk_buff *skb, struct page *page, 1350 struct sk_buff *skb, struct page *page,
1340 int off, int copy) 1351 int off, int copy)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index fb5c66b2ab81..a1449144848a 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1206,30 +1206,15 @@ extern int tcp_v4_md5_do_del(struct sock *sk,
1206extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); 1206extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *);
1207extern void tcp_free_md5sig_pool(void); 1207extern void tcp_free_md5sig_pool(void);
1208 1208
1209extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); 1209extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void);
1210extern void __tcp_put_md5sig_pool(void); 1210extern void tcp_put_md5sig_pool(void);
1211
1211extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); 1212extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *);
1212extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, 1213extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *,
1213 unsigned header_len); 1214 unsigned header_len);
1214extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, 1215extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp,
1215 struct tcp_md5sig_key *key); 1216 struct tcp_md5sig_key *key);
1216 1217
1217static inline
1218struct tcp_md5sig_pool *tcp_get_md5sig_pool(void)
1219{
1220 int cpu = get_cpu();
1221 struct tcp_md5sig_pool *ret = __tcp_get_md5sig_pool(cpu);
1222 if (!ret)
1223 put_cpu();
1224 return ret;
1225}
1226
1227static inline void tcp_put_md5sig_pool(void)
1228{
1229 __tcp_put_md5sig_pool();
1230 put_cpu();
1231}
1232
1233/* write queue abstraction */ 1218/* write queue abstraction */
1234static inline void tcp_write_queue_purge(struct sock *sk) 1219static inline void tcp_write_queue_purge(struct sock *sk)
1235{ 1220{
diff --git a/include/net/tipc/tipc.h b/include/net/tipc/tipc.h
index 9566608c88cf..15af6dca0b49 100644
--- a/include/net/tipc/tipc.h
+++ b/include/net/tipc/tipc.h
@@ -2,7 +2,7 @@
2 * include/net/tipc/tipc.h: Main include file for TIPC users 2 * include/net/tipc/tipc.h: Main include file for TIPC users
3 * 3 *
4 * Copyright (c) 2003-2006, Ericsson AB 4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005,2010 Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -126,7 +126,7 @@ int tipc_createport(unsigned int tipc_user,
126 tipc_msg_event message_cb, 126 tipc_msg_event message_cb,
127 tipc_named_msg_event named_message_cb, 127 tipc_named_msg_event named_message_cb,
128 tipc_conn_msg_event conn_message_cb, 128 tipc_conn_msg_event conn_message_cb,
129 tipc_continue_event continue_event_cb,/* May be zero */ 129 tipc_continue_event continue_event_cb,
130 u32 *portref); 130 u32 *portref);
131 131
132int tipc_deleteport(u32 portref); 132int tipc_deleteport(u32 portref);
@@ -145,13 +145,13 @@ int tipc_set_portunreturnable(u32 portref, unsigned int isunreturnable);
145int tipc_publish(u32 portref, unsigned int scope, 145int tipc_publish(u32 portref, unsigned int scope,
146 struct tipc_name_seq const *name_seq); 146 struct tipc_name_seq const *name_seq);
147int tipc_withdraw(u32 portref, unsigned int scope, 147int tipc_withdraw(u32 portref, unsigned int scope,
148 struct tipc_name_seq const *name_seq); /* 0: all */ 148 struct tipc_name_seq const *name_seq);
149 149
150int tipc_connect2port(u32 portref, struct tipc_portid const *port); 150int tipc_connect2port(u32 portref, struct tipc_portid const *port);
151 151
152int tipc_disconnect(u32 portref); 152int tipc_disconnect(u32 portref);
153 153
154int tipc_shutdown(u32 ref); /* Sends SHUTDOWN msg */ 154int tipc_shutdown(u32 ref);
155 155
156int tipc_isconnected(u32 portref, int *isconnected); 156int tipc_isconnected(u32 portref, int *isconnected);
157 157
@@ -176,7 +176,7 @@ int tipc_send_buf(u32 portref,
176 176
177int tipc_send2name(u32 portref, 177int tipc_send2name(u32 portref,
178 struct tipc_name const *name, 178 struct tipc_name const *name,
179 u32 domain, /* 0:own zone */ 179 u32 domain,
180 unsigned int num_sect, 180 unsigned int num_sect,
181 struct iovec const *msg_sect); 181 struct iovec const *msg_sect);
182 182
@@ -188,7 +188,7 @@ int tipc_send_buf2name(u32 portref,
188 188
189int tipc_forward2name(u32 portref, 189int tipc_forward2name(u32 portref,
190 struct tipc_name const *name, 190 struct tipc_name const *name,
191 u32 domain, /*0: own zone */ 191 u32 domain,
192 unsigned int section_count, 192 unsigned int section_count,
193 struct iovec const *msg_sect, 193 struct iovec const *msg_sect,
194 struct tipc_portid const *origin, 194 struct tipc_portid const *origin,
@@ -228,14 +228,14 @@ int tipc_forward_buf2port(u32 portref,
228 228
229int tipc_multicast(u32 portref, 229int tipc_multicast(u32 portref,
230 struct tipc_name_seq const *seq, 230 struct tipc_name_seq const *seq,
231 u32 domain, /* 0:own zone */ 231 u32 domain, /* currently unused */
232 unsigned int section_count, 232 unsigned int section_count,
233 struct iovec const *msg); 233 struct iovec const *msg);
234 234
235#if 0 235#if 0
236int tipc_multicast_buf(u32 portref, 236int tipc_multicast_buf(u32 portref,
237 struct tipc_name_seq const *seq, 237 struct tipc_name_seq const *seq,
238 u32 domain, /* 0:own zone */ 238 u32 domain,
239 void *buf, 239 void *buf,
240 unsigned int size); 240 unsigned int size);
241#endif 241#endif
diff --git a/include/net/x25.h b/include/net/x25.h
index 468551ea4f1d..1479cb4a41fc 100644
--- a/include/net/x25.h
+++ b/include/net/x25.h
@@ -80,8 +80,6 @@ enum {
80#define X25_DEFAULT_PACKET_SIZE X25_PS128 /* Default Packet Size */ 80#define X25_DEFAULT_PACKET_SIZE X25_PS128 /* Default Packet Size */
81#define X25_DEFAULT_THROUGHPUT 0x0A /* Deafult Throughput */ 81#define X25_DEFAULT_THROUGHPUT 0x0A /* Deafult Throughput */
82#define X25_DEFAULT_REVERSE 0x00 /* Default Reverse Charging */ 82#define X25_DEFAULT_REVERSE 0x00 /* Default Reverse Charging */
83#define X25_DENY_ACCPT_APPRV 0x01 /* Default value */
84#define X25_ALLOW_ACCPT_APPRV 0x00 /* Control enabled */
85 83
86#define X25_SMODULUS 8 84#define X25_SMODULUS 8
87#define X25_EMODULUS 128 85#define X25_EMODULUS 128
@@ -113,6 +111,11 @@ enum {
113#define X25_MAX_AE_LEN 40 /* Max num of semi-octets in AE - OSI Nw */ 111#define X25_MAX_AE_LEN 40 /* Max num of semi-octets in AE - OSI Nw */
114#define X25_MAX_DTE_FACIL_LEN 21 /* Max length of DTE facility params */ 112#define X25_MAX_DTE_FACIL_LEN 21 /* Max length of DTE facility params */
115 113
114/* Bitset in x25_sock->flags for misc flags */
115#define X25_Q_BIT_FLAG 0
116#define X25_INTERRUPT_FLAG 1
117#define X25_ACCPT_APPRV_FLAG 2
118
116/** 119/**
117 * struct x25_route - x25 routing entry 120 * struct x25_route - x25 routing entry
118 * @node - entry in x25_list_lock 121 * @node - entry in x25_list_lock
@@ -146,10 +149,11 @@ struct x25_sock {
146 struct x25_address source_addr, dest_addr; 149 struct x25_address source_addr, dest_addr;
147 struct x25_neigh *neighbour; 150 struct x25_neigh *neighbour;
148 unsigned int lci, cudmatchlength; 151 unsigned int lci, cudmatchlength;
149 unsigned char state, condition, qbitincl, intflag, accptapprv; 152 unsigned char state, condition;
150 unsigned short vs, vr, va, vl; 153 unsigned short vs, vr, va, vl;
151 unsigned long t2, t21, t22, t23; 154 unsigned long t2, t21, t22, t23;
152 unsigned short fraglen; 155 unsigned short fraglen;
156 unsigned long flags;
153 struct sk_buff_head ack_queue; 157 struct sk_buff_head ack_queue;
154 struct sk_buff_head fragment_queue; 158 struct sk_buff_head fragment_queue;
155 struct sk_buff_head interrupt_in_queue; 159 struct sk_buff_head interrupt_in_queue;