summaryrefslogtreecommitdiffstats
path: root/sys/netpfil/ipfw/ip_fw_eaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netpfil/ipfw/ip_fw_eaction.c')
-rw-r--r--sys/netpfil/ipfw/ip_fw_eaction.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/sys/netpfil/ipfw/ip_fw_eaction.c b/sys/netpfil/ipfw/ip_fw_eaction.c
index 09e0310..a9de696 100644
--- a/sys/netpfil/ipfw/ip_fw_eaction.c
+++ b/sys/netpfil/ipfw/ip_fw_eaction.c
@@ -137,10 +137,28 @@ static int
eaction_findbyname(struct ip_fw_chain *ch, struct tid_info *ti,
struct named_object **pno)
{
+ ipfw_obj_ntlv *ntlv;
- EACTION_DEBUG("uidx %u, type %u", ti->uidx, ti->type);
- return (ipfw_objhash_find_type(CHAIN_TO_SRV(ch), ti,
- IPFW_TLV_EACTION, pno));
+ if (ti->tlvs == NULL)
+ return (EINVAL);
+
+ /* Search ntlv in the buffer provided by user */
+ ntlv = ipfw_find_name_tlv_type(ti->tlvs, ti->tlen, ti->uidx,
+ IPFW_TLV_EACTION);
+ if (ntlv == NULL)
+ return (EINVAL);
+ EACTION_DEBUG("name %s, uidx %u, type %u", ntlv->name,
+ ti->uidx, ti->type);
+ /*
+ * Search named object with corresponding name.
+ * Since eaction objects are global - ignore the set value
+ * and use zero instead.
+ */
+ *pno = ipfw_objhash_lookup_name_type(CHAIN_TO_SRV(ch),
+ 0, IPFW_TLV_EACTION, ntlv->name);
+ if (*pno == NULL)
+ return (ESRCH);
+ return (0);
}
static struct named_object *
OpenPOWER on IntegriCloud