REVIEW & TEST: libalias megapatch

Poul-Henning Kamp phk at phk.freebsd.dk
Sun Jan 4 08:41:12 PST 2004


http://phk.freebsd.dk/patch/libalias.patch

This patch makes it possible to have multiple packet aliasing
instances in a single process.

Redefine a new API based on s/PacketAlias/LibAlias/g

Add new "instance" argument to all functions in the new API.

Put all global variables in the instance structure.

Implement old API in terms of the new API.

No functional change.

No functions removed so there is no need for shlib version bump,
only an updating entry and a __FreeBSD_version bump.


The intent is to subsequently add a "multilink" facility to natd(8)
for people with two xDSL lines to different providers etc.

For this we need to run one packet-aliasing engine per line, and
in order to not totally toast throughput, this should not result
in more context switches then we are used to.  (ie: not
kern/usr/kern/usr/kern for the second line, but just kern/usr/kern
as always).

This patch makes it possible for programs like natd to run multiple
packet-aliasing engines, this was not previously possible because
of the widespread use of global variables in libalias.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-current mailing list