Commit Graph

149 Commits

Author SHA1 Message Date
Gleb Smirnoff
1df08e905a natd: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT 2022-08-30 16:24:37 -07:00
Mark Johnston
517373f723 natd: Remove uneeded in_cksum.h includes
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-11-24 13:31:16 -05:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Sevan Janiyan
9084fdf8fd Add history section to natd(8)
Fix back sentence raised by igor.

PR:		212544
Approved by:	bcr (mentor)
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D8104
2016-10-05 20:42:35 +00:00
Marcelo Araujo
f405b03367 Invert calloc(3) argument order.
Reviewed by:	ed.
MFC after:	4 weeks.
Differential Revision:	https://reviews.freebsd.org/D7902
2016-09-16 05:33:08 +00:00
Poul-Henning Kamp
6481f66b90 Do not coredump if the packet is too long in the global (non-interface
associated) instance.

The result is that the packet is dropped without an indication
that smaller MTU is advisable, which is not optimal, but better
than a NULL pointer deref.

Approved by:	re (glebius)
2016-06-28 20:10:30 +00:00
Glen Barber
7de1daeb93 Create packages for atm, ccdconfig, devd, ipf, ipfw,
iscsi, natd, nandfs, pf, quotacheck, and routed.

Add ping6 and rtsol to the runtime package.

Sponsored by:	The FreeBSD Foundation
2016-02-09 19:30:31 +00:00
Eitan Adler
463a577b27 Fix a ton of speelling errors
arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337
2015-10-21 05:37:09 +00:00
Poul-Henning Kamp
ef02f85c38 Fix two cases where "const" were washed off pointers with strchr(3) 2015-09-25 07:37:00 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Baptiste Daroussin
13eb765f2d Convert sbin/ to LIBADD
Reduce overlinking
2014-11-25 11:23:12 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Joel Dahl
df2d82e003 mdoc: remove superfluous paragraph macros. 2014-06-23 18:40:21 +00:00
Baptiste Daroussin
bd0891ceb3 use .Mt to mark up email addresses consistently (part1)
PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
2014-06-20 09:40:43 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Eitan Adler
db702c59cf remove duplicate semicolons where possible.
Approved by:	cperciva
MFC after:	1 week
2012-10-22 03:00:37 +00:00
Ed Schouten
39893d565a Add missing const keywords. 2012-10-19 14:29:03 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Joel Dahl
9760b0e0c5 mdoc: fix a few badly nested blocks. 2012-06-09 10:43:33 +00:00
Warren Block
344c81a166 Fixes to man8 groff mandoc style, usage mistakes, or typos.
PR:		168016
Submitted by:	Nobuyuki Koganemaru
Approved by:	gjb
MFC after:	3 days
2012-05-24 02:24:03 +00:00
Ed Schouten
1efe3c6b58 Add missing static keywords for global variables to tools in sbin/.
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.
2011-11-04 13:36:02 +00:00
Sergey Matveychuk
606b32f64c Fix a typo.
Approved by:	kib
2011-07-01 19:22:27 +00:00
Maxim Sobolev
dde269c93b Furthermore condition IP waiting behaviour also on -dynamic flag.
This should preserve POLA in all other cases (foreground || non-dynamic).

MFC after:	2 weeks
2011-04-18 23:45:50 +00:00
Maxim Sobolev
74def44d38 Only wait for the IP to appear on the interface if natd is running in the
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
2011-04-18 23:15:29 +00:00
Maxim Sobolev
0afb958b91 If we can retrieve interface address sleep for one second and try again.
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
2011-04-17 06:05:37 +00:00
Ed Schouten
f6d189a9e4 Raise WARNS for various tools where possible.
Submitted by:	Marius Nünnerich <marius@nuenneri.ch>
2010-01-17 21:56:27 +00:00
Ed Schouten
7154ce64ab Mute some (hidden) warnings about old-style function definitions.
Submitted by:	Marius Nünnerich <marius nuenneri ch>
2010-01-17 21:53:41 +00:00
Antoine Brodin
13e403fdea (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
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
2009-12-28 22:56:30 +00:00
Roman Kurakin
d53fe7108b Check rule numbers against maximum value to avoid rules cleanup due
to overflow.

MFC after:	5 days.
2008-09-06 17:26:52 +00:00
Alexander Motin
72cbe4adf3 Add exit_delay parameter to control daemon exit delay after signal.
PR:		bin/58696
Submitted by:	sp@alkor.ru
2008-06-22 22:14:02 +00:00
Alexander Motin
b6365f959c Use strdup() instead of static buffer allocation to avoid 128 bytes limit
on -redirect_XXX arguments length.

PR:		bin/86647
Submitted by:	Stephen Hurd <shurd@sasktel.net>
2008-06-22 21:22:25 +00:00
Brian Somers
ec95e4c235 Don't abend if we get ENOMEM from sysctl(3). The data returned
is sufficient

MFC after:	2 weeks
2008-06-06 08:59:55 +00:00
Ruslan Ermilov
98439aaf04 Improve rev. 1.63. Document -instance and -globalport options.
Add a MULTIPLE INSTANCES section which provides an example of
setting up natd in multi-instance mode (based on the notes.natd
file from phk@).

Submitted by:	"Andrey V. Elsukov" <bu7cher@yandex.ru>
Reviewed by:	ru
2008-02-04 15:27:09 +00:00
Tom Rhodes
e30ba4753a Note that the punch_fw option does not work in securelevel 3 and Xref init.8.
Bump .Dd.

PR:		41807
2008-01-21 23:09:18 +00:00
Maxim Konovalov
057c654813 o Markup and grammar fixes. 2007-12-14 14:34:26 +00:00
Ceri Davies
a1bad2e6dc Bump .Dd for r1.63; fix small nit from the same. 2007-12-10 12:03:23 +00:00
Poul-Henning Kamp
c80d9b5937 Add a bit more detailed description about a configuration
file format and about using NAT "instances".

Submitted by: "Andrey V. Elsukov" <bu7cher@yandex.ru>
2007-12-10 07:50:07 +00:00
Paolo Pisati
be4f3cd0d9 Summer of Code 2005: improve libalias - part 1 of 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
2006-09-26 23:26:53 +00:00
Xin LI
48ce8ca1aa WARNS=6 and gcc4 cleanup:
- Use const where necessary
	- Use __unused where applicable
	- Rename variables that is conflicit with global definations
2005-05-02 10:13:38 +00:00
Ruslan Ermilov
6a5796e734 Eliminate macro calls inside literal displays. 2005-01-15 12:28:01 +00:00
Tom Rhodes
7cde7ca209 Remove unused variable. 2005-01-08 22:47:10 +00:00
Poul-Henning Kamp
22c624779b Give natd multi-instance capabilities.
This makes it possible to do load-sharing on two xDSL lines etc.
2004-07-04 12:53:54 +00:00
Hiten Pandya
e53f7998da Use strlcpy(3) instead of strcpy(3).
PR:          	46761

Philipp Mergenthaler <philipp.mergenthaler@stud.uni-karlsruhe.de>
2004-05-10 22:33:12 +00:00
Luigi Rizzo
0b46c08590 Replace ROUNDUP/ADVANCE with SA_SIZE 2004-04-13 11:24:43 +00:00