Skip to content

Commit 387edbe

Browse files
committed
[#3294] fix reservation-del psql query
- fixing a bug where when postgresql used as hosts reservations backend and when trying to delete only one reservation with host_cmds reservation-del by ipv6 and subnet-id, all host reservations in given subnet were deleted
1 parent f27254c commit 387edbe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/dhcpsrv/pgsql_host_data_source.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,8 @@ TaggedStatementArray tagged_statements = { {
21912191
{ OID_INT8, OID_VARCHAR },
21922192
"del_host_addr6",
21932193
"DELETE FROM hosts USING ipv6_reservations "
2194-
" WHERE dhcp6_subnet_id = $1 AND ipv6_reservations.address = cast($2 as inet)"
2194+
" WHERE hosts.host_id = ipv6_reservations.host_id"
2195+
" AND dhcp6_subnet_id = $1 AND ipv6_reservations.address = cast($2 as inet)"
21952196
},
21962197

21972198
// PgSqlHostDataSourceImpl::DEL_HOST_SUBID4_ID

0 commit comments

Comments
 (0)