TCP Checksums in mbufs



Hi,

I have a bit of code I have written that uses pfil to access network
traffic as it passes between interfaces on a FreeBSD router. One of
the functions it performs is some incredibly basic rewrites of certain
packets (keeping the same length, so no issues about sequence
numbers), but it does alter the payload.

I just wanted to check what is the "proper" way to be going about
recalculating the checksums on the packet? I can write a function to
do this and write this into the packet stored in the mbuf directly,
however I wasn't sure if there was a more acceptable method such as
flagging it to be re-checksum'd as it's routed, or to offload the
computation to the NIC or something?

Any thoughts, suggestions, etc very welcome!

By the way, I'm not subscribed to the list right now, so I'd
appreciate it if people could CC me on replies.

Many thanks

Lee
--
Lee Brotherston - <lee@xxxxxxxxxxxx>

Attachment: smime.p7s
Description: S/MIME cryptographic signature



Relevant Pages

  • Re: TCP Checksums in mbufs
    ... traffic as it passes between interfaces on a FreeBSD router. ... recalculating the checksums on the packet? ... do this and write this into the packet stored in the mbuf directly, ...
    (freebsd-hackers)
  • Re: ng_one2many v.s. AFT (NIC Fault Tolerance/Fail Over/Redundancy Revisited) (fwd)
    ... On Thu, 12 Jan 2006, Brian J. Creasy wrote: ... | support the failure of a link which does not end up with 50% packet ... When the server is brought up, both interfaces must be ... | connected and live, or for some reason, the failure algorithm never ...
    (freebsd-questions)
  • Re: ng_one2many v.s. AFT (NIC Fault Tolerance/Fail Over/Redundancy Revisited)
    ... When 7.x becomes release production, I suspect I'll end up using that instead since it works so well with NetBSD/OpenBSD for HA ethernet, plus I'd rather have a PVST+ Cisco switch make the packet forwarding the decisions>:} ... then after 2 x heartbeat duration that link is ... When the server is brought up, both interfaces must be ... | connected and live, or for some reason, the failure algorithm never ...
    (freebsd-questions)
  • Re: Sourcing ICMP reply to a different ip address
    ... > the interface, in which the destination route is pointed at? ... > Client runs traceroute to a host routed by the FreeBSD router. ... > I'm looking to make it so that if a packet arrives on FXP0, ... > Consulting, colocation, web hosting, network design and implementation ...
    (freebsd-net)
  • Re: Question: UDP Extension, can it support more than one IP interface or phys interface?
    ... around it if it sends out all interfaces. ... it is a compiled executable like an OS command so to use it from TCL I ... wrong) as though it only takes data (packet payload) from a file. ... flexibility of specifying the data portion f the packet from a TCL ...
    (comp.lang.tcl)