summaryrefslogtreecommitdiffstats
path: root/sbin/natd/natd.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r289677:bdrewery2016-01-071-1/+1
| | | | Fix a ton of speelling errors
* remove duplicate semicolons where possible.eadler2012-10-221-1/+1
| | | | | Approved by: cperciva MFC after: 1 week
* Add missing const keywords.ed2012-10-191-1/+1
|
* Add missing static keywords for global variables to tools in sbin/.ed2011-11-041-2/+2
| | | | | | These tools declare global variables without using the static keyword, even though their use is limited to a single C-file, or without placing an extern declaration of them in the proper header file.
* Furthermore condition IP waiting behaviour also on -dynamic flag.sobomax2011-04-181-4/+8
| | | | | | This should preserve POLA in all other cases (foreground || non-dynamic). MFC after: 2 weeks
* Only wait for the IP to appear on the interface if natd is running in thesobomax2011-04-181-5/+5
| | | | | | | | | | | background. Suggested by: Garrett Cooper <yanegomi@gmail.com> Use EAGAIN instead of magic value of -2 to report this condition from the SetAliasAddressFromIfName routine. MFC after: 2 weeks
* If we can retrieve interface address sleep for one second and try again.sobomax2011-04-171-9/+29
| | | | | | | This can happen during start-up, when natd starts before dhclient has a chance to receive IP address from the upstream provider. MFC after: 2 weeks
* Mute some (hidden) warnings about old-style function definitions.ed2010-01-171-2/+2
| | | | Submitted by: Marius NĂ¼nnerich <marius nuenneri ch>
* (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.antoine2009-12-281-1/+1
| | | | | | | | | Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) MFC after: 1 month
* Check rule numbers against maximum value to avoid rules cleanup duerik2008-09-061-0/+24
| | | | | | to overflow. MFC after: 5 days.
* Add exit_delay parameter to control daemon exit delay after signal.mav2008-06-221-3/+22
| | | | | PR: bin/58696 Submitted by: sp@alkor.ru
* Use strdup() instead of static buffer allocation to avoid 128 bytes limitmav2008-06-221-6/+18
| | | | | | | on -redirect_XXX arguments length. PR: bin/86647 Submitted by: Stephen Hurd <shurd@sasktel.net>
* Don't abend if we get ENOMEM from sysctl(3). The data returnedbrian2008-06-061-1/+1
| | | | | | is sufficient MFC after: 2 weeks
* Summer of Code 2005: improve libalias - part 1 of 2piso2006-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the first part of my previous Summer of Code work, we get: -made libalias modular: -support for 'particular' protocols (like ftp/irc/etcetc) is no more hardcoded inside libalias, but it's available through external modules loadable at runtime -modules are available both in kernel (/boot/kernel/alias_*.ko) and user land (/lib/libalias_*) -protocols/applications modularized are: cuseeme, ftp, irc, nbt, pptp, skinny and smedia -added logging support for kernel side -cleanup After a buildworld, do a 'mergemaster -i' to install the file libalias.conf in /etc or manually copy it. During startup (and after every HUP signal) user land applications running the new libalias will try to read a file in /etc called libalias.conf: that file contains the list of modules to load. User land applications affected by this commit are ppp and natd: if libalias.conf is present in /etc you won't notice any difference. The only kernel land bit affected by this commit is ng_nat: if you are using ng_nat, and it doesn't correctly handle ftp/irc/etcetc sessions anymore, remember to kldload the correspondent module (i.e. kldload alias_ftp). General information and details about the inner working are available in the libalias man page under the section 'MODULAR ARCHITECTURE (AND ipfw(4) SUPPORT)'. NOTA BENE: this commit affects _ONLY_ libalias, ipfw in-kernel nat support will be part of the next libalias-related commit. Approved by: glebius Reviewed by: glebius, ru
* WARNS=6 and gcc4 cleanup:delphij2005-05-021-15/+15
| | | | | | - Use const where necessary - Use __unused where applicable - Rename variables that is conflicit with global definations
* Remove unused variable.trhodes2005-01-081-1/+0
|
* Give natd multi-instance capabilities.phk2004-07-041-173/+407
| | | | This makes it possible to do load-sharing on two xDSL lines etc.
* Use strlcpy(3) instead of strcpy(3).hmp2004-05-101-3/+3
| | | | | | PR: 46761 Philipp Mergenthaler <philipp.mergenthaler@stud.uni-karlsruhe.de>
* Replace ROUNDUP/ADVANCE with SA_SIZEluigi2004-04-131-5/+1
|
* Add Cisco Skinny Station protocol support to libalias, natd, and ppp.marcus2003-09-231-0/+25
| | | | | | | | | | | | | | | Skinny is the protocol used by Cisco IP phones to talk to Cisco Call Managers. With this code, one can use a Cisco IP phone behind a FreeBSD NAT gateway. Currently, having the Call Manager behind the NAT gateway is not supported. More information on enabling Skinny support in libalias, natd, and ppp can be found in those applications' manpages. PR: 55843 Reviewed by: ru Approved by: ru MFC after: 30 days
* Added an option to specify an alternate PID file.ru2003-08-131-3/+18
| | | | | PR: bin/37159 Submitted by: "Aleksandr A. Babaylov" <.@babolo.ru>
* If the -proxy_only option is used, the -alias_address/-interfaceru2003-06-131-2/+4
| | | | | | | options are not required. Suggested by: Vaclav Petricek MFC after: 2 weeks
* Use a more standard error message. Add FBSDID.charnier2003-02-051-4/+5
| | | | Reviewed by: ru
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* Back out part of the revision 1.2 changes -- sendto(2) canru2002-01-151-73/+28
| | | | | | | | | | | | not return ENOBUFS for unreliable protocols like divert. This should fix an issue when natd(8) keeps spamming already full dummynet(4) queues with the same packet forever. Spotted by: chkno@dork.com Explained by: luigi Reviewed by: Ari Suutari <ari.suutari@syncrontech.com> MFC after: 2 weeks
* Make -log_ipfw_denied active by default with -verbose.ru2001-11-271-1/+6
| | | | Discussed with: phk
* Fixed (local) style bugs in previous revision.ru2001-11-271-5/+7
|
* Do not uselessly whine in syslog about packets denied by ipfw rules.phk2001-10-311-3/+16
| | | | | | | | | Set 'log_ipfw_denied' option if you want the old behaviour. PR: 30255 Submitted by: Flemming "F3" Jacobsen <fj@batmule.dk> Reviewed by: phk MFC after: 4 weeks
* Revert the previous commit on objection from the maintainer. Ijoe2001-06-211-3/+2
| | | | | | missed that natd has a -v option that will give similar functionality. Requested by: ru
* When reporting that a packet can't be written back, usually becausejoe2001-06-211-2/+3
| | | | | | | of a restrictive firewall rule, also report detail on the packet that caused the failure. MFC after: 3 days
* Don't call warn() with no format string.kris2000-07-101-1/+1
|
* Added new option (-punch_fw) which allows to `punch holes'ru2000-06-271-2/+27
| | | | | | | in the ipfirewall(4) for incoming FTP/IRC DCC connections. Submitted by: Rene de Vries <rene@canyon.demon.nl> Rewritten by: ru
* Remove ``pptpalias'' since this is now done transparently by libalias(3).ru2000-06-201-33/+0
|
* Remove unused parameter.ru2000-06-161-6/+6
|
* Add new option (-target_addr) to control how to deal with incoming packetsru2000-05-181-0/+13
| | | | | | not associated with any pre-existing link. Submitted by: brian
* New option: -redirect_proto.ru2000-05-031-0/+70
|
* Fixes a potential buffer overflow with the command line arguments.joe2000-04-301-7/+11
| | | | | Submitted by: Mike Heffner <spock@techfour.net> Submitted on: audit@freebsd.org
* Load Sharing using IP Network Address Translation (RFC 2391, LSNAT).ru2000-04-271-16/+66
|
* Remove the config file line length restriction.ru2000-02-251-13/+10
| | | | | | PR: 16900 Reviewed by: "Crist J. Clark" <cjclark@home.com>, jkh Approved by: jkh
* Now that kernel is capable of notifying user processes aboutru2000-01-251-8/+6
| | | | | | | the interface MTU change (src/sys/net/if_sl.c,v 1.83), track interface MTU with -dynamic option as well. PR: 15494
* ioctl -> sysctl for interface address changes.ru1999-10-131-74/+83
| | | | | PR: 14169 Reviewed by: Ari Suutari <ari@suutari.iki.fi>
* Do not defer setting of the aliasing address fromru1999-09-281-19/+15
| | | | | | interface name if not operating in dynamic mode. Reviewed by: Ari Suutari <ari@suutari.iki.fi>
* Config file parser changes:ru1999-09-071-8/+10
| | | | | | | - Trailing spaces and empty lines are ignored. - A `#' sign will mark the remaining of the line as a comment. Reviewed by: Ari Suutari <ari@suutari.iki.fi>
* Allow signals to interrupt system calls.ru1999-09-021-1/+3
| | | | | | | | Remove redundant signal() call. PR: 6676 Submitted by: luoqi Reviewed by: Ari Suutari <ari@suutari.iki.fi>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* When incrementing through a SIOCGIFCONF list, enforce a lower limit ofarchie1999-06-051-1/+3
| | | | | | | | | sizeof(ifr->ifr_addr) for the variable length field ifr->ifr_addr.sa_len. Otherwise the increment will be wrong in certain cases. Obtained from: Whistle source tree For the record: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> suggests SIOCGIFCONF should be dropped in favor of a sysctl mechanism.
* Oops - missing parenthesisbrian1999-05-131-2/+2
|
* /sbin/natd portrange documentation and bugfixbrian1999-05-131-3/+3
| | | | | | | Submitted by: Ruslan Ermilov <ru@ucb.crimea.ua> PR: 11690 3.2 candidate ?
* More egcs warning fixes:imp1999-04-251-5/+5
| | | | | | | | | | | o main returns int not void o use braces to avoid potentially ambiguous else Note: The fix to natd is potentially functional in nature since I used the indentation as the right thing rather than the struct semantics. Someone more familiar with the code should double check me on this one. Reviewed by: obrien and chuckr
* Disable reads on our ICMP socket. We only use it for sending.brian1999-03-301-1/+8
| | | | PR: 9253
OpenPOWER on IntegriCloud