Page MenuHomeFreeBSD

Use ratecheck(9) in in_pcbinslbgrouphash().
ClosedPublic

Authored by markj on Sep 6 2018, 5:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 28, 10:20 AM
Unknown Object (File)
Tue, Nov 25, 7:08 PM
Unknown Object (File)
Sat, Nov 22, 3:20 AM
Unknown Object (File)
Nov 18 2025, 1:18 AM
Unknown Object (File)
Nov 15 2025, 8:18 PM
Unknown Object (File)
Nov 9 2025, 12:05 AM
Unknown Object (File)
Nov 4 2025, 9:47 AM
Unknown Object (File)
Oct 26 2025, 4:45 AM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz added a subscriber: bz.

LGTM

This revision is now accepted and ready to land.Sep 6 2018, 6:29 PM
This revision was automatically updated to reflect the committed changes.

Hi. I know I'm late to the party, but I have three comments:
a) I could be wrong, but I don't think there is any guarantee this won't be called simultaneously for two different groups at the same time. (The groups could be in different VNETs, for example.) In that case, two different invocations could be working on the function's static variables at the same time. That may produce unexpected results. (Granted, it would take an unusual series of events. But, I think we've all seen highly unusual events occur.)
b) I don't think the const variable also needs to be static.
c) It seems like the rate limiter should really be per-group, so I would suggest adding the lastprint variable to the inpcblbgroup struct.

In D17065#364086, @jtl wrote:

Hi. I know I'm late to the party, but I have three comments:
a) I could be wrong, but I don't think there is any guarantee this won't be called simultaneously for two different groups at the same time. (The groups could be in different VNETs, for example.) In that case, two different invocations could be working on the function's static variables at the same time. That may produce unexpected results. (Granted, it would take an unusual series of events. But, I think we've all seen highly unusual events occur.)
b) I don't think the const variable also needs to be static.
c) It seems like the rate limiter should really be per-group, so I would suggest adding the lastprint variable to the inpcblbgroup struct.

Hmm, right, thanks. I'll fix this up and post a separate review.