diff options
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/9p/9p.h | 29 | ||||
| -rw-r--r-- | include/net/cfg80211.h | 5 | ||||
| -rw-r--r-- | include/net/flow.h | 25 | ||||
| -rw-r--r-- | include/net/ip_vs.h | 1 | ||||
| -rw-r--r-- | include/net/request_sock.h | 3 | ||||
| -rw-r--r-- | include/net/sctp/command.h | 1 | ||||
| -rw-r--r-- | include/net/tcp.h | 22 | ||||
| -rw-r--r-- | include/net/transp_v6.h | 1 | ||||
| -rw-r--r-- | include/net/udplite.h | 63 | 
9 files changed, 113 insertions, 37 deletions
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index 342dcf13d03..a6326ef8ade 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h @@ -288,6 +288,35 @@ enum p9_perm_t {  	P9_DMSETVTX = 0x00010000,  }; +/* 9p2000.L open flags */ +#define P9_DOTL_RDONLY        00000000 +#define P9_DOTL_WRONLY        00000001 +#define P9_DOTL_RDWR          00000002 +#define P9_DOTL_NOACCESS      00000003 +#define P9_DOTL_CREATE        00000100 +#define P9_DOTL_EXCL          00000200 +#define P9_DOTL_NOCTTY        00000400 +#define P9_DOTL_TRUNC         00001000 +#define P9_DOTL_APPEND        00002000 +#define P9_DOTL_NONBLOCK      00004000 +#define P9_DOTL_DSYNC         00010000 +#define P9_DOTL_FASYNC        00020000 +#define P9_DOTL_DIRECT        00040000 +#define P9_DOTL_LARGEFILE     00100000 +#define P9_DOTL_DIRECTORY     00200000 +#define P9_DOTL_NOFOLLOW      00400000 +#define P9_DOTL_NOATIME       01000000 +#define P9_DOTL_CLOEXEC       02000000 +#define P9_DOTL_SYNC          04000000 + +/* 9p2000.L at flags */ +#define P9_DOTL_AT_REMOVEDIR		0x200 + +/* 9p2000.L lock type */ +#define P9_LOCK_TYPE_RDLCK 0 +#define P9_LOCK_TYPE_WRLCK 1 +#define P9_LOCK_TYPE_UNLCK 2 +  /**   * enum p9_qid_t - QID types   * @P9_QTDIR: directory diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index d17f47fc9e3..401d73bd151 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1744,6 +1744,8 @@ struct wiphy_wowlan_support {   *	by default for perm_addr. In this case, the mask should be set to   *	all-zeroes. In this case it is assumed that the device can handle   *	the same number of arbitrary MAC addresses. + * @registered: protects ->resume and ->suspend sysfs callbacks against + *	unregister hardware   * @debugfsdir: debugfs directory used for this wiphy, will be renamed   *	automatically on wiphy renames   * @dev: (virtual) struct device for this wiphy @@ -1865,6 +1867,9 @@ struct wiphy {  	 * you need use set_wiphy_dev() (see below) */  	struct device dev; +	/* protects ->resume, ->suspend sysfs callbacks against unregister hw */ +	bool registered; +  	/* dir in debugfs: ieee80211/<wiphyname> */  	struct dentry *debugfsdir; diff --git a/include/net/flow.h b/include/net/flow.h index 78113daadd6..a09447749e2 100644 --- a/include/net/flow.h +++ b/include/net/flow.h @@ -7,6 +7,7 @@  #ifndef _NET_FLOW_H  #define _NET_FLOW_H +#include <linux/socket.h>  #include <linux/in6.h>  #include <linux/atomic.h> @@ -68,7 +69,7 @@ struct flowi4 {  #define fl4_ipsec_spi		uli.spi  #define fl4_mh_type		uli.mht.type  #define fl4_gre_key		uli.gre_key -}; +} __attribute__((__aligned__(BITS_PER_LONG/8)));  static inline void flowi4_init_output(struct flowi4 *fl4, int oif,  				      __u32 mark, __u8 tos, __u8 scope, @@ -112,7 +113,7 @@ struct flowi6 {  #define fl6_ipsec_spi		uli.spi  #define fl6_mh_type		uli.mht.type  #define fl6_gre_key		uli.gre_key -}; +} __attribute__((__aligned__(BITS_PER_LONG/8)));  struct flowidn {  	struct flowi_common	__fl_common; @@ -127,7 +128,7 @@ struct flowidn {  	union flowi_uli		uli;  #define fld_sport		uli.ports.sport  #define fld_dport		uli.ports.dport -}; +} __attribute__((__aligned__(BITS_PER_LONG/8)));  struct flowi {  	union { @@ -161,6 +162,24 @@ static inline struct flowi *flowidn_to_flowi(struct flowidn *fldn)  	return container_of(fldn, struct flowi, u.dn);  } +typedef unsigned long flow_compare_t; + +static inline size_t flow_key_size(u16 family) +{ +	switch (family) { +	case AF_INET: +		BUILD_BUG_ON(sizeof(struct flowi4) % sizeof(flow_compare_t)); +		return sizeof(struct flowi4) / sizeof(flow_compare_t); +	case AF_INET6: +		BUILD_BUG_ON(sizeof(struct flowi6) % sizeof(flow_compare_t)); +		return sizeof(struct flowi6) / sizeof(flow_compare_t); +	case AF_DECnet: +		BUILD_BUG_ON(sizeof(struct flowidn) % sizeof(flow_compare_t)); +		return sizeof(struct flowidn) / sizeof(flow_compare_t); +	} +	return 0; +} +  #define FLOW_DIR_IN	0  #define FLOW_DIR_OUT	1  #define FLOW_DIR_FWD	2 diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 1aaf915656f..8fa4430f99c 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h @@ -900,6 +900,7 @@ struct netns_ipvs {  	volatile int		sync_state;  	volatile int		master_syncid;  	volatile int		backup_syncid; +	struct mutex		sync_mutex;  	/* multicast interface name */  	char			master_mcast_ifn[IP_VS_IFNAME_MAXLEN];  	char			backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; diff --git a/include/net/request_sock.h b/include/net/request_sock.h index 99e6e19b57c..4c0766e201e 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h @@ -96,7 +96,8 @@ extern int sysctl_max_syn_backlog;   */  struct listen_sock {  	u8			max_qlen_log; -	/* 3 bytes hole, try to use */ +	u8			synflood_warned; +	/* 2 bytes hole, try to use */  	int			qlen;  	int			qlen_young;  	int			clock_hand; diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 6506458ccd3..712b3bebeda 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h @@ -109,6 +109,7 @@ typedef enum {  	SCTP_CMD_SEND_MSG,	 /* Send the whole use message */  	SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */  	SCTP_CMD_PURGE_ASCONF_QUEUE, /* Purge all asconf queues.*/ +	SCTP_CMD_SET_ASOC,	 /* Restore association context */  	SCTP_CMD_LAST  } sctp_verb_t; diff --git a/include/net/tcp.h b/include/net/tcp.h index 149a415d1e0..acc620a4a45 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -431,17 +431,34 @@ extern int tcp_disconnect(struct sock *sk, int flags);  extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];  extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,   				    struct ip_options *opt); +#ifdef CONFIG_SYN_COOKIES  extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,   				     __u16 *mss); +#else +static inline __u32 cookie_v4_init_sequence(struct sock *sk, +					    struct sk_buff *skb, +					    __u16 *mss) +{ +	return 0; +} +#endif  extern __u32 cookie_init_timestamp(struct request_sock *req);  extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *);  /* From net/ipv6/syncookies.c */  extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); +#ifdef CONFIG_SYN_COOKIES  extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb,  				     __u16 *mss); - +#else +static inline __u32 cookie_v6_init_sequence(struct sock *sk, +					    struct sk_buff *skb, +					    __u16 *mss) +{ +	return 0; +} +#endif  /* tcp_output.c */  extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, @@ -460,6 +477,9 @@ extern int tcp_write_wakeup(struct sock *);  extern void tcp_send_fin(struct sock *sk);  extern void tcp_send_active_reset(struct sock *sk, gfp_t priority);  extern int tcp_send_synack(struct sock *); +extern int tcp_syn_flood_action(struct sock *sk, +				const struct sk_buff *skb, +				const char *proto);  extern void tcp_push_one(struct sock *, unsigned int mss_now);  extern void tcp_send_ack(struct sock *sk);  extern void tcp_send_delayed_ack(struct sock *sk); diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index 5271a741c3a..498433dd067 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h @@ -39,6 +39,7 @@ extern int			datagram_recv_ctl(struct sock *sk,  						  struct sk_buff *skb);  extern int			datagram_send_ctl(struct net *net, +						  struct sock *sk,  						  struct msghdr *msg,  						  struct flowi6 *fl6,  						  struct ipv6_txoptions *opt, diff --git a/include/net/udplite.h b/include/net/udplite.h index 673a024c6b2..5f097ca7d5c 100644 --- a/include/net/udplite.h +++ b/include/net/udplite.h @@ -66,40 +66,34 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)  	return 0;  } -static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh) +/* Slow-path computation of checksum. Socket is locked. */ +static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)  { +	const struct udp_sock *up = udp_sk(skb->sk);  	int cscov = up->len; +	__wsum csum = 0; -	/* -	 * Sender has set `partial coverage' option on UDP-Lite socket -	 */ -	if (up->pcflag & UDPLITE_SEND_CC)    { +	if (up->pcflag & UDPLITE_SEND_CC) { +		/* +		 * Sender has set `partial coverage' option on UDP-Lite socket. +		 * The special case "up->pcslen == 0" signifies full coverage. +		 */  		if (up->pcslen < up->len) { -		/* up->pcslen == 0 means that full coverage is required, -		 * partial coverage only if  0 < up->pcslen < up->len */ -			if (0 < up->pcslen) { -			       cscov = up->pcslen; -			} -			uh->len = htons(up->pcslen); +			if (0 < up->pcslen) +				cscov = up->pcslen; +			udp_hdr(skb)->len = htons(up->pcslen);  		} -	/* -	 * NOTE: Causes for the error case  `up->pcslen > up->len': -	 *        (i)  Application error (will not be penalized). -	 *       (ii)  Payload too big for send buffer: data is split -	 *             into several packets, each with its own header. -	 *             In this case (e.g. last segment), coverage may -	 *             exceed packet length. -	 *       Since packets with coverage length > packet length are -	 *       illegal, we fall back to the defaults here. -	 */ +		/* +		 * NOTE: Causes for the error case  `up->pcslen > up->len': +		 *        (i)  Application error (will not be penalized). +		 *       (ii)  Payload too big for send buffer: data is split +		 *             into several packets, each with its own header. +		 *             In this case (e.g. last segment), coverage may +		 *             exceed packet length. +		 *       Since packets with coverage length > packet length are +		 *       illegal, we fall back to the defaults here. +		 */  	} -	return cscov; -} - -static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb) -{ -	int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb)); -	__wsum csum = 0;  	skb->ip_summed = CHECKSUM_NONE;     /* no HW support for checksumming */ @@ -115,16 +109,21 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)  	return csum;  } +/* Fast-path computation of checksum. Socket may not be locked. */  static inline __wsum udplite_csum(struct sk_buff *skb)  { -	struct sock *sk = skb->sk; -	int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb)); +	const struct udp_sock *up = udp_sk(skb->sk);  	const int off = skb_transport_offset(skb); -	const int len = skb->len - off; +	int len = skb->len - off; +	if ((up->pcflag & UDPLITE_SEND_CC) && up->pcslen < len) { +		if (0 < up->pcslen) +			len = up->pcslen; +		udp_hdr(skb)->len = htons(up->pcslen); +	}  	skb->ip_summed = CHECKSUM_NONE;     /* no HW support for checksumming */ -	return skb_checksum(skb, off, min(cscov, len), 0); +	return skb_checksum(skb, off, len, 0);  }  extern void	udplite4_register(void);  |