The NetBSD Project

CVS log for src/sys/netipsec/ipsec.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / netipsec

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.166 / (download) - annotate - [select for diffs], Sat Oct 27 05:42:23 2018 UTC (3 weeks, 3 days ago) by maxv
Branch: MAIN
CVS Tags: HEAD
Changes since 1.165: +2 -14 lines
Diff to previous 1.165 (unified)

Localify one function, and switch to C99 types while here.

Revision 1.165 / (download) - annotate - [select for diffs], Wed Jul 11 05:25:45 2018 UTC (4 months, 1 week ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728
Changes since 1.164: +4 -3 lines
Diff to previous 1.164 (unified)

Rename

	ip_undefer_csum  -> in_undefer_cksum
	in_delayed_cksum -> in_undefer_cksum_tcpudp

The two previous names were inconsistent and misleading.

Put the two functions into in_offload.c. Add comments to explain what
we're doing.

The same could be done for IPv6.

Revision 1.164 / (download) - annotate - [select for diffs], Mon May 14 17:34:26 2018 UTC (6 months, 1 week ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-base, phil-wifi, pgoyette-compat-0625, pgoyette-compat-0521
Changes since 1.163: +7 -21 lines
Diff to previous 1.163 (unified)

Merge ipsec4_input and ipsec6_input into ipsec_ip_input. Make the argument
a bool for clarity. Optimize the function: if M_CANFASTFWD is not there
(because already removed by the firewall) leave now.

Makes it easier to see that M_CANFASTFWD is not removed on IPv6.

Revision 1.163 / (download) - annotate - [select for diffs], Thu May 10 05:15:14 2018 UTC (6 months, 1 week ago) by maxv
Branch: MAIN
Changes since 1.162: +3 -22 lines
Diff to previous 1.162 (unified)

Replace dumb code by M_VERIFY_PACKET. In fact, perhaps we should not even
call M_VERIFY_PACKET here, there is no particular reason for this place to
be more wrong than the rest.

Revision 1.162 / (download) - annotate - [select for diffs], Thu May 10 05:08:53 2018 UTC (6 months, 1 week ago) by maxv
Branch: MAIN
Changes since 1.161: +6 -7 lines
Diff to previous 1.161 (unified)

Rename ipsec4_forward -> ipsec_mtu, and switch to void.

Revision 1.161 / (download) - annotate - [select for diffs], Sun Apr 29 11:51:08 2018 UTC (6 months, 3 weeks ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0502
Changes since 1.160: +3 -3 lines
Diff to previous 1.160 (unified)

Remove unused and misleading argument from ipsec_set_policy.

Revision 1.160 / (download) - annotate - [select for diffs], Sat Apr 28 15:45:16 2018 UTC (6 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.159: +2 -6 lines
Diff to previous 1.159 (unified)

Remove IPSEC_SPLASSERT_SOFTNET, it has always been a no-op.

Revision 1.159 / (download) - annotate - [select for diffs], Sat Apr 28 14:21:03 2018 UTC (6 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.158: +3 -4 lines
Diff to previous 1.158 (unified)

Stop using a macro, rename the function to ipsec_init_pcbpolicy directly.

Revision 1.158 / (download) - annotate - [select for diffs], Sat Apr 28 14:01:50 2018 UTC (6 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.157: +2 -26 lines
Diff to previous 1.157 (unified)

Style and remove unused stuff.

Revision 1.157 / (download) - annotate - [select for diffs], Thu Apr 19 08:27:38 2018 UTC (7 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0422
Changes since 1.156: +3 -3 lines
Diff to previous 1.156 (unified)

Remove extra long file paths from the headers.

Revision 1.156 / (download) - annotate - [select for diffs], Wed Apr 18 06:57:39 2018 UTC (7 months ago) by maxv
Branch: MAIN
Changes since 1.155: +2 -5 lines
Diff to previous 1.155 (unified)

Remove dead code.

ok ozaki-r@

Revision 1.155 / (download) - annotate - [select for diffs], Tue Apr 17 17:47:05 2018 UTC (7 months ago) by maxv
Branch: MAIN
Changes since 1.154: +4 -2 lines
Diff to previous 1.154 (unified)

Add XXX. If this code really does something, it should use MCHTYPE.

Revision 1.154 / (download) - annotate - [select for diffs], Tue Apr 17 17:40:38 2018 UTC (7 months ago) by maxv
Branch: MAIN
Changes since 1.153: +23 -18 lines
Diff to previous 1.153 (unified)

Style, add XXX (about the mtu that goes negative), and remove #ifdef inet.

Revision 1.153 / (download) - annotate - [select for diffs], Tue Apr 3 09:03:59 2018 UTC (7 months, 2 weeks ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0415, pgoyette-compat-0407
Changes since 1.152: +2 -77 lines
Diff to previous 1.152 (unified)

Remove ipsec_copy_policy and ipsec_copy_pcbpolicy. No functional change,
since we used only ipsec_copy_pcbpolicy, and it was a no-op.

Originally we were using ipsec_copy_policy to optimize the IPsec-PCB
cache: when an ACK was received in response to a SYN, we used to copy the
SP cached in the SYN's PCB into the ACK's PCB, so that
ipsec_getpolicybysock could use the cached SP instead of requerying it.

Then we switched to ipsec_copy_pcbpolicy which has always been a no-op. As
a result the SP cached in the SYN was/is not copied in the ACK, and the
first call to ipsec_getpolicybysock had to query the SP and cache it
itself. It's not totally clear to me why this change was made.

But it has been this way for years, and after a conversation with Ryota
Ozaki it turns out the optimization is not valid anymore due to
MP-ification, so it won't be re-enabled.

ok ozaki-r@

Revision 1.152 / (download) - annotate - [select for diffs], Sat Mar 31 19:27:14 2018 UTC (7 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.151: +4 -4 lines
Diff to previous 1.151 (unified)

typo in comments

Revision 1.151 / (download) - annotate - [select for diffs], Sat Mar 3 09:54:55 2018 UTC (8 months, 2 weeks ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.150: +30 -40 lines
Diff to previous 1.150 (unified)

Reduce the diff between ipsec4_output and ipsec6_check_policy. While here
style.

Revision 1.150 / (download) - annotate - [select for diffs], Sat Mar 3 09:47:01 2018 UTC (8 months, 2 weeks ago) by maxv
Branch: MAIN
Changes since 1.149: +8 -17 lines
Diff to previous 1.149 (unified)

Dedup.

Revision 1.149 / (download) - annotate - [select for diffs], Wed Feb 28 11:29:14 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.148: +3 -3 lines
Diff to previous 1.148 (unified)

add missing static

Revision 1.148 / (download) - annotate - [select for diffs], Wed Feb 28 10:16:19 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.147: +19 -47 lines
Diff to previous 1.147 (unified)

Dedup: merge ipsec4_setspidx_inpcb and ipsec6_setspidx_in6pcb.

Revision 1.147 / (download) - annotate - [select for diffs], Wed Feb 28 10:09:17 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.146: +14 -24 lines
Diff to previous 1.146 (unified)

ipsec6_setspidx_in6pcb: call ipsec_setspidx() only once, just like the
IPv4 code. While here put the correct variable in sizeof.

ok ozaki-r@

Revision 1.146 / (download) - annotate - [select for diffs], Tue Feb 27 15:01:30 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.145: +30 -81 lines
Diff to previous 1.145 (unified)

Dedup: merge ipsec4_set_policy and ipsec6_set_policy. The content of the
original ipsec_set_policy function is inlined into the new one.

Revision 1.145 / (download) - annotate - [select for diffs], Tue Feb 27 14:52:51 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.144: +5 -8 lines
Diff to previous 1.144 (unified)

Remove duplicate checks, and no need to initialize 'newsp' in
ipsec_set_policy.

Revision 1.144 / (download) - annotate - [select for diffs], Tue Feb 27 14:44:10 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.143: +20 -85 lines
Diff to previous 1.143 (unified)

Dedup: merge

	ipsec4_get_policy and ipsec6_get_policy
	ipsec4_delete_pcbpolicy and ipsec6_delete_pcbpolicy

The already-existing ipsec_get_policy() function is inlined in the new
one.

Revision 1.143 / (download) - annotate - [select for diffs], Tue Feb 27 13:36:21 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.142: +43 -37 lines
Diff to previous 1.142 (unified)

Use inpcb_hdr to reduce the diff between

	ipsec4_set_policy and ipsec6_set_policy
	ipsec4_get_policy and ipsec6_get_policy
	ipsec4_delete_pcbpolicy and ipsec6_delete_pcbpolicy

No real functional change.

Revision 1.142 / (download) - annotate - [select for diffs], Tue Feb 27 08:05:19 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.141: +3 -3 lines
Diff to previous 1.141 (unified)

Optimize: use ipsec_sp_hdrsiz instead of ipsec_hdrsiz, not to re-query
the SP.

ok ozaki-r@

Revision 1.141 / (download) - annotate - [select for diffs], Mon Feb 26 10:36:24 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.140: +8 -29 lines
Diff to previous 1.140 (unified)

Dedup: call ipsec_in_reject directly. IPSEC_STAT_IN_POLVIO also gets
increased now.

Revision 1.140 / (download) - annotate - [select for diffs], Mon Feb 26 10:19:13 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.139: +11 -13 lines
Diff to previous 1.139 (unified)

Reduce the diff between ipsec6_input and ipsec4_input.

Revision 1.139 / (download) - annotate - [select for diffs], Mon Feb 26 09:04:29 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.138: +7 -41 lines
Diff to previous 1.138 (unified)

Dedup: merge ipsec4_in_reject and ipsec6_in_reject into ipsec_in_reject.
While here fix misleading comment.

ok ozaki-r@

Revision 1.138 / (download) - annotate - [select for diffs], Mon Feb 26 08:50:25 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.137: +4 -34 lines
Diff to previous 1.137 (unified)

Dedup: merge ipsec4_hdrsiz and ipsec6_hdrsiz into ipsec_hdrsiz.

ok ozaki-r@

Revision 1.137 / (download) - annotate - [select for diffs], Mon Feb 26 08:42:16 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.136: +8 -57 lines
Diff to previous 1.136 (unified)

Dedup: merge ipsec4_checkpolicy and ipsec6_checkpolicy into
ipsec_checkpolicy.

ok ozaki-r@

Revision 1.136 / (download) - annotate - [select for diffs], Mon Feb 26 06:48:01 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.135: +4 -5 lines
Diff to previous 1.135 (unified)

Fix nonsensical checks, neither in6p nor request is allowed to be NULL,
and the former is already dereferenced in a kassert. This code should be
the same as ipsec4_set_policy.

Revision 1.135 / (download) - annotate - [select for diffs], Mon Feb 26 06:17:01 2018 UTC (8 months, 3 weeks ago) by maxv
Branch: MAIN
Changes since 1.134: +17 -13 lines
Diff to previous 1.134 (unified)

Merge some minor (mostly stylistic) changes from last week.

Revision 1.134 / (download) - annotate - [select for diffs], Wed Feb 21 16:42:33 2018 UTC (8 months, 4 weeks ago) by maxv
Branch: MAIN
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (unified)

Fix ipsec4_get_ulp(). We should do "goto done" instead of "return",
otherwise the port fields of spidx are uninitialized.

ok mlelstv@

Revision 1.133 / (download) - annotate - [select for diffs], Wed Feb 21 16:38:15 2018 UTC (8 months, 4 weeks ago) by maxv
Branch: MAIN
Changes since 1.132: +25 -20 lines
Diff to previous 1.132 (unified)

Use inpcb_hdr to reduce the diff between:

	ipsec4_hdrsiz      and ipsec6_hdrsiz
	ipsec4_in_reject   and ipsec6_in_reject
	ipsec4_checkpolicy and ipsec4_checkpolicy

The members of these couples are now identical, and could be merged,
giving only three functions instead of six...

Revision 1.132 / (download) - annotate - [select for diffs], Wed Feb 21 16:18:52 2018 UTC (8 months, 4 weeks ago) by maxv
Branch: MAIN
Changes since 1.131: +19 -22 lines
Diff to previous 1.131 (unified)

Rename:

	ipsec_in_reject -> ipsec_sp_reject
	ipsec_hdrsiz    -> ipsec_sp_hdrsiz

localify the former, and do some cleanup while here.

Revision 1.131 / (download) - annotate - [select for diffs], Fri Feb 16 15:18:41 2018 UTC (9 months ago) by maxv
Branch: MAIN
Changes since 1.130: +25 -49 lines
Diff to previous 1.130 (unified)

Style, remove unused and misleading macros and comments, localify, and
reduce the diff between similar functions. No functional change.

Revision 1.130 / (download) - annotate - [select for diffs], Fri Feb 16 11:25:16 2018 UTC (9 months ago) by maxv
Branch: MAIN
Changes since 1.129: +3 -3 lines
Diff to previous 1.129 (unified)

Fix inverted logic, otherwise the kernel crashes when receiving a 1-byte
AH packet. Triggerable before authentication when IPsec and forwarding
are both enabled.

Revision 1.129 / (download) - annotate - [select for diffs], Fri Feb 16 11:07:44 2018 UTC (9 months ago) by maxv
Branch: MAIN
Changes since 1.128: +69 -72 lines
Diff to previous 1.128 (unified)

Style a bit, no functional change.

Revision 1.128 / (download) - annotate - [select for diffs], Fri Feb 16 09:07:50 2018 UTC (9 months ago) by maxv
Branch: MAIN
Changes since 1.127: +2 -8 lines
Diff to previous 1.127 (unified)

Remove some more FreeBSD sysctl declarations that already have NetBSD
counterparts. Discussed with ozaki-r@.

Revision 1.127 / (download) - annotate - [select for diffs], Fri Feb 16 08:56:50 2018 UTC (9 months ago) by maxv
Branch: MAIN
Changes since 1.126: +2 -6 lines
Diff to previous 1.126 (unified)

Remove ipsec_replay and ipsec_integrity from this place, they are already
declared as sysctls. Discussed with ozaki-r@.

Revision 1.126 / (download) - annotate - [select for diffs], Fri Feb 16 08:51:28 2018 UTC (9 months ago) by maxv
Branch: MAIN
Changes since 1.125: +2 -13 lines
Diff to previous 1.125 (unified)

Remove ip4_esp_randpad and ip6_esp_randpad, unused. Discussed with
ozaki-r@.

Revision 1.125 / (download) - annotate - [select for diffs], Thu Feb 8 20:57:41 2018 UTC (9 months, 1 week ago) by maxv
Branch: MAIN
Changes since 1.124: +2 -4 lines
Diff to previous 1.124 (unified)

Remove unused net_osdep.h include.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Jan 23 02:17:32 2018 UTC (9 months, 4 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.123: +4 -5 lines
Diff to previous 1.123 (unified)

Fix late NULL-checking (CID 1427782: Null pointer dereferences (REVERSE_INULL))

Revision 1.123 / (download) - annotate - [select for diffs], Tue Nov 21 07:03:08 2017 UTC (11 months, 4 weeks ago) by ozaki-r
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.122: +3 -3 lines
Diff to previous 1.122 (unified)

Use M_WAITOK to allocate mbufs wherever sleepable

Further changes will get rid of unnecessary NULL checks then.

Revision 1.122 / (download) - annotate - [select for diffs], Tue Oct 17 07:23:08 2017 UTC (13 months ago) by ozaki-r
Branch: MAIN
Changes since 1.121: +3 -3 lines
Diff to previous 1.121 (unified)

Fix buffer length for ipsec_logsastr

Revision 1.121 / (download) - annotate - [select for diffs], Tue Oct 3 08:25:21 2017 UTC (13 months, 2 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.120: +26 -26 lines
Diff to previous 1.120 (unified)

Don't abuse key_checkrequest just for looking up sav

It does more than expected for example key_acquire.

Revision 1.120 / (download) - annotate - [select for diffs], Thu Sep 28 17:21:42 2017 UTC (13 months, 3 weeks ago) by christos
Branch: MAIN
Changes since 1.119: +5 -8 lines
Diff to previous 1.119 (unified)

- sanitize key debugging so that we don't print extra newlines or unassociated
  debugging messages.
- remove unused functions and make internal ones static
- print information in one line per message

Revision 1.119 / (download) - annotate - [select for diffs], Tue Sep 19 02:44:14 2017 UTC (14 months ago) by ozaki-r
Branch: MAIN
Changes since 1.118: +13 -25 lines
Diff to previous 1.118 (unified)

Share a global dummy SP between PCBs

It's never be changed so it can be pre-allocated and shared safely between PCBs.

Revision 1.118 / (download) - annotate - [select for diffs], Thu Aug 10 06:11:24 2017 UTC (15 months, 1 week ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20170825
Changes since 1.117: +4 -2 lines
Diff to previous 1.117 (unified)

Add per-CPU rtcache to ipsec_reinject_ipstack

It reduces route lookups and also reduces rtcache lock contentions
when NET_MPSAFE is enabled.

Revision 1.117 / (download) - annotate - [select for diffs], Mon Aug 7 03:18:32 2017 UTC (15 months, 2 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.116: +2 -7 lines
Diff to previous 1.116 (unified)

Remove out-of-date log output

Pointed out by riastradh@

Revision 1.116 / (download) - annotate - [select for diffs], Thu Aug 3 06:32:51 2017 UTC (15 months, 2 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.115: +5 -5 lines
Diff to previous 1.115 (unified)

Introduce KEY_SA_UNREF and replace KEY_FREESAV with it where sav will never be actually freed in the future

KEY_SA_UNREF is still key_freesav so no functional change for now.

This change reduces diff of further changes.

Revision 1.115 / (download) - annotate - [select for diffs], Wed Aug 2 04:03:28 2017 UTC (15 months, 2 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.114: +6 -2 lines
Diff to previous 1.114 (unified)

Comment out unused functions

Revision 1.114 / (download) - annotate - [select for diffs], Wed Aug 2 03:45:57 2017 UTC (15 months, 2 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.113: +8 -6 lines
Diff to previous 1.113 (unified)

Don't use KEY_NEWSP for dummy SP entries

By the change KEY_NEWSP is now not called from softint anymore
and we can use kmem_zalloc with KM_SLEEP for KEY_NEWSP.

Revision 1.113 / (download) - annotate - [select for diffs], Wed Aug 2 01:28:03 2017 UTC (15 months, 2 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.112: +88 -45 lines
Diff to previous 1.112 (unified)

Make IPsec SPD MP-safe

We use localcount(9), not psref(9), to make the sptree and secpolicy (SP)
entries MP-safe because SPs need to be referenced over opencrypto
processing that executes a callback in a different context.

SPs on sockets aren't managed by the sptree and can be destroyed in softint.
localcount_drain cannot be used in softint so we delay the destruction of
such SPs to a thread context. To do so, a list to manage such SPs is added
(key_socksplist) and key_timehandler_spd deletes dead SPs in the list.

For more details please read the locking notes in key.c.

Proposed on tech-kern@ and tech-net@

Revision 1.112 / (download) - annotate - [select for diffs], Wed Jul 26 07:39:54 2017 UTC (15 months, 3 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (unified)

Fix indentation

Pointed out by knakahara@

Revision 1.111 / (download) - annotate - [select for diffs], Wed Jul 26 03:59:59 2017 UTC (15 months, 3 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.110: +6 -6 lines
Diff to previous 1.110 (unified)

Provide and apply key_sp_refcnt (NFC)

It simplifies further changes.

Revision 1.110 / (download) - annotate - [select for diffs], Fri Jul 21 04:50:11 2017 UTC (16 months ago) by ozaki-r
Branch: MAIN
Changes since 1.109: +2 -3 lines
Diff to previous 1.109 (unified)

Remove ipsecrequest#sav

Revision 1.109 / (download) - annotate - [select for diffs], Fri Jul 21 04:39:08 2017 UTC (16 months ago) by ozaki-r
Branch: MAIN
Changes since 1.108: +4 -65 lines
Diff to previous 1.108 (unified)

Don't use key_lookup_sp that depends on unstable sp->req->sav

It provided a fast look-up of SP. We will provide an alternative
method in the future (after basic MP-ification finishes).

Revision 1.108 / (download) - annotate - [select for diffs], Fri Jul 21 03:08:10 2017 UTC (16 months ago) by ozaki-r
Branch: MAIN
Changes since 1.107: +19 -19 lines
Diff to previous 1.107 (unified)

Don't use sp->req->sav when handling NAT-T ESP fragmentation

In order to do this we need to look up a sav however an additional
look-up degrades performance. A sav is later looked up in
ipsec4_process_packet so delay the fragmentation check until then
to avoid an extra look-up.

Revision 1.107 / (download) - annotate - [select for diffs], Fri Jul 21 02:51:12 2017 UTC (16 months ago) by ozaki-r
Branch: MAIN
Changes since 1.106: +17 -5 lines
Diff to previous 1.106 (unified)

Don't use unstable isr->sav for header size calculations

We may need to optimize to not look up sav here for users that
don't need to know an exact size of headers (e.g., TCP segmemt size
caclulation).

Revision 1.106 / (download) - annotate - [select for diffs], Wed Jul 19 06:31:54 2017 UTC (16 months ago) by ozaki-r
Branch: MAIN
Changes since 1.105: +9 -4 lines
Diff to previous 1.105 (unified)

Look up sav instead of relying on unstable sp->req->sav

This code is executed only in an error path so an additional lookup
doesn't matter.

Revision 1.105 / (download) - annotate - [select for diffs], Wed Jul 19 06:30:32 2017 UTC (16 months ago) by ozaki-r
Branch: MAIN
Changes since 1.104: +2 -14 lines
Diff to previous 1.104 (unified)

Remove invalid M_AUTHIPDGM check on ESP isr->sav

M_AUTHIPDGM flag is set to a mbuf in ah_input_cb. An sav of ESP can
have AH authentication as sav->tdb_authalgxform. However, in that
case esp_input and esp_input_cb are used to do ESP decryption and
AH authentication and M_AUTHIPDGM never be set to a mbuf. So
checking M_AUTHIPDGM of a mbuf on isr->sav of ESP is meaningless.

Revision 1.104 / (download) - annotate - [select for diffs], Tue Jul 18 09:00:55 2017 UTC (16 months ago) by ozaki-r
Branch: MAIN
Changes since 1.103: +6 -2 lines
Diff to previous 1.103 (unified)

Restore a comment removed in previous

The comment is valid for the below code.

Revision 1.103 / (download) - annotate - [select for diffs], Tue Jul 18 08:55:10 2017 UTC (16 months ago) by ozaki-r
Branch: MAIN
Changes since 1.102: +2 -12 lines
Diff to previous 1.102 (unified)

Remove m_tag_find(PACKET_TAG_IPSEC_PENDING_TDB) because nobody sets the tag

Revision 1.102 / (download) - annotate - [select for diffs], Wed Jul 12 07:00:40 2017 UTC (16 months, 1 week ago) by ozaki-r
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646
Changes since 1.101: +3 -3 lines
Diff to previous 1.101 (unified)

Omit unnecessary NULL checks for sav->sah

Revision 1.101 / (download) - annotate - [select for diffs], Fri Jul 7 01:37:34 2017 UTC (16 months, 2 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.100: +13 -13 lines
Diff to previous 1.100 (unified)

Rename key_alloc* functions (NFC)

We shouldn't use the term "alloc" for functions that just look up
data and actually don't allocate memory.

Revision 1.100 / (download) - annotate - [select for diffs], Wed Jun 14 02:00:43 2017 UTC (17 months, 1 week ago) by ozaki-r
Branch: MAIN
Changes since 1.99: +9 -13 lines
Diff to previous 1.99 (unified)

KNF

Revision 1.99 / (download) - annotate - [select for diffs], Fri Jun 2 03:41:20 2017 UTC (17 months, 2 weeks ago) by ozaki-r
Branch: MAIN
CVS Tags: netbsd-8-base
Branch point for: netbsd-8
Changes since 1.98: +4 -4 lines
Diff to previous 1.98 (unified)

Assert inph_locked on ipsec_pcb_skip_ipsec (was IPSEC_PCB_SKIP_IPSEC)

The assertion confirms SP caches are accessed under inph lock (solock).

Revision 1.98 / (download) - annotate - [select for diffs], Fri Jun 2 03:39:28 2017 UTC (17 months, 2 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.97: +4 -4 lines
Diff to previous 1.97 (unified)

Rename IPSEC_PCBHINT_MAYBE to IPSEC_PCBHINT_UNKNOWN

MAYBE is maybe unclear.

Revision 1.97 / (download) - annotate - [select for diffs], Fri Jun 2 03:34:10 2017 UTC (17 months, 2 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.96: +2 -4 lines
Diff to previous 1.96 (unified)

Get rid of redundant NULL check (NFC)

Revision 1.96 / (download) - annotate - [select for diffs], Thu Jun 1 02:45:14 2017 UTC (17 months, 2 weeks ago) by chs
Branch: MAIN
Changes since 1.95: +2 -12 lines
Diff to previous 1.95 (unified)

remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.95 / (download) - annotate - [select for diffs], Tue May 30 01:31:07 2017 UTC (17 months, 3 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.94: +7 -7 lines
Diff to previous 1.94 (unified)

Make refcnt operations of SA and SP atomic

Using atomic opeartions isn't optimal and should be optimized somehow
in the future though, the change allows a kernel with NET_MPSAFE to
run out a benchmark, which is useful to know performance improvement
and degradation by code changes.

Revision 1.94 / (download) - annotate - [select for diffs], Tue May 23 09:08:45 2017 UTC (17 months, 4 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.93: +4 -4 lines
Diff to previous 1.93 (unified)

Use __arraycount (NFC)

Revision 1.93 / (download) - annotate - [select for diffs], Tue May 23 04:26:08 2017 UTC (17 months, 4 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.92: +4 -6 lines
Diff to previous 1.92 (unified)

Disable secspacq stuffs that are now unused

The stuffs are used only if sp->policy == IPSEC_POLICY_IPSEC
&& sp->req == NULL (see ipsec{4,6}_checkpolicy). However, in the
current implementation, sp->req never be NULL (except for the
moments of SP allocation and deallocation) if sp->policy is
IPSEC_POLICY_IPSEC.

It seems that the facility was partially implemented in the KAME
era and wasn't completed. Make it clear that the facility is
unused for now by #ifdef notyet. Eventually we should complete
the implementation or remove it entirely.

Revision 1.92 / (download) - annotate - [select for diffs], Fri May 19 04:34:09 2017 UTC (18 months ago) by ozaki-r
Branch: MAIN
Changes since 1.91: +31 -32 lines
Diff to previous 1.91 (unified)

Introduce IPSECLOG and replace ipseclog and DPRINTF with it

Revision 1.91 / (download) - annotate - [select for diffs], Tue May 16 07:25:57 2017 UTC (18 months ago) by ozaki-r
Branch: MAIN
CVS Tags: prg-localcount2-base3
Changes since 1.90: +8 -5 lines
Diff to previous 1.90 (unified)

Fix diagnostic assertion failure in ipsec_init_policy

  panic: kernel diagnostic assertion "!cpu_softintr_p()" failed: file "../../../../netipsec/ipsec.c", line 1277
  cpu7: Begin traceback...
  vpanic() at netbsd:vpanic+0x140
  ch_voltag_convert_in() at netbsd:ch_voltag_convert_in
  ipsec_init_policy() at netbsd:ipsec_init_policy+0x149
  in_pcballoc() at netbsd:in_pcballoc+0x1c5
  tcp_attach_wrapper() at netbsd:tcp_attach_wrapper+0x1e1
  sonewconn() at netbsd:sonewconn+0x1ea
  syn_cache_get() at netbsd:syn_cache_get+0x15f
  tcp_input() at netbsd:tcp_input+0x1689
  ipintr() at netbsd:ipintr+0xa88
  softint_dispatch() at netbsd:softint_dispatch+0xd3
  DDB lost frame for netbsd:Xsoftintr+0x4f, trying 0xfffffe811d337ff0
  Xsoftintr() at netbsd:Xsoftintr+0x4f

Reported by msaitoh@

Revision 1.90 / (download) - annotate - [select for diffs], Tue May 16 03:05:28 2017 UTC (18 months ago) by ozaki-r
Branch: MAIN
Changes since 1.89: +16 -11 lines
Diff to previous 1.89 (unified)

Use kmem(9) instead of malloc/free

Some of non-sleepable allocations can be replaced with sleepable ones.
To make it clear that the replacements are possible, some assertions
are addded.

Revision 1.89 / (download) - annotate - [select for diffs], Mon May 15 09:55:29 2017 UTC (18 months, 1 week ago) by ozaki-r
Branch: MAIN
Changes since 1.88: +3 -3 lines
Diff to previous 1.88 (unified)

Show __func__ instead of __FILE__ in debug log messages

__func__ is shorter and more useful than __FILE__.

Revision 1.88 / (download) - annotate - [select for diffs], Thu May 11 05:55:14 2017 UTC (18 months, 1 week ago) by ryo
Branch: MAIN
Changes since 1.87: +15 -38 lines
Diff to previous 1.87 (unified)

Make ipsec_address() and ipsec_logsastr() mpsafe.

Revision 1.87 / (download) - annotate - [select for diffs], Wed May 10 09:34:52 2017 UTC (18 months, 1 week ago) by ozaki-r
Branch: MAIN
CVS Tags: prg-localcount2-base2
Changes since 1.86: +5 -4 lines
Diff to previous 1.86 (unified)

Stop ipsec4_output returning SP to the caller

SP isn't used by the caller (ip_output) and also holding its
reference looks unnecessary.

Revision 1.86 / (download) - annotate - [select for diffs], Mon May 8 06:39:23 2017 UTC (18 months, 2 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (unified)

Omit two arguments of ipsec4_process_packet

flags is unused and tunalready is always 0. So NFC.

Revision 1.85 / (download) - annotate - [select for diffs], Fri Apr 28 02:29:38 2017 UTC (18 months, 3 weeks ago) by ozaki-r
Branch: MAIN
CVS Tags: prg-localcount2-base1
Changes since 1.84: +3 -4 lines
Diff to previous 1.84 (unified)

Fix function name in log message

Revision 1.84 / (download) - annotate - [select for diffs], Tue Apr 25 05:44:11 2017 UTC (18 months, 3 weeks ago) by ozaki-r
Branch: MAIN
CVS Tags: prg-localcount2-base, pgoyette-localcount-20170426
Branch point for: prg-localcount2
Changes since 1.83: +11 -2 lines
Diff to previous 1.83 (unified)

Check if solock of PCB is held when SP caches in the PCB are accessed

To this end, a back pointer from inpcbpolicy to inpcb_hdr is added.

Revision 1.83 / (download) - annotate - [select for diffs], Fri Apr 21 08:39:06 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
CVS Tags: bouyer-socketcan-base1
Changes since 1.82: +10 -10 lines
Diff to previous 1.82 (unified)

Use inph for variable name of struct inpcb_hdr (NFC)

Revision 1.82 / (download) - annotate - [select for diffs], Thu Apr 20 08:46:07 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.81: +10 -10 lines
Diff to previous 1.81 (unified)

Remove unnecessary NULL checks for inp_socket and in6p_socket

They cannot be NULL except for programming errors.

Revision 1.81 / (download) - annotate - [select for diffs], Thu Apr 20 03:41:47 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.80: +7 -25 lines
Diff to previous 1.80 (unified)

Provide IPSEC_DIR_* validation macros

Revision 1.80 / (download) - annotate - [select for diffs], Wed Apr 19 07:19:46 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.79: +6 -11 lines
Diff to previous 1.79 (unified)

Use KASSERT for sanity checks of function arguments

Revision 1.79 / (download) - annotate - [select for diffs], Wed Apr 19 07:14:45 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.78: +4 -6 lines
Diff to previous 1.78 (unified)

Change ifdef DIAGNOSTIC + panic to KASSERT

Revision 1.78 / (download) - annotate - [select for diffs], Wed Apr 19 03:43:34 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.77: +12 -12 lines
Diff to previous 1.77 (unified)

Fix indentations (NFC)

Revision 1.77 / (download) - annotate - [select for diffs], Wed Apr 19 03:42:11 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.76: +59 -53 lines
Diff to previous 1.76 (unified)

Tweak KEYDEBUG macros

Let's avoid passing statements to a macro.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Apr 19 03:40:58 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.75: +5 -13 lines
Diff to previous 1.75 (unified)

Change panic if DIAGNOSTIC to KASSERT

One can be changed to CTASSERT.

Revision 1.75 / (download) - annotate - [select for diffs], Wed Apr 19 03:39:14 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.74: +17 -18 lines
Diff to previous 1.74 (unified)

Retire ipsec_osdep.h

We don't need to care other OSes (FreeBSD) anymore.

Some macros are alive in ipsec_private.h.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Apr 19 03:28:19 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.73: +5 -3 lines
Diff to previous 1.73 (unified)

Improve message on assertion failure

Revision 1.73 / (download) - annotate - [select for diffs], Tue Apr 18 05:26:41 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.72: +67 -74 lines
Diff to previous 1.72 (unified)

Convert IPSEC_ASSERT to KASSERT or KASSERTMSG

IPSEC_ASSERT just discarded specified message...

Revision 1.72 / (download) - annotate - [select for diffs], Tue Apr 18 05:25:32 2017 UTC (19 months ago) by ozaki-r
Branch: MAIN
Changes since 1.71: +2 -63 lines
Diff to previous 1.71 (unified)

Remove __FreeBSD__ and __NetBSD__ switches

No functional changes (except for a debug printf).

Note that there remain some __FreeBSD__ for sysctl knobs which counerparts
to NetBSD don't exist. And ipsec_osdep.h isn't touched yet; tidying it up
requires actual code changes.

Revision 1.71 / (download) - annotate - [select for diffs], Thu Apr 6 09:20:07 2017 UTC (19 months, 2 weeks ago) by ozaki-r
Branch: MAIN
CVS Tags: jdolecek-ncq-base, jdolecek-ncq
Changes since 1.70: +9 -2 lines
Diff to previous 1.70 (unified)

Prepare netipsec for rump-ification

- Include "opt_*.h" only if _KERNEL_OPT is defined
- Allow encapinit to be called twice (by ifinit and ipe4_attach)
  - ifinit didn't call encapinit if IPSEC is enabled (ipe4_attach called
    it instead), however, on a rump kernel ipe4_attach may not be called
    even if IPSEC is enabled. So we need to allow ifinit to call it anyway
- Setup sysctls in ipsec_attach explicitly instead of using SYSCTL_SETUP
- Call ip6flow_invalidate_all in key_spdadd only if in6_present
  - It's possible that a rump kernel loads the ipsec library but not
    the inet6 library

Revision 1.70 / (download) - annotate - [select for diffs], Fri Mar 3 07:13:06 2017 UTC (20 months, 2 weeks ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320
Changes since 1.69: +4 -12 lines
Diff to previous 1.69 (unified)

Pass inpcb/in6pcb instead of socket to ip_output/ip6_output

- Passing a socket to Layer 3 is layer violation and even unnecessary
- The change makes codes of callers and IPsec a bit simple

Revision 1.69 / (download) - annotate - [select for diffs], Mon Jan 16 15:44:47 2017 UTC (22 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20170204
Changes since 1.68: +3 -3 lines
Diff to previous 1.68 (unified)

ip6_sprintf -> IN6_PRINT so that we pass the size.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Jan 16 07:33:36 2017 UTC (22 months ago) by ryo
Branch: MAIN
Changes since 1.67: +7 -3 lines
Diff to previous 1.67 (unified)

Make ip6_sprintf(), in_fmtaddr(), lla_snprintf() and icmp6_redirect_diag() mpsafe.

Reviewed by ozaki-r@

Revision 1.67 / (download) - annotate - [select for diffs], Thu Dec 8 05:16:34 2016 UTC (23 months, 1 week ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.66: +3 -2 lines
Diff to previous 1.66 (unified)

Add rtcache_unref to release points of rtentry stemming from rtcache

In the MP-safe world, a rtentry stemming from a rtcache can be freed at any
points. So we need to protect rtentries somehow say by reference couting or
passive references. Regardless of the method, we need to call some release
function of a rtentry after using it.

The change adds a new function rtcache_unref to release a rtentry. At this
point, this function does nothing because for now we don't add a reference
to a rtentry when we get one from a rtcache. We will add something useful
in a further commit.

This change is a part of changes for MP-safe routing table. It is separated
to avoid one big change that makes difficult to debug by bisecting.

Revision 1.66 / (download) - annotate - [select for diffs], Wed Apr 1 02:49:44 2015 UTC (3 years, 7 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.65: +48 -3 lines
Diff to previous 1.65 (unified)

Pull out ipsec routines from ip6_input

This change reduces symbol references from netinet6 to netipsec
and improves modularity of netipsec.

No functional change is intended.

Revision 1.65 / (download) - annotate - [select for diffs], Wed Apr 1 01:44:56 2015 UTC (3 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (unified)

Fix wrong comments

Revision 1.64 / (download) - annotate - [select for diffs], Wed Aug 13 19:43:47 2014 UTC (4 years, 3 months ago) by plunky
Branch: MAIN
CVS Tags: nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (unified)

C99 6.5.15 Conditional operator note 3 states that the second and
third operators of a ?: operation shoud (amongst other conditions)
either both be integer type, or both void type. cast the second
to (void) then, as log() is already a void and no result is desired.

Revision 1.63 / (download) - annotate - [select for diffs], Fri May 30 01:39:03 2014 UTC (4 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-1-RELEASE, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Branch point for: netbsd-7-1, netbsd-7-0, netbsd-7
Changes since 1.62: +5 -2 lines
Diff to previous 1.62 (unified)

Introduce 2 new variables: ipsec_enabled and ipsec_used.
Ipsec enabled is controlled by sysctl and determines if is allowed.
ipsec_used is set automatically based on ipsec being enabled, and
rules existing.

Revision 1.62 / (download) - annotate - [select for diffs], Tue Dec 24 15:48:53 2013 UTC (4 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.61: +150 -167 lines
Diff to previous 1.61 (unified)

fix debugging output printfs to use __func__ so they print the correct names.

Revision 1.61 / (download) - annotate - [select for diffs], Tue Dec 24 13:57:06 2013 UTC (4 years, 10 months ago) by degroote
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (unified)

fix a typo in the log ouput of ipsec4_get_policy

Revision 1.60 / (download) - annotate - [select for diffs], Sat Jun 8 13:50:22 2013 UTC (5 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.59: +107 -2 lines
Diff to previous 1.59 (unified)

Split IPsec code in ip_input() and ip_forward() into the separate routines
ipsec4_input() and ipsec4_forward().  Tested by christos@.

Revision 1.59 / (download) - annotate - [select for diffs], Sat Jun 8 03:26:05 2013 UTC (5 years, 5 months ago) by rmind
Branch: MAIN
Changes since 1.58: +98 -2 lines
Diff to previous 1.58 (unified)

Split IPSec logic from ip_output() into a separate routine - ipsec4_output().
No change to the mechanism intended.  Tested by christos@.

Revision 1.58 / (download) - annotate - [select for diffs], Tue Jun 4 22:47:37 2013 UTC (5 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.57: +13 -2 lines
Diff to previous 1.57 (unified)

PR/47886: Dr. Wolfgang Stukenbrock: IPSEC_NAT_T enabled kernels may access
outdated pointers and pass ESP data to UPD-sockets.
While here, simplify the code and remove the IPSEC_NAT_T option; always
compile nat-traversal in so that it does not bitrot.

Revision 1.57 / (download) - annotate - [select for diffs], Fri Dec 7 15:29:38 2012 UTC (5 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, khorben-n900, agc-symver-base, agc-symver
Changes since 1.56: +28 -28 lines
Diff to previous 1.56 (unified)

rename pcb_sp to policy to avoid:
$SRC/arch/arm/include/pcb.h:#define     pcb_sp          pcb_un.un_32.pcb32_sp
$SRC/arch/arm/include/pcb.h:#define     pcb_sp          pcb_sf.sf_r13

Revision 1.56 / (download) - annotate - [select for diffs], Tue Mar 13 18:41:00 2012 UTC (6 years, 8 months ago) by elad
Branch: MAIN
CVS Tags: yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base10
Branch point for: tls-maxphys
Changes since 1.55: +4 -4 lines
Diff to previous 1.55 (unified)

Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

    http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
    http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
    http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Jun 9 19:54:18 2011 UTC (7 years, 5 months ago) by drochner
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, rmind-uvmplock-nbase, rmind-uvmplock-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, netbsd-6-1, netbsd-6-0, netbsd-6, jmcneill-usbmp
Changes since 1.54: +30 -31 lines
Diff to previous 1.54 (unified)

more "const"

Revision 1.54 / (download) - annotate - [select for diffs], Wed Jun 8 16:24:50 2011 UTC (7 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.53: +3 -3 lines
Diff to previous 1.53 (unified)

Fiddle a bit with const's to make FAST_IPSEC compile.

Revision 1.53 / (download) - annotate - [select for diffs], Sun Jun 5 01:45:37 2011 UTC (7 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.52: +4 -6 lines
Diff to previous 1.52 (unified)

more malloc style.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Jun 5 01:40:40 2011 UTC (7 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.51: +9 -10 lines
Diff to previous 1.51 (unified)

- sprinkle const
- malloc style

Revision 1.51 / (download) - annotate - [select for diffs], Mon May 16 10:00:32 2011 UTC (7 years, 6 months ago) by drochner
Branch: MAIN
CVS Tags: cherry-xenmp-base
Branch point for: cherry-xenmp
Changes since 1.50: +8 -8 lines
Diff to previous 1.50 (unified)

cosmetical whitespace changes

Revision 1.50 / (download) - annotate - [select for diffs], Fri Feb 18 19:06:45 2011 UTC (7 years, 9 months ago) by drochner
Branch: MAIN
CVS Tags: bouyer-quota2-nbase
Changes since 1.49: +7 -7 lines
Diff to previous 1.49 (unified)

sprinkle some "const", documenting that the SA is not supposed to
change during an xform operation

Revision 1.49 / (download) - annotate - [select for diffs], Fri Feb 11 17:53:35 2011 UTC (7 years, 9 months ago) by drochner
Branch: MAIN
CVS Tags: bouyer-quota2-base
Changes since 1.48: +10 -2 lines
Diff to previous 1.48 (unified)

invalidate the secpolicy cache bin the PCB before destroying, so that
the refcount in the (global) policies gets decremented
(This apparently was missed when the policy cache code was copied
over from KAME IPSEC.)
From Wolfgang Stukenbrock per PR kern/44410, just fixed differently
to avoid unecessary differences to KAME.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Jul 21 20:41:31 2010 UTC (8 years, 4 months ago) by jakllsch
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Changes since 1.47: +2 -4 lines
Diff to previous 1.47 (unified)

Further silence ipsec_attach().
"initializing IPsec..."" done" is of somewhat limited value.
(I normally wouldn't care; but on my box the (root) uhub(4)s attach
between the first and last portion of the line.)

Revision 1.47 / (download) - annotate - [select for diffs], Sun Jan 31 00:43:38 2010 UTC (8 years, 9 months ago) by hubertf
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base1, uebayasi-xip-base
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.46: +4 -4 lines
Diff to previous 1.46 (unified)

Replace more printfs with aprint_normal / aprint_verbose
Makes "boot -z" go mostly silent for me.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Jul 30 14:41:59 2009 UTC (9 years, 3 months ago) by jakllsch
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, matt-premerge-20091211, jym-xensuspend-nbase
Changes since 1.45: +5 -3 lines
Diff to previous 1.45 (unified)

As explained in kern/41701 there's a missing splx() here.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Jun 25 17:39:51 2009 UTC (9 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-nfs-mp-base6, jymxensuspend-base
Changes since 1.44: +4 -4 lines
Diff to previous 1.44 (unified)

Only print debugging messages about policy on error.

Revision 1.44 / (download) - annotate - [select for diffs], Sun May 10 02:13:07 2009 UTC (9 years, 6 months ago) by elad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base5, yamt-nfs-mp-base4, jym-xensuspend-base
Changes since 1.43: +16 -10 lines
Diff to previous 1.43 (unified)

Adapt FAST_IPSEC to recent KPI changes.

Pointed out by dyoung@ on tech-kern@, thanks!

Revision 1.43 / (download) - annotate - [select for diffs], Sat Apr 18 14:58:06 2009 UTC (9 years, 7 months ago) by tsutsui
Branch: MAIN
CVS Tags: yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base
Changes since 1.42: +6 -6 lines
Diff to previous 1.42 (unified)

Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch

Revision 1.42 / (download) - annotate - [select for diffs], Wed Mar 18 17:06:52 2009 UTC (9 years, 8 months ago) by cegger
Branch: MAIN
Changes since 1.41: +6 -6 lines
Diff to previous 1.41 (unified)

bcopy -> memcpy

Revision 1.41 / (download) - annotate - [select for diffs], Wed Mar 18 16:00:23 2009 UTC (9 years, 8 months ago) by cegger
Branch: MAIN
Changes since 1.40: +15 -15 lines
Diff to previous 1.40 (unified)

bzero -> memset

Revision 1.40 / (download) - annotate - [select for diffs], Wed Mar 18 15:14:32 2009 UTC (9 years, 8 months ago) by cegger
Branch: MAIN
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (unified)

bcmp -> memcmp

Revision 1.39 / (download) - annotate - [select for diffs], Fri Jun 27 17:28:24 2008 UTC (10 years, 4 months ago) by degroote
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base, nick-hppapmap-base2, netbsd-5-base, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-1-RELEASE, mjf-devfs2-base, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, haad-dm, ad-audiomp2-base, ad-audiomp2
Branch point for: nick-hppapmap, netbsd-5-0, netbsd-5, matt-nb5-mips64, jym-xensuspend
Changes since 1.38: +4 -4 lines
Diff to previous 1.38 (unified)

Kill caddr_t introduced in the previous revision
Fix build with FAST_IPSEC

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 27 05:18:58 2008 UTC (10 years, 4 months ago) by mlelstv
Branch: MAIN
Changes since 1.37: +23 -2 lines
Diff to previous 1.37 (unified)

Verify icmp type and code in IPSEC rules.
Fixes PR kern/39018

Revision 1.37 / (download) - annotate - [select for diffs], Wed Apr 23 06:09:05 2008 UTC (10 years, 7 months ago) by thorpej
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, yamt-nfs-mp-base, wrstuden-revivesa-base-1, wrstuden-revivesa-base, hpcarm-cleanup-nbase
Branch point for: yamt-nfs-mp, wrstuden-revivesa, simonb-wapbl
Changes since 1.36: +18 -12 lines
Diff to previous 1.36 (unified)

Make IPSEC and FAST_IPSEC stats per-cpu.  Use <net/net_stats.h> and
netstat_sysctl().

Revision 1.36 / (download) - annotate - [select for diffs], Sat Dec 29 14:53:24 2007 UTC (10 years, 10 months ago) by degroote
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, bouyer-xeni386-nbase, bouyer-xeni386-base, ad-socklock-base1
Branch point for: yamt-pf42, mjf-devfs2
Changes since 1.35: +19 -68 lines
Diff to previous 1.35 (unified)

Simplify the FAST_IPSEC output path
Only record an IPSEC_OUT_DONE tag when we have finished the processing
In ip{,6}_output, check this tag to know if we have already processed this
packet.
Remove some dead code (IPSEC_PENDING_TDB is not used in NetBSD)

Fix pr/36870

Revision 1.35 / (download) - annotate - [select for diffs], Sun Dec 9 18:27:39 2007 UTC (10 years, 11 months ago) by degroote
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, vmlocking2-base3, cube-autoconf-base, cube-autoconf
Branch point for: bouyer-xeni386
Changes since 1.34: +2 -14 lines
Diff to previous 1.34 (unified)

Kill _IP_VHL ifdef (from netinet/ip.h history, it has never been used in NetBSD so ...)

Revision 1.34 / (download) - annotate - [select for diffs], Sun Oct 28 15:48:23 2007 UTC (11 years ago) by adrianp
Branch: MAIN
CVS Tags: yamt-kmem-base, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: yamt-kmem, vmlocking2, mjf-devfs
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (unified)

The function ipsec4_get_ulp assumes that ip_off is in host order. This results
in IPsec processing that is dependent on protocol and/or port can be bypassed.

Bug report, analysis and initial fix from Karl Knutsson.
Final patch and ok from degroote@

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jul 7 18:38:22 2007 UTC (11 years, 4 months ago) by degroote
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, vmlocking-base, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: matt-armv6, jmcneill-pm, bouyer-xenamd64
Changes since 1.32: +59 -131 lines
Diff to previous 1.32 (unified)

Ansify
Remove useless extern
bzero -> memset, bcopy -> memcpy

No functionnal changes

Revision 1.32 / (download) - annotate - [select for diffs], Tue May 8 14:07:42 2007 UTC (11 years, 6 months ago) by degroote
Branch: MAIN
CVS Tags: yamt-idlelwp-base8
Changes since 1.31: +16 -14 lines
Diff to previous 1.31 (unified)

Always compute the sp index even if we don't have any sp in spd. It will
let us to choose the right default policy (based on the adress family
requested).

While here, fix an error message

Revision 1.31 / (download) - annotate - [select for diffs], Sun Apr 15 14:17:12 2007 UTC (11 years, 7 months ago) by degroote
Branch: MAIN
Changes since 1.30: +25 -10 lines
Diff to previous 1.30 (unified)

Choose the good default policy, depending of the adress family of the
desired policy

Revision 1.30 / (download) - annotate - [select for diffs], Sun Mar 25 22:06:33 2007 UTC (11 years, 7 months ago) by degroote
Branch: MAIN
CVS Tags: thorpej-atomic-base, thorpej-atomic
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (unified)

Use ip4_ah_cleartos instead of ah_cleartos for consistency

Revision 1.29 / (download) - annotate - [select for diffs], Sun Mar 25 12:46:42 2007 UTC (11 years, 8 months ago) by degroote
Branch: MAIN
Changes since 1.28: +12 -9 lines
Diff to previous 1.28 (unified)

Make an exact match when we are looking for a cached sp for an unconnected
socket. If we don't make an exact match, we may use a cached rule which
has lower priority than a rule that would otherwise have matched the
packet.

Code submitted by Karl Knutsson in PR/36051

Revision 1.28 / (download) - annotate - [select for diffs], Sun Mar 4 21:17:54 2007 UTC (11 years, 8 months ago) by degroote
Branch: MAIN
Branch point for: vmlocking, reinoud-bufcleanup, mjf-ufs-trans
Changes since 1.27: +12 -12 lines
Diff to previous 1.27 (unified)

Remove useless cast
Use NULL instead of (void*) 0

Revision 1.27 / (download) - annotate - [select for diffs], Sun Mar 4 06:03:28 2007 UTC (11 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.26: +18 -18 lines
Diff to previous 1.26 (unified)

Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.26 / (download) - annotate - [select for diffs], Sat Feb 10 09:43:05 2007 UTC (11 years, 9 months ago) by degroote
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Branch point for: yamt-idlelwp
Changes since 1.25: +215 -58 lines
Diff to previous 1.25 (unified)

Commit my SoC work
Add ipv6 support for fast_ipsec
Note that currently, packet with extensions headers are not correctly
supported
Change the ipcomp logic

Revision 1.25 / (download) - annotate - [select for diffs], Thu Nov 16 01:33:49 2006 UTC (12 years ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, post-newlock2-merge, newlock2-nbase, newlock2-base, netbsd-4-base
Branch point for: netbsd-4
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (unified)

__unused removal on arguments; approved by core.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Oct 13 20:53:59 2006 UTC (12 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.23: +9 -8 lines
Diff to previous 1.23 (unified)

more __unused

Revision 1.23 / (download) - annotate - [select for diffs], Sat Jun 10 11:30:37 2006 UTC (12 years, 5 months ago) by kardel
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, yamt-pdpolicy-base6, rpaulo-netinet-merge-pcb-base, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.22: +1 -1 lines
Diff to previous 1.22 (unified)

reference time.tv_sec in non timecounter case
missing conversion spotted by Geoff Wing
XXX This code need to be checked whether UTC time
is really the right abstraction. I suspect uptime
would be the correct time scale for measuring life times.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Jun 10 11:12:09 2006 UTC (12 years, 5 months ago) by kardel
Branch: MAIN
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (unified)

fix a missing conversion for a mono_time reference.
detected by Geoff Wing.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Apr 11 20:21:28 2006 UTC (12 years, 7 months ago) by rpaulo
Branch: MAIN
CVS Tags: yamt-pdpolicy-base5, simonb-timecounters-base, elad-kernelauth-base
Branch point for: chap-midi
Changes since 1.20: +18 -2 lines
Diff to previous 1.20 (unified)

Add two new sysctls protected under IPSEC_DEBUG:

  net.inet.ipsec.test_replay - When set to 1, IPsec will send packets with
          the same sequence number. This allows to verify if the other side
          has proper replay attacks detection.

  net.inet.ipsec.test_integrity - When set 1, IPsec will send packets with
          corrupted HMAC. This allows to verify if the other side properly
          detects modified packets.

(a message will be printed indicating when these sysctls changed)

By Pawel Jakub Dawidek <pjd@FreeBSD.org>.
Discussed with Christos Zoulas and Jonathan Stone.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Feb 25 02:28:58 2006 UTC (12 years, 8 months ago) by wiz
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, peter-altq, elad-kernelauth
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (unified)

Fix some typos.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Dec 11 12:25:05 2005 UTC (12 years, 11 months ago) by christos
Branch: MAIN
Branch point for: yamt-uio_vmspace, simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (unified)

merge ktrace-lwp.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Oct 5 12:59:24 2005 UTC (13 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (unified)

PR/31478: YOMURA Masanori: Inconsistent default value of net.inet.ipsec.dfbit
Changed to match netinet6 (0->2)

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jun 10 13:22:42 2005 UTC (13 years, 5 months ago) by christos
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (unified)

constify and unshadow.

Revision 1.16 / (download) - annotate - [select for diffs], Sun May 8 18:44:40 2005 UTC (13 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.15: +8 -9 lines
Diff to previous 1.15 (unified)

Panic strings should not end with \n.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Feb 26 22:45:13 2005 UTC (13 years, 8 months ago) by perry
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, kent-audio2-base
Branch point for: netbsd-3-1, netbsd-3-0, netbsd-3
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (unified)

nuke trailing whitespace

Revision 1.14 / (download) - annotate - [select for diffs], Wed Oct 27 23:10:13 2004 UTC (14 years ago) by jonathan
Branch: MAIN
CVS Tags: yamt-km-base2, yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Changes since 1.13: +3 -2 lines
Diff to previous 1.13 (unified)

Fix missing break; Emmanuel Dreyfus.

C.f. sys/netinet6/ipsec.c rev 1.97 -> 1.98, but does not include the
gratutious change for a case which (the comment says) should not occur.

Revision 1.13 / (download) - annotate - [select for diffs], Fri May 7 00:55:14 2004 UTC (14 years, 6 months ago) by jonathan
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.12: +12 -2 lines
Diff to previous 1.12 (unified)

Redo net.inet.* sysctl subtree for fast-ipsec from scratch.
Attach FAST-IPSEC statistics with 64-bit counters to new sysctl MIB.
Rework netstat to show FAST_IPSEC statistics, via sysctl,  for
netstat -p ipsec.

New kernel files:
	sys/netipsec/Makefile		(new file; install *_var.h includes)
	sys/netipsec/ipsec_var.h	(new 64-bit mib counter struct)

Changed kernel files:
	sys/Makefile			(recurse into sys/netipsec/)
	sys/netinet/in.h		(fake IP_PROTO name for fast_ipsec
					sysctl subtree.)
	sys/netipsec/ipsec.h		(minimal userspace inclusion)
	sys/netipsec/ipsec_osdep.h	(minimal userspace inclusion)
	sys/netipsec/ipsec_netbsd.c	(redo sysctl subtree from scratch)
	sys/netipsec/key*.c		(fix broken net.key subtree)

	sys/netipsec/ah_var.h		(increase all counters to 64 bits)
	sys/netipsec/esp_var.h		(increase all counters to 64 bits)
	sys/netipsec/ipip_var.h		(increase all counters to 64 bits)
	sys/netipsec/ipcomp_var.h	(increase all counters to 64 bits)

	sys/netipsec/ipsec.c		(add #include netipsec/ipsec_var.h)
	sys/netipsec/ipsec_mbuf.c	(add #include netipsec/ipsec_var.h)
	sys/netipsec/ipsec_output.c	(add #include netipsec/ipsec_var.h)

	sys/netinet/raw_ip.c		(add #include netipsec/ipsec_var.h)
	sys/netinet/tcp_input.c		(add #include netipsec/ipsec_var.h)
	sys/netinet/udp_usrreq.c	(add #include netipsec/ipsec_var.h)

Changes to usr.bin/netstat to print the new fast-ipsec sysctl tree
for "netstat -s -p ipsec":

New file:
	usr.bin/netstat/fast_ipsec.c	(print fast-ipsec counters)

Changed files:
	usr.bin/netstat/Makefile	(add fast_ipsec.c)
	usr.bin/netstat/netstat.h	(declarations for fast_ipsec.c)
	usr.bin/netstat/main.c		(call KAME-vs-fast-ipsec dispatcher)

Revision 1.12 / (download) - annotate - [select for diffs], Sun Apr 25 22:25:03 2004 UTC (14 years, 6 months ago) by jonathan
Branch: MAIN
Changes since 1.11: +5 -2 lines
Diff to previous 1.11 (unified)

Initial commit of a port of the FreeBSD implementation of RFC 2385
(MD5 signatures for TCP, as used with BGP).  Credit for original
FreeBSD code goes to Bruce M. Simpson, with FreeBSD sponsorship
credited to sentex.net.  Shortening of the setsockopt() name
attributed to Vincent Jardin.

This commit is a minimal, working version of the FreeBSD code, as
MFC'ed to FreeBSD-4. It has received minimal testing with a ttcp
modified to set the TCP-MD5 option; BMS's additions to tcpdump-current
(tcpdump -M) confirm that the MD5 signatures are correct.  Committed
as-is for further testing between a NetBSD BGP speaker (e.g., quagga)
and industry-standard BGP speakers (e.g., Cisco, Juniper).


NOTE: This version has two potential flaws. First, I do see any code
that verifies recieved TCP-MD5 signatures.  Second, the TCP-MD5
options are internally padded and assumed to be 32-bit aligned. A more
space-efficient scheme is to pack all TCP options densely (and
possibly unaligned) into the TCP header ; then do one final padding to
a 4-byte boundary.  Pre-existing comments note that accounting for
TCP-option space when we add SACK is yet to be done. For now, I'm
punting on that; we can solve it properly, in a way that will handle
SACK blocks, as a separate exercise.

In case a pullup to NetBSD-2 is requested, this adds sys/netipsec/xform_tcp.c
,and modifies:

sys/net/pfkeyv2.h,v 1.15
sys/netinet/files.netinet,v 1.5
sys/netinet/ip.h,v 1.25
sys/netinet/tcp.h,v 1.15
sys/netinet/tcp_input.c,v 1.200
sys/netinet/tcp_output.c,v 1.109
sys/netinet/tcp_subr.c,v 1.165
sys/netinet/tcp_usrreq.c,v 1.89
sys/netinet/tcp_var.h,v 1.109
sys/netipsec/files.netipsec,v 1.3
sys/netipsec/ipsec.c,v 1.11
sys/netipsec/ipsec.h,v 1.7
sys/netipsec/key.c,v 1.11
share/man/man4/tcp.4,v 1.16
lib/libipsec/pfkey.c,v 1.20
lib/libipsec/pfkey_dump.c,v 1.17
lib/libipsec/policy_token.l,v 1.8
sbin/setkey/parse.y,v 1.14
sbin/setkey/setkey.8,v 1.27
sbin/setkey/token.l,v 1.15

Note that the preceding two revisions to tcp.4 will be
required to cleanly apply this diff.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Apr 21 18:40:41 2004 UTC (14 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (unified)

kill sprintf, use snprintf

Revision 1.10 / (download) - annotate - [select for diffs], Tue Mar 2 02:24:02 2004 UTC (14 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.9: +2 -5 lines
Diff to previous 1.9 (unified)

Remove some left-over debugging code.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Mar 2 02:22:56 2004 UTC (14 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.8: +197 -3 lines
Diff to previous 1.8 (unified)

Bring the PCB policy cache over from KAME IPsec, including the "hint"
used to short-circuit IPsec processing in other places.

This is enabled only for NetBSD at the moment; in order for it to function
correctly, ipsec_pcbconn() must be called as appropriate.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Mar 2 00:50:57 2004 UTC (14 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (unified)

iipsec4_get_ulp(): Fix a reversed test that would have caused us to access
bogus IP header data if presented with a short mbuf.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Feb 24 15:12:52 2004 UTC (14 years, 8 months ago) by wiz
Branch: MAIN
Changes since 1.6: +5 -5 lines
Diff to previous 1.6 (unified)

occured -> occurred. From Peter Postma.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jan 28 01:35:31 2004 UTC (14 years, 9 months ago) by jonathan
Branch: MAIN
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (unified)

Change #endif __FreeBSD__ to #endif /* __FreeBSD__ */

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jan 20 22:55:14 2004 UTC (14 years, 10 months ago) by jonathan
Branch: MAIN
Changes since 1.4: +49 -23 lines
Diff to previous 1.4 (unified)

IPv6 mapped adddresses require us to cope with limited polymorphism
(struct in6pcb* versus struct inpcb*) in ipsec_getpolicybysock().

Add new macros (in lieu of an abstract data type) for a ``generic''
PCB_T (points to a struct inpcb* or struct in6pcb*) to ipsec_osdep.h.
Use those new macros in ipsec_getpolicybysock() and elsewhere.

As posted to tech-net for comment/feedback, late  2003.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Oct 6 22:05:15 2003 UTC (15 years, 1 month ago) by tls
Branch: MAIN
Changes since 1.3: +4 -4 lines
Diff to previous 1.3 (unified)

Reversion of "netkey merge", part 2 (replacement of removed files in the
repository by christos was part 1).  netipsec should now be back as it
was on 2003-09-11, with some very minor changes:

1) Some residual platform-dependent code was moved from ipsec.h to
   ipsec_osdep.h; without this, IPSEC_ASSERT() was multiply defined.  ipsec.h
   now includes ipsec_osdep.h

2) itojun's renaming of netipsec/files.ipsec to netipsec/files.netipsec has
   been left in place (it's arguable which name is less confusing but the
   rename is pretty harmless).

3) Some #endif TOKEN has been replaced by #endif /* TOKEN */; #endif TOKEN
   is invalid and GCC 3 won't compile it.

An i386 kernel with "options FAST_IPSEC" and "options OPENCRYPTO" now
gets through "make depend" but fails to build with errors in ip_input.c.
But it's better than it was (thank heaven for small favors).

Revision 1.3 / (download) - annotate - [select for diffs], Fri Sep 12 11:20:58 2003 UTC (15 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.2: +5 -5 lines
Diff to previous 1.2 (unified)

merge netipsec/key* into netkey/key*.  no need for both.
change confusing filename

Revision 1.2 / (download) - annotate - [select for diffs], Wed Aug 20 22:33:40 2003 UTC (15 years, 3 months ago) by jonathan
Branch: MAIN
Changes since 1.1: +4 -2 lines
Diff to previous 1.1 (unified)

opt_inet6.h is FreeBSD-specific, so wrap it with #ifdef __FreeBSD__/#endif.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Aug 13 20:06:50 2003 UTC (15 years, 3 months ago) by jonathan
Branch: MAIN

Initial import of Sam Leffler's `Fast-IPsec' from FreeBSD 4.
Fast-IPsec is a rework of the OpenBSD and KAME IPsec code, using the
OpenCryptoFramework (and thus hardware crypto accelerators) and
numerous detailed performance improvements.

This import is (aside from SPL-level names) the FreeBSD source,
imported ``as-is'' as a historical snapshot, for future maintenance
and comparison against the FreeBSD source.  For now, several minor
kernel-API differences are hidden by macros a shim file, ipsec_osdep.h,
which (aside from SPL names) can be targeted at either NetBSD or FreeBSD.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>