]> git.baikalelectronics.ru Git - kernel.git/commit
{pktgen, xfrm} Update IPv4 header total len and checksum after tranformation
authorfan.du <fan.du@windriver.com>
Sun, 1 Dec 2013 08:28:48 +0000 (16:28 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Dec 2013 01:33:52 +0000 (20:33 -0500)
commitdf7ffa540355d60d5d72a753c34d3014504ce79b
tree2b4b120d83ea831f0b3bf3b0746311b25fdd3fbd
parentb0428a0b05d2484efe8dc790536d8da89315f2e7
{pktgen, xfrm} Update IPv4 header total len and checksum after tranformation

commit fd733ebbb109338420f5a9325c3772fd9f2643a4 ("[PKTGEN]: IPSEC support")
tried to support IPsec ESP transport transformation for pktgen, but acctually
this doesn't work at all for two reasons(The orignal transformed packet has
bad IPv4 checksum value, as well as wrong auth value, reported by wireshark)

- After transpormation, IPv4 header total length needs update,
  because encrypted payload's length is NOT same as that of plain text.

- After transformation, IPv4 checksum needs re-caculate because of payload
  has been changed.

With this patch, armmed pktgen with below cofiguration, Wireshark is able to
decrypted ESP packet generated by pktgen without any IPv4 checksum error or
auth value error.

pgset "flag IPSEC"
pgset "flows 1"

Signed-off-by: Fan Du <fan.du@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/pktgen.c