[sr-dev] git:andrei/raw_sock: raw sockets: freebsd support

Andrei Pelinescu-Onciul andrei at iptel.org
Tue Aug 10 18:10:26 CEST 2010


Module: sip-router
Branch: andrei/raw_sock
Commit: 2542c0f30f0ce7cd11c437f19afb53a3b3e9f2a8
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2542c0f30f0ce7cd11c437f19afb53a3b3e9f2a8

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Tue Aug 10 17:43:25 2010 +0200

raw sockets: freebsd support

Support freebsd and theoretically other BSDs (other BSDs not tested):

- on most BSDs the offset and length of the ip header must be
  filled in host byte order (when using raw sockets with
  IPHDR_INC).
- no need for user-space fragmentation for raw sockets
- use IP_RECVDSTADDR and IPSENDSRCADDR instead of IP_PKTINFO
 (for raw sockets without IPHDR_INC)
- fix ip header length (wrongly computed, on linux it worked
  because linux always ignores and overwrites it)

---

 raw_sock.c   |  133 +++++++++++++++++++++++++++++++++++++++++++++++----------
 udp_server.c |    4 +-
 2 files changed, 111 insertions(+), 26 deletions(-)

Diff:   http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=2542c0f30f0ce7cd11c437f19afb53a3b3e9f2a8



More information about the sr-dev mailing list