Commit Graph

17 Commits

Author SHA1 Message Date
knakahara
dc759cc87f fix: l2tp(4) cannot receive packets after reset session without reset tunnel. Pointed out by k-goda@IIJ
When the following operations are done after established session, the l2tp0
cannot receive packets until done deletetunnel && tunnel "src" "dst".
====================
ifconfig l2tp0 deletesession
ifconfig l2tp0 deletecookie
ifconfig l2tp0 session 200 100
====================

XXX pullup-8
2018-09-03 02:33:30 +00:00
knakahara
a1b205bf0e sbappendaddr() is required any lock. Currently, softnet_lock is appropriate.
When rip_input() is called as inetsw[].pr_input, rip_iput() is always called
with holding softnet_lock, that is, in case of !defined(NET_MPSAFE) it is
acquired in ipintr(), otherwise(defined(NET_MPSAFE)) it is acquire in
PR_WRAP_INPUT macro.
However, some function calls rip_input() directly without holding softnet_lock.
That causes assertion failure in sbappendaddr().
rip6_input() and icmp6_rip6_input() are also required softnet_lock for the same
reason.
2018-06-21 10:37:49 +00:00
knakahara
b0c61d654b Fix LOCKDEBUG kernel panic when many(about 200) tunnel interfaces is created.
The tunnel interfaces are gif(4), l2tp(4), and ipsecif(4). They use mutex
itself in percpu area. When percpu_cpu_enlarge() run, the address of the
mutex in percpu area becomes different from the address which lockdebug
saved. That can cause "already initialized" false detection.
2018-04-27 09:55:27 +00:00
maxv
7bd67feaa8 Several fixes in L2TP:
* l2tp_input(): use m_copydata, and ensure there is enough space in the
   chain. Otherwise overflow.

 * l2tp_tcpmss_clamp(): ensure there is enough space in the chain.

 * in_l2tp_output(): don't check 'sc' against NULL, it can't be NULL.

 * in_l2tp_input(): no need to call m_pullup since we use m_copydata.
   Just check the space in the chain.

 * in_l2tp_input(): if there is a cookie, make sure the chain has enough
   space.

 * in6_l2tp_input(): same changes as in_l2tp_input().

Ok knakahara@
2018-01-26 07:49:15 +00:00
maxv
eb74a6f9ba Style, reduce the indentation level when possible, and add a missing NULL
check after M_PREPEND.
2018-01-25 10:45:58 +00:00
knakahara
decfa6a54a fix mbuf leaks. pointed out and suggested by kre@n.o, thanks. 2017-12-18 03:21:44 +00:00
knakahara
5a6bcc75c1 backout wrong fix again, sorry. 2017-12-18 03:20:12 +00:00
knakahara
38abdefc72 Fix pullup'ed mbuf leaks. The match function just requires enough mbuf length.
XXX need pullup-8
2017-12-15 05:01:16 +00:00
knakahara
ca9d7f2f69 backout wrong fix as it causes atf net/ipsec/t_ipsec_l2tp failures. 2017-12-15 04:58:31 +00:00
knakahara
e56a093de8 fix pullup'ed mbuf leaks. pointed out by maxv@n.o, thanks.
XXX need pullup-8
2017-12-11 02:17:35 +00:00
knakahara
fb23bb2cff Add argument to encapsw->pr_input() instead of m_tag. 2017-11-15 10:42:41 +00:00
knakahara
a431af6bf4 l2tp(4): fix mbuf leak when tunnel nested over the limit
XXX need pullup -8 branch
2017-07-11 05:03:45 +00:00
knakahara
685eeb51f1 fix module build 2017-04-04 23:49:17 +00:00
sevan
cb2085f041 Revert change to allow builds to continue until the missing vlan.h file is committed.
https://mail-index.netbsd.org/source-changes/2017/04/04/msg083283.html
2017-04-04 16:49:15 +00:00
knakahara
6f4f1b05e1 remove unnecessary if_vlanvar.h. add missing include "vlan.h".
pointed out by s-yamaguchi@IIJ, thanks.
2017-04-04 10:25:38 +00:00
knakahara
d35df4a96d remove duplicated validation. That is already done in l2tp_lookup_session_ref().
pointed out by s-yamaguchi@IIJ, thanks.
2017-03-30 23:13:54 +00:00
knakahara
706b73f634 add missing files. 2017-02-16 08:23:35 +00:00