diff options
author | Matthew Smith <mgsmith@netgate.com> | 2018-04-30 16:39:13 -0500 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-05-03 19:07:53 +0000 |
commit | 42ae29a2fe9b12bbbc0c6495b2077252545c9cb9 (patch) | |
tree | ccc68b57c02b12e4bcde7332e15f479fce327b19 /src/vlibsocket/sockclnt_vlib.c | |
parent | 6f1c48db24b5731176d57121c47040339e6d7f6c (diff) |
NAT44 segv on unknown proto on inside interface
When a packet with an unknown proto arrives
on an inside interface and there are no existing sessions
for the source address, a segv occurs.
snat_in2out_unknown_proto() finds the head of the sessions
dlist, fetches the address of the next element using
head->next, and then dereferences the next element. On the
first packet received from a source address, head->next is
~0, so this results in a segv.
Check that the session list is not empty before trying to
traverse it.
Also removed unnecessary lookup against tsm->user_hash.
Prior call to nat_user_get_or_create() already performed
that lookup and added a user if one didn't exist.
Change-Id: If73e79aa2f8e3962ab7b876ecf55aea40d7a5472
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Diffstat (limited to 'src/vlibsocket/sockclnt_vlib.c')
0 files changed, 0 insertions, 0 deletions