Page MenuHomeFreeBSD

Fix issue with RACK/BBR when VIMAGE is enabled
ClosedPublic

Authored by tuexen on Sun, Jul 18, 10:01 AM.

Details

Summary

CURVNET_RESTORE expands to multiple expressions. So enclose it in curly brackets when used in an if statement.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

why not fix curvnet macros?

In D31212#702735, @mjg wrote:

why not fix curvnet macros?

Are they broken? I guess you can change them for CURVNET_RESTORE, but not for CURVNET_SET. So I guess they are done this way for consistency... But I don't know for sure, since I did not invent them...

The man page explicitly state that

if (condition)
        CURVNET_SET(vnet);

will not work, but it does not say anything regarding CURVNET_RESTORE.

This revision is now accepted and ready to land.Mon, Jul 19, 6:26 PM

The need to guard their use with { } is most definitely a bug and will keep tripping people over.

Looking at the code I have to say I don't see a fix which does not induce churn. If the set/restore macros took an argument we would be set, but it's definitely not something I'm going to spend time on nor will demand someone else does.