mirror of
https://github.com/lgcosta/pf-linux-port.git
synced 2026-11-15 12:54:44 -03:00
hfsc: fix class-handle collision (root class used bit 0x1, colliding with odd pf qids -> pfq_addqueue EBUSY); guard against NULL discipline; drop debug prints
This commit is contained in:
1 parent
14ff7d1c39
commit
ccad35b247
2 files changed
+14
-2
No files matched your search
@@ -1277,8 +1277,15 @@ struct hfsc_class_stats {
|
|||||||
#define tick_nsec (1000000000LL / HZ)
|
#define tick_nsec (1000000000LL / HZ)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HFSC_ROOT_CLASS 0x1 /* root class of the tree */
|
/*
|
||||||
#define HFSC_DEFAULTCLASS 0x8 /* auto-created default class */
|
* Class-handle namespace. pf queue ids are u_int16_t, so the root class gets
|
||||||
|
* a high bit that can never collide with a queue handle (a collision made
|
||||||
|
* hfsc_pf_addqueue() see the root class as a duplicate and refuse the queue
|
||||||
|
* with EBUSY). HFSC_DEFAULTCLASS must equal PFQS_DEFAULT because hfsc.c
|
||||||
|
* receives the pf queue flags verbatim.
|
||||||
|
*/
|
||||||
|
#define HFSC_ROOT_CLASS 0x80000000u
|
||||||
|
#define HFSC_DEFAULTCLASS 0x1000
|
||||||
#define HFSC_MAX_CLASSES 64
|
#define HFSC_MAX_CLASSES 64
|
||||||
#define HFSC_DEFAULT_CLASSES 8
|
#define HFSC_DEFAULT_CLASSES 8
|
||||||
#define HFSC_DEFAULT_QLIMIT 1000
|
#define HFSC_DEFAULT_QLIMIT 1000
|
||||||
|
|||||||
@@ -662,6 +662,11 @@ pf_create_queues(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
qif->disc = qif->pfqops->pfq_alloc(ifp);
|
qif->disc = qif->pfqops->pfq_alloc(ifp);
|
||||||
|
if (qif->disc == NULL) {
|
||||||
|
error = ENOBUFS;
|
||||||
|
free(qif, M_PF, sizeof(*qif));
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
qif->next = list;
|
qif->next = list;
|
||||||
list = qif;
|
list = qif;
|
||||||
|
|||||||
Reference in new issue
Block a user