aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/snat/out2in.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/snat/out2in.c')
-rw-r--r--src/plugins/snat/out2in.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/snat/out2in.c b/src/plugins/snat/out2in.c
index 9e5a8af8743..0c9c9cd12b6 100644
--- a/src/plugins/snat/out2in.c
+++ b/src/plugins/snat/out2in.c
@@ -255,7 +255,10 @@ static inline u32 icmp_out2in_slow_path (snat_main_t *sm,
ip4_interface_first_address (sm->ip4_main, sw_if_index0,
0 /* just want the address */);
rt->cached_sw_if_index = sw_if_index0;
- rt->cached_ip4_address = first_int_addr->as_u32;
+ if (first_int_addr)
+ rt->cached_ip4_address = first_int_addr->as_u32;
+ else
+ rt->cached_ip4_address = 0;
}
/* Don't NAT packet aimed at the intfc address */
@@ -1043,7 +1046,10 @@ static inline u32 icmp_out2in_fast (snat_main_t *sm,
ip4_interface_first_address (sm->ip4_main, sw_if_index0,
0 /* just want the address */);
rt->cached_sw_if_index = sw_if_index0;
- rt->cached_ip4_address = first_int_addr->as_u32;
+ if (first_int_addr)
+ rt->cached_ip4_address = first_int_addr->as_u32;
+ else
+ rt->cached_ip4_address = 0;
}
/* Don't NAT packet aimed at the intfc address */