From 0382b9c35469be273ed10fa374496a924055a3c8 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 17 Mar 2008 22:46:46 -0700 Subject: [PKT_SCHED]: annotate cls_u32 Signed-off-by: Al Viro Signed-off-by: David S. Miller --- include/linux/pkt_cls.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 28dfc61cf79..99efbed81fa 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h @@ -201,8 +201,8 @@ enum struct tc_u32_key { - __u32 mask; - __u32 val; + __be32 mask; + __be32 val; int off; int offmask; }; @@ -213,12 +213,12 @@ struct tc_u32_sel unsigned char offshift; unsigned char nkeys; - __u16 offmask; + __be16 offmask; __u16 off; short offoff; short hoff; - __u32 hmask; + __be32 hmask; struct tc_u32_key keys[0]; }; -- cgit v1.2.3 From 0ff9663c88ac5efdb5c8ac21c0bd7f993a4e3849 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 17 Mar 2008 22:48:46 -0700 Subject: [IPV4]: ipv4_is_lbcast() misannotations Signed-off-by: Al Viro Signed-off-by: David S. Miller --- include/linux/in.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/in.h b/include/linux/in.h index 70c6df88269..4065313cd7e 100644 --- a/include/linux/in.h +++ b/include/linux/in.h @@ -265,7 +265,7 @@ static inline bool ipv4_is_local_multicast(__be32 addr) static inline bool ipv4_is_lbcast(__be32 addr) { /* limited broadcast */ - return addr == INADDR_BROADCAST; + return addr == htonl(INADDR_BROADCAST); } static inline bool ipv4_is_zeronet(__be32 addr) -- cgit v1.2.3 From 8e3d716cce0c186ae9c88b91cc5686b78e0fd2d4 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 17 Mar 2008 22:49:16 -0700 Subject: xfrm: ->eth_proto is __be16 Signed-off-by: Al Viro Signed-off-by: David S. Miller --- include/net/xfrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/xfrm.h b/include/net/xfrm.h index eea7785cc75..619c53bc3cd 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -277,7 +277,7 @@ extern int __xfrm_state_delete(struct xfrm_state *x); struct xfrm_state_afinfo { unsigned int family; unsigned int proto; - unsigned int eth_proto; + __be16 eth_proto; struct module *owner; const struct xfrm_type *type_map[IPPROTO_MAX]; struct xfrm_mode *mode_map[XFRM_MODE_MAX]; -- cgit v1.2.3 From 270637abff0cdf848b910b9f96ad342e1da61c66 Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Thu, 20 Mar 2008 15:17:14 -0700 Subject: [SCTP]: Fix a race between module load and protosw access There is a race is SCTP between the loading of the module and the access by the socket layer to the protocol functions. In particular, a list of addresss that SCTP maintains is not initialized prior to the registration with the protosw. Thus it is possible for a user application to gain access to SCTP functions before everything has been initialized. The problem shows up as odd crashes during connection initializtion when we try to access the SCTP address list. The solution is to refactor how we do registration and initialize the lists prior to registering with the protosw. Care must be taken since the address list initialization depends on some other pieces of SCTP initialization. Also the clean-up in case of failure now also needs to be refactored. Signed-off-by: Vlad Yasevich Acked-by: Sridhar Samudrala Signed-off-by: David S. Miller --- include/net/sctp/sctp.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 57df27f1958..57ed3e323d9 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -380,15 +380,19 @@ static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -int sctp_v6_init(void); -void sctp_v6_exit(void); +void sctp_v6_pf_init(void); +void sctp_v6_pf_exit(void); +int sctp_v6_protosw_init(void); +void sctp_v6_protosw_exit(void); int sctp_v6_add_protocol(void); void sctp_v6_del_protocol(void); #else /* #ifdef defined(CONFIG_IPV6) */ -static inline int sctp_v6_init(void) { return 0; } -static inline void sctp_v6_exit(void) { return; } +static inline void sctp_v6_pf_init(void) { return 0; } +static inline void sctp_v6_pf_exit(void) { return; } +static inline int sctp_v6_protosw_init(void) { return 0; } +static inline void sctp_v6_protosw_exit(void) { return; } static inline int sctp_v6_add_protocol(void) { return 0; } static inline void sctp_v6_del_protocol(void) { return; } -- cgit v1.2.3