Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vcl: cleanup and fixes for vcl test code
[vpp.git]
/
src
/
vnet
/
ipsec
/
esp_decrypt.c
diff --git
a/src/vnet/ipsec/esp_decrypt.c
b/src/vnet/ipsec/esp_decrypt.c
index
a769e6b
..
a0eeed4
100644
(file)
--- a/
src/vnet/ipsec/esp_decrypt.c
+++ b/
src/vnet/ipsec/esp_decrypt.c
@@
-268,9
+268,14
@@
esp_decrypt_node_fn (vlib_main_t * vm,
if (PREDICT_FALSE (!sa0->is_tunnel && !sa0->is_tunnel_ip6))
{
tunnel_mode = 0;
if (PREDICT_FALSE (!sa0->is_tunnel && !sa0->is_tunnel_ip6))
{
tunnel_mode = 0;
- ih4 =
- (ip4_header_t *) (i_b0->data +
- sizeof (ethernet_header_t));
+
+ if (i_b0->flags & VNET_BUFFER_F_IS_IP4)
+ ih4 =
+ (ip4_header_t *) ((u8 *) esp0 - sizeof (ip4_header_t));
+ else
+ ih4 =
+ (ip4_header_t *) ((u8 *) esp0 - sizeof (ip6_header_t));
+
if (PREDICT_TRUE
((ih4->ip_version_and_header_length & 0xF0) != 0x40))
{
if (PREDICT_TRUE
((ih4->ip_version_and_header_length & 0xF0) != 0x40))
{
@@
-280,9
+285,7
@@
esp_decrypt_node_fn (vlib_main_t * vm,
{
transport_ip6 = 1;
ip_hdr_size = sizeof (ip6_header_t);
{
transport_ip6 = 1;
ip_hdr_size = sizeof (ip6_header_t);
- ih6 =
- (ip6_header_t *) (i_b0->data +
- sizeof (ethernet_header_t));
+ ih6 = (ip6_header_t *) ih4;
oh6 = vlib_buffer_get_current (o_b0);
}
else
oh6 = vlib_buffer_get_current (o_b0);
}
else