353 Commits

Author SHA1 Message Date
mlaier
642ce217a4 MFC: ipfw2.c, 1.101:
Fix a parsing bug when specifying more than one address with dotted
  decimal netmask.

  Reported by:	Igor Anishchuk
  PR:		kern/107565
2007-01-10 11:34:51 +00:00
trhodes
3893462b6b Paritially sync with CURRENT, kills hard sentence breaks, fixes some markup.
MFC: 1.197
  Add a note about rule syntax compared to the shell used so users do not get
  frustraited when:
  ipfw add 201 deny ip from any to table(2) in via xl1
  returns "Badly placed ( )'s"

  PR:     73638

Approved by:	re (hrs)
2006-11-03 09:00:18 +00:00
maxim
312d1a5eea MFC rev. 1.99: check for a required "pathname" argument presence.
Approved by:	re (bmah)
2006-10-21 15:59:19 +00:00
jhay
841f0777f7 MFC: 1.98
Check the length of the ipv4 and ipv6 address lists. It must be less
than F_LEN_MASK.

Approved by:	re (hrs)
2006-09-20 19:20:19 +00:00
jhay
7fb24b6083 MFC: 1.97
Use bzero() to clear the whole ipfw_insn_icmp6 structure in fill_icmp6types(),
otherwise this command

ipfw add allow ipv6-icmp from any to 2002::1 icmp6types 1,2,128,129

turns into icmp6types 1,2,32,33,34,...94,95,128,129

PR:		102422 (part 1)
Submitted by:	Andrey V. Elsukov <bu7cher at yandex.ru>
Approved by:	re (hrs)
2006-09-20 19:18:03 +00:00
dwmalone
0f1fb984cd MFC 1.96: Treat "Bits" as bits not bytes.
MFC 1.95: Fix me6 keyword by getting parens in the right place.
2006-08-31 16:26:01 +00:00
julian
36e4535367 MFC: Remove IPFIREWALL_FORWARD_EXTENDED as an option.
Allow that behaviour by default.
Reviewed by:	glebius
2006-08-24 05:40:16 +00:00
mlaier
ce539f4975 Belatedly MFC ipfw2.c, 1.88:
For src/dest parsing take off the netmask before checking for AF with
  inet_pton.  This fixes cases like "fe02::/16".

  PR:		bin/91245
  Reported by:	Fredrik Lindberge

Reminded by:	oleg
2006-08-07 19:32:57 +00:00
oleg
2c4011996d MFC:
src/sys/netinet/ip_dummynet.c rev. 1.101
- Fix following rules: pipe X (tag|altq) Y ...

src/sys/netinet/ip_fw.h rev. 1.106
src/sys/netinet/ip_fw2.c rev. 1.132 1.134 1.135
src/sbin/ipfw/ipfw2.c rev. 1.89 1.91
src/sbin/ipfw/ipfw.8 rev. 1.188 1.189 1.190
- Implement internal (i.e. inside kernel) packet tagging using mbuf_tags(9).
  Since tags are kept while packet resides in kernelspace, it's possible to
  use other kernel facilities (like netgraph nodes) for altering those tags.

  Submitted by:   Andrey Elsukov <bu7cher at yandex dot ru>
  Submitted by:   Vadim Goncharov <vadimnuclight at tpu dot ru>

- install_state(): style(9) cleanup

- Add support of 'tablearg' feature for:
  a) 'tag' & 'untag' action parameters.
  b) 'tagged' & 'limit' rule options.

- Minor imporvements to ipfw parser:
  a) new macros:
     GET_UINT_ARG - support of 'tablearg' keyword, argument range checking.
     PRINT_UINT_ARG - support of 'tablearg' keyword.
  b) strtoport(): do not silently truncate/accept invalid port list expressions
     like: '1,2-abc' or '1,2-3-4' or '1,2-3x4', style(9) cleanup.
2006-07-29 08:24:12 +00:00
julian
64961250b2 MFC: 1.84. (and fixes)
If in silent mode, do not return an error responce if asked
to delete a table entry that is not present, or add one that exists.
2006-06-29 21:03:12 +00:00
oleg
f361b24e4b MFC src/sys/netinet/ip_fw2.c rev.1.133:
install_state() should properly initialize 'addr_type' field of newly created
flows for O_LIMIT rules.

MFC src/sbin/ipfw/ipfw2.c rev.1.90 (mlaier):

Print dynamic rules for IPv6 as well.

