Page MenuHomeFreeBSD

net: use pfil_mbuf_{in,out} where we always have an mbuf
ClosedPublic

Authored by glebius on Jan 7 2023, 9:02 PM.
Tags
None
Referenced Files
F82797601: D37976.id.diff
Thu, May 2, 4:51 PM
Unknown Object (File)
Thu, May 2, 2:55 AM
Unknown Object (File)
Fri, Apr 26, 8:45 AM
Unknown Object (File)
Fri, Apr 26, 8:45 AM
Unknown Object (File)
Fri, Apr 26, 8:45 AM
Unknown Object (File)
Fri, Apr 26, 8:45 AM
Unknown Object (File)
Fri, Apr 26, 1:37 AM
Unknown Object (File)
Apr 1 2024, 12:06 AM
Subscribers

Details

Summary

This finalizes what has been started in 0b70e3e78b0.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 48986
Build 45875: arc lint + arc unit

Event Timeline

sys/net/if_enc.c
309

what's up with yoda comparison?

sys/net/if_enc.c
309

It could probably stand to be split out of the if() at least.

Maybe

ret = (pdir == PFIL_IN) ? pfil_mbuf_in(ph, ctx->mp, ifp, ctx->inp) :
	    pfil_mbuf_out(ph, ctx->mp, ifp, ctx->inp);
if (ret != PFIL_PASS)
...

Or even

if (pdir == PFIL_IN)
  ret = pfil_mbuf_in(ph, ctx->mp, ifp, ctx->inp) ;
else
  ret = pfil_mbuf_out(ph, ctx->mp, ifp, ctx->inp));
if (ret ![ PFIL_PASS) {
...
sys/net/if_enc.c
309

What I've written seems more readable to me. I'm open to using any other version. Kristof, Mateusz, just tell me a version you both agree with and I will use it :)

sys/net/if_enc.c
309

second variant looks good to me

sys/net/if_enc.c
309

Works for me too.

Restyle if_enc as suggested

This revision is now accepted and ready to land.Jan 10 2023, 5:32 AM