sleinen / samplicator

Send copies of (UDP) datagrams to multiple receivers, with optional sampling and spoofing
GNU General Public License v2.0
389 stars 132 forks source link

Fixes #45: use network byte order in raw_send_from_to on FreeBSD 11 or newer #57

Closed aheybey closed 5 years ago

aheybey commented 6 years ago

FreeBSD 11 changed the raw socket API to use the provided header without modification, so the values now need to be in network byte order as with Linux and OpenBSD.

aheybey commented 6 years ago

I fail reading comprehension; this pull request is basically the same as #51. It might be pedantically slightly more correct in how it checks the FreeBSD version (my patch tests for the exact FreeBSD version in which the API changed), but it is otherwise the same.