PR:		bin/98349
2006-06-24 06:38:39 +00:00
ume
b50d2d1850 MFC: Revert `proto ip' back to the previous behavior. The kernel side of
ipfw2 doesn't allow zero as protocol number.

	sbin/ipfw/ipfw.8:	1.186
	sbin/ipfw/ipfw2.c:	1.85

Approved by:	re (mux)
2006-03-09 09:18:37 +00:00
glebius
a06eca80b3 MFC 1.183:
Forget about ipfw1 and ipfw2. We aren't in RELENG_4 anymore.
2006-01-15 01:05:21 +00:00
glebius
470df2fb19 MFC:
Add a new feature for optimizining ipfw rulesets - substitution of the
  action argument with the value obtained from table lookup. The feature
  is now applicable only to "pipe", "queue", "divert", "tee", "netgraph"
  and "ngtee" rules.
2006-01-15 01:00:55 +00:00
glebius
bf3ba15d9b Cleanup _FreeBSD_version. 2006-01-15 00:52:15 +00:00
glebius
63168c1b16 MFC:
Catch up with ip_dummynet.h rev. 1.38.
2006-01-15 00:51:02 +00:00
ume
fb6187e212 MFC: We couldn't specify the rule for filtering tunnel traffic since an
IPv6 support was committed:

- Stop treating `ip' and `ipv6' as special in `proto' option as they
  conflict with /etc/protocols.

- Disuse `ipv4' in `proto' option as it is corresponding to `ipv6'.

- When protocol is specified as numeric, treat it as it is even it is
  41 (ipv6).

- Allow zero for protocol as it is valid number of `ip'.

	sbin/ipfw/ipfw.8:	1.180
	src/sbin/ipfw/ipfw2.c:	1.80
2005-12-06 02:51:41 +00:00
csjp
b559f044a4 MFC notes about ucred based rules and debug.mpsafenet requirements.
Approved by:	re (scottl)
2005-10-26 21:58:42 +00:00
bz
bf3595b8d8 MFC:
rev. 1.108, 1.109 src/sys/netinet/ip_fw2.c
rev. 1.101        src/sys/netinet/ip_fw.h
rev. 1.77         src/sbin/ipfw/ipfw2.c
rev. 1.176        src/sbin/ipfw/ipfw.8

* Add dynamic sysctl for net.inet6.ip6.fw.
* Correct handling of IPv6 Extension Headers.
* Add unreach6 code.
* Add logging for IPv6.
* Fix build without INET6 and IPFIREWALL compiled into kernel.[1]

Submitted by:   sysctl handling derived from patch from ume needed for ip6fw
Obtained from:  is_icmp6_query and send_reject6 derived from similar
                functions of netinet6,ip6fw
Reviewed by:    ume, gnn; silence on ipfw@
Spotted and tested by:  Michal Mertl <mime at traveller.cz>[1]
Approved by:    re (kensmith)
2005-08-20 08:36:57 +00:00
cperciva
e8f7047163 Bump document date. Remove EOL whitespace introduced in previous
commit.  Start new line at sentence break in previous commit.

Approved by:	re (implicit, fixing a commit made 5 minutes ago)
2005-07-01 10:04:33 +00:00
cperciva
9fc0d88f30 Document some limitations of uid/gid rules.
Approved by:	re (rwatson)
MFC after:	3 days
2005-07-01 09:51:10 +00:00
ru
064bdbb814 Markup fixes.
Approved by:	re (blanket)
2005-06-14 11:24:56 +00:00
mlaier
163c101c2c add_proto() now fills proto for us so stop to 'guess' the protocol from the
command and rather trust the value add_proto filled in.  While here, fix an
oversight in the pretty printing of ip6/4 options.
2005-06-07 14:11:17 +00:00
green
497a5998af Better explain, then actually implement the IPFW ALTQ-rule first-match
policy.  It may be used to provide more detailed classification of
traffic without actually having to decide its fate at the time of
classification.

MFC after:	1 week
2005-06-04 19:04:31 +00:00
mlaier
f2254cf702 Add support for IPv4 only rules to IPFW2 now that it supports IPv6 as well.
This is the last requirement before we can retire ip6fw.

Reviewed by:	dwhite, brooks(earlier version)
Submitted by:	dwhite (manpage)
Silence from:	-ipfw
2005-06-03 01:10:28 +00:00
mlaier
ce2b072e9f Unbreak handling of "ip[v]6" protocol and option flag. No more segfaults
and not every protocol is IPv6.
2005-05-21 03:27:33 +00:00
glebius
4be4400945 'ngtee' also depends on net.inet.ip.fw.one_pass. 2005-05-11 12:58:15 +00:00
glebius
32e61f472f IPFW version 2 is the only option now in HEAD. Do not confuse
users of future releases with instructions about building IPFW2
on RELENG_4.
2005-05-04 13:14:57 +00:00
brooks
3f77e18f9b Fix a the previous commit. I wanted to remove the if and always run the
body not remove both.

Reported by:	ceri
Pointy hat:	brooks
2005-04-26 20:22:31 +00:00
brooks
347035a2c9 Don't force IPv6 proto to be printed numericaly.
Noticed by:	ceri
2005-04-26 20:00:07 +00:00
brooks
f3ecaa630b Add IPv6 support to IPFW and Dummynet.
Submitted by:	Mariano Tortoriello and Raffaele De Lorenzo (via luigi)
2005-04-18 18:35:05 +00:00
brooks
151bf3aeda Be more specific when complaining about bit masks. 2005-04-05 22:26:02 +00:00
andre
9094f4f16b Bring back the full packet destination manipulation for 'ipfw fwd'
with the kernel compile time option:

 options IPFIREWALL_FORWARD_EXTENDED

This option has to be specified in addition to IPFIRWALL_FORWARD.

With this option even packets targeted for an IP address local
to the host can be redirected.  All restrictions to ensure proper
behaviour for locally generated packets are turned off.  Firewall
rules have to be carefully crafted to make sure that things like
PMTU discovery do not break.

Document the two kernel options.

PR:		kern/71910
PR:		kern/73129
MFC after:	1 week
2005-02-22 17:40:40 +00:00
ru
1541af42f1 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
glebius
319ffb2bd2 Sort SEE ALSO.
Submitted by:	ru
2005-02-07 08:51:34 +00:00
glebius
c455085275 Document how interaction with ng_ipfw node is configured. 2005-02-05 18:29:03 +00:00
glebius
67c8ae0802 Add a ng_ipfw node, implementing a quick and simple interface between
ipfw(4) and netgraph(4) facilities.

Reviewed by:	andre, brooks, julian
2005-02-05 12:06:33 +00:00
glebius
038ca13cb7 Don't print extra " via ", if we have already printed one. While here,
slightly style brackets.

PR:		misc/75297
MFC after:	1 week
2005-01-18 15:13:20 +00:00
ru
13fe9ea5a2 Sort sections. 2005-01-18 10:09:38 +00:00
ru
ee49c96852 Markup nits. 2005-01-15 11:21:24 +00:00
brooks
a7b7255dba Deprecate unmaintainable uses of strncmp to implement abbreviations.
This commit replaces those with two new functions that simplify the code
and produce warnings that the syntax is deprecated.  A small number of
sensible abbreviations may be explicitly added based on user feedback.

There were previously three types of strncmp use in ipfw:
 - Most commonly, strncmp(av, "string", sizeof(av)) was used to allow av
   to match string or any shortened form of it.  I have replaced this
   with a new function _substrcmp(av, "string") which returns 0 if av
   is a substring of "string", but emits a warning if av is not exactly
   "string".

 - The next type was two instances of strncmp(av, "by", 2) which allowed
   the abbreviation of bytes to "by", "byt", etc.  Unfortunately, it
   also supported "bykHUygh&*g&*7*ui".  I added a second new function
   _substrcmp2(av, "by", "bytes") which acts like the strncmp did, but
   complains if the user doesn't spell out the word "bytes".

 - There is also one correct use of strncmp to match "table(" which might
   have another token after it without a space.

Since I changed all the lines anyway, I also fixed the treatment of
strncmp's return as a boolean in many cases.  I also modified a few
strcmp cases as well to be fully consistent.
2005-01-15 01:46:41 +00:00
ru
c56f1c1871 Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
brooks
182c46b20d Write some bit mask limits in hex rather than decimal so they look less
magic.
2005-01-07 01:21:23 +00:00
csjp
f104772590 Update the IPFW man page to reflect reality. mpsafenet=0 is no longer
required when using ucred based rules.

Pointed out by:	seanc (thanks!)
MFC after:	1 month
2004-12-10 02:38:21 +00:00
brooks
e25eb8fca3 Remove a duplicate line from an apparent merge error in rev 1.63. 2004-11-25 01:09:41 +00:00
ceri
46aaa9be63 Be more clear that "bridged" is a synonym for "layer2".
PR:		docs/44400
Submitted by:	Constantin Stefanov <cstef at mail dot ru>
2004-11-03 21:51:34 +00:00
andre
7c8480e7f1 Refuse to unload the ipdivert module unless the 'force' flag is given to kldunload.
Reflect the fact that IPDIVERT is a loadable module in the divert(4) and ipfw(8)
man pages.
2004-10-22 19:12:01 +00:00
csjp
379f33f67e Add a note to the man page warning users about possible lock order
reversals+system lock ups if they are using ucred based rules
while running with debug.mpsafenet=1.

I am working on merging a shared locking mechanism into ipfw which
should take care of this problem, but it still requires a bit more
testing and review.
2004-10-09 20:07:33 +00:00
green
12529a8a9d Reference altq(4) instead of pf.conf(5).
Tip of the hat to:	mlaier
2004-10-08 03:31:09 +00:00
green
a5dc9b9268 Commit forgotten documentation for "diverted" rules. 2004-10-08 03:24:10 +00:00