]> git.baikalelectronics.ru Git - kernel.git/commit
ipsec: allow to align IPv4 AH on 32 bits
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Wed, 2 Feb 2011 06:29:02 +0000 (06:29 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Feb 2011 22:00:40 +0000 (14:00 -0800)
commit806ad9fca4c350a95b11d1acfa918b147dd7bab1
tree8684af3cd03cf8fed1e6be9f722c181278944f7b
parent80676763c1f0ebf52438ed9954dae275f45631ea
ipsec: allow to align IPv4 AH on 32 bits

The Linux IPv4 AH stack aligns the AH header on a 64 bit boundary
(like in IPv6). This is not RFC compliant (see RFC4302, Section
3.3.3.2.1), it should be aligned on 32 bits.

For most of the authentication algorithms, the ICV size is 96 bits.
The AH header alignment on 32 or 64 bits gives the same results.

However for SHA-256-128 for instance, the wrong 64 bit alignment results
in adding useless padding in IPv4 AH, which is forbidden by the RFC.

To avoid breaking backward compatibility, we use a new flag
(XFRM_STATE_ALIGN4) do change original behavior.

Initial patch from Dang Hongwu <hongwu.dang@6wind.com> and
Christophe Gouault <christophe.gouault@6wind.com>.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/xfrm.h
include/net/xfrm.h
net/ipv4/ah4.c