diff options
| author | Kristof Provost <kp@FreeBSD.org> | 2026-04-16 13:51:54 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2026-04-17 11:55:06 +0000 |
| commit | 5b7192230a15bbf2378b8f74278d21d4766c5110 (patch) | |
| tree | 821dbf4ec96cff6ee5393ec8ed729e3aea3dbba3 | |
| parent | 05ac1013984ced5b8b57430fe92a7074e34054ce (diff) | |
pf: pf_frag_compare() should not be using subtraction to compare fragment IDs
Issues reported and patch submitted by:
Renaud Allard <renaud () allard ! it>
OK sashan@
Obtained from: OpenBSD, sashan <sashan@openbsd.org>, 747740863c
Sponsored by: Rubicon Communications, LLC ("Netgate")
| -rw-r--r-- | sys/netpfil/pf/pf_norm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 1362ce5387bb..348c1cafbd49 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -236,10 +236,10 @@ pf_frnode_compare(struct pf_frnode *a, struct pf_frnode *b) static __inline int pf_frag_compare(struct pf_fragment *a, struct pf_fragment *b) { - int diff; - - if ((diff = a->fr_id - b->fr_id) != 0) - return (diff); + if (a->fr_id > b->fr_id) + return (1); + if (a->fr_id < b->fr_id) + return (-1); return (0); } |
