kernel-interface: Optionally pass security label with an acquire

This commit is contained in:
Tobias Brunner
2022-04-14 18:42:01 +02:00
parent 3f3838d1f9
commit 52a05d7f6c
2 changed files with 7 additions and 1 deletions
+2
View File
@@ -37,6 +37,8 @@ struct kernel_acquire_data_t {
traffic_selector_t *src; traffic_selector_t *src;
/** Optional destination of the triggering packet */ /** Optional destination of the triggering packet */
traffic_selector_t *dst; traffic_selector_t *dst;
/** Optional security label of the triggering packet */
sec_label_t *label;
}; };
/** /**
+5 -1
View File
@@ -45,6 +45,7 @@ METHOD(job_t, destroy, void,
{ {
DESTROY_IF(this->data.src); DESTROY_IF(this->data.src);
DESTROY_IF(this->data.dst); DESTROY_IF(this->data.dst);
DESTROY_IF(this->data.label);
free(this); free(this);
} }
@@ -88,7 +89,10 @@ acquire_job_t *acquire_job_create(uint32_t reqid, kernel_acquire_data_t *data)
{ {
this->data.dst = this->data.dst->clone(this->data.dst); this->data.dst = this->data.dst->clone(this->data.dst);
} }
if (this->data.label)
{
this->data.label = this->data.label->clone(this->data.label);
}
return &this->public; return &this->public;
} }