mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 16:41:58 +00:00
Merge branch 'sctp_csum'
Vlad Yasevich says: ==================== sctp: Use software checksum under certain circumstances. There are some cards that support SCTP checksum offloading. When using these cards with IPSec or forcing IP fragmentation of SCTP traffic, the checksum is computed incorrectly due to the fact that xfrm and IP/IPv6 fragmentation code do not know that this is SCTP traffic and do not know that checksum has to be computed differently. To fix this, we let SCTP detect these conditions and perform software checksum calculation. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
725907827a
@ -479,10 +479,22 @@ static inline struct dst_entry *xfrm_lookup(struct net *net,
|
||||
{
|
||||
return dst_orig;
|
||||
}
|
||||
|
||||
static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#else
|
||||
extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
|
||||
const struct flowi *fl, struct sock *sk,
|
||||
int flags);
|
||||
|
||||
/* skb attached with this dst needs transformation if dst->xfrm is valid */
|
||||
static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
|
||||
{
|
||||
return dst->xfrm;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _NET_DST_H */
|
||||
|
@ -536,7 +536,8 @@ int sctp_packet_transmit(struct sctp_packet *packet)
|
||||
* by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
|
||||
*/
|
||||
if (!sctp_checksum_disable) {
|
||||
if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
|
||||
if (!(dst->dev->features & NETIF_F_SCTP_CSUM) ||
|
||||
(dst_xfrm(dst) != NULL) || packet->ipfragok) {
|
||||
__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
|
||||
|
||||
/* 3) Put the resultant value into the checksum field in the
|
||||
|
Loading…
Reference in New Issue
Block a user