This library allows you to bind any application which is dynamically linked
with libc. It provides convient way to bind socket's source IP to one of the
multiple IP's available on computer.
To use it first of all point LD_PRELOAD to installed library and set BINDTO
variable to desired IP address to bind.
Here is the wrapper to run any command binded to some IP address:
env LD_PRELOAD=/usr/local/lib/libsocketbind.so.1 BINDTO=$MY_IP_ADDRESS $*
net/socketbind: unbreak the library
The code has multiple issues making it unusable with modern FreeBSD:
* it uses long gone ascii2addr() function removed in 2007;
* it passes hardcoded "/usr/lib/libc.so" path to dlopen(),
but now it is plain text hint file;
* this IPv4-only code neglects to check passed domain for PF_INET
messing with sockets in other domains (like PF_INET6, PF_LOCAL).
Still, it is very useful while dealing with software like Nagios
that does not support binding to specific IPv4 address
for outgoing connections. The library solves the problem with single line
in /etc/rc.conf:
nagios_env="LD_PRELOAD=/usr/local/lib/libsocketbind.so.1 BINDTO=192.168.6.1"
This changes unbreaks the library making it usable again.
net: remove 'Created by' lines
A big Thank You to the original contributors of these ports:
* <ports@c0decafe.net>
* Aaron Dalton <aaron@FreeBSD.org>
* Aaron Straup Cope <ascope@cpan.org>
* Aaron Zauner <az_mail@gmx.at>
* Adam Jette <jettea46@yahoo.com>
* Adam Weinberger <adamw@FreeBSD.org>
* Alan Eldridge <alane@geeksrus.net>
* Alex Bakhtin <Alex.Bakhtin@gmail.com>
* Alex Deiter <Alex.Deiter@Gmail.COM>
* Alex Dupre <ale@FreeBSD.org>
* Alex Dupre <sysadmin@alexdupre.com>
(Only the first 15 lines of the commit message are shown above )
The vast majority of pkg-descr files had the following format when they
had both lines:
Author: ...
WWW: ....
So standardize on that, and move them to the end of the file when necessary.
Also fix some more whitespace, and remove more "signature tags" of varying
forms, like -- name, etc.
s/AUTHOR/Author/
A few other various formatting issues
socketbind - new port submission
This library allows you to bind any application which is
dynamically linked with libc to certain IP address. It
provides convient way to bind socket's source IP to one of
the multiple IP's available on computer.
PR: ports/50147
Submitted by: Gaspar Chilingarov <nm@web.am>