Page MenuHomeFreeBSD

pfsync: Fix offset calculation
ClosedPublic

Authored by vegeta_tuxpowered.net on Feb 13 2024, 9:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 7, 1:49 AM
Unknown Object (File)
Tue, Oct 7, 12:23 AM
Unknown Object (File)
Tue, Sep 30, 2:39 PM
Unknown Object (File)
Wed, Sep 24, 11:17 AM
Unknown Object (File)
Mon, Sep 22, 10:50 PM
Unknown Object (File)
Thu, Sep 18, 7:18 PM
Unknown Object (File)
Tue, Sep 16, 12:41 AM
Unknown Object (File)
Fri, Sep 12, 9:42 AM

Details

Summary

Even though message version is automatically recognized and the top of
the struct is identical for different versions, when iterating over
multiple messages proper message length must be used. That's the length
of an union member for given version, not of the union itself.

Test Plan

Checked logs with pf debug set to loud on my own setup of
FreeBSD 13.2 and 14.0 routers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

pfsync: Fix offset calculation

Summary: Even though message version is automatically recognized and the top of
the struct is identical for different versions, when iterating over
multiple messages proper message length must be used. That's the length
of an union member for given version, not of the union itself.

Test Plan:
Checked logs with pf debug set to loud on my own setup of
FreeBSD 13.2 and 14.0 routers

Subscribers: imp, farrokhi, melifaro, glebius

Differential Revision: https://reviews.freebsd.org/D43862

This revision was not accepted when it landed; it landed in state Needs Review.Feb 15 2024, 12:55 PM
This revision was automatically updated to reflect the committed changes.