summaryrefslogtreecommitdiffstats
path: root/src/hooks/dhcp/user_chk/pkt_send_co.cc
diff options
context:
space:
mode:
authorRazvan Becheriu <razvan@isc.org>2020-02-24 17:38:59 +0100
committerRazvan Becheriu <razvan@isc.org>2020-02-27 08:03:27 +0100
commitbe1241b0563fc559e3ec01942a417933020dcf18 (patch)
tree9d0444dfe6e9f995993253035bfb1d4129ed2a47 /src/hooks/dhcp/user_chk/pkt_send_co.cc
parent[#1088] fixed compilation (diff)
downloadkea-be1241b0563fc559e3ec01942a417933020dcf18.tar.xz
kea-be1241b0563fc559e3ec01942a417933020dcf18.zip
[#1088] addressed review
Diffstat (limited to 'src/hooks/dhcp/user_chk/pkt_send_co.cc')
-rw-r--r--src/hooks/dhcp/user_chk/pkt_send_co.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/hooks/dhcp/user_chk/pkt_send_co.cc b/src/hooks/dhcp/user_chk/pkt_send_co.cc
index 65b57b5e43..e03bc9b479 100644
--- a/src/hooks/dhcp/user_chk/pkt_send_co.cc
+++ b/src/hooks/dhcp/user_chk/pkt_send_co.cc
@@ -68,11 +68,14 @@ extern "C" {
/// @return 0 upon success, non-zero otherwise.
int pkt4_send(CalloutHandle& handle) {
CalloutHandle::CalloutNextStep status = handle.getStatus();
- if (status == CalloutHandle::NEXT_STEP_DROP ||
- status == CalloutHandle::NEXT_STEP_SKIP) {
+ if (status == CalloutHandle::NEXT_STEP_DROP) {
return (0);
}
+ if (status == CalloutHandle::NEXT_STEP_SKIP) {
+ isc_throw(InvalidOperation, "packet pack already handled");
+ }
+
try {
Pkt4Ptr response;
handle.getArgument("response4", response);
@@ -145,11 +148,14 @@ int pkt4_send(CalloutHandle& handle) {
/// @return 0 upon success, non-zero otherwise.
int pkt6_send(CalloutHandle& handle) {
CalloutHandle::CalloutNextStep status = handle.getStatus();
- if (status == CalloutHandle::NEXT_STEP_DROP ||
- status == CalloutHandle::NEXT_STEP_SKIP) {
+ if (status == CalloutHandle::NEXT_STEP_DROP) {
return (0);
}
+ if (status == CalloutHandle::NEXT_STEP_SKIP) {
+ isc_throw(InvalidOperation, "packet pack already handled");
+ }
+
try {
Pkt6Ptr response;
handle.getArgument("response6", response);