NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/59070: net.ipsecif.use_fixed_reqid=1's behaviour



>Number:         59070
>Category:       kern
>Synopsis:       net.ipsecif.use_fixed_reqid=1's behaviour
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 11 19:40:01 +0000 2025
>Originator:     Andrew Cagney
>Release:        10.1
>Organization:
>Environment:
# uname -a
NetBSD rise 10.1 NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64

>Description:
An ipsec interface with net.ipsecif.use_fixed_reqid=0 and "no IPv6" gets assigned sequentially vis:

# sysctl -w net.ipsecif.use_fixed_reqid=0 ; ifconfig ipsec1 create ; ifconfig ipsec1 -link2 ; ifconfig ipsec1 inet tunnel 198.18.1.12 198.18.1.15 ; ifconfig ipsec1 inet 198.18.12.12/24 198.18.15.15 ; setkey -PD
net.ipsecif.use_fixed_reqid: 0 -> 0
198.18.1.15[any] 198.18.1.12[any] 4(ipv4)
	in ipsec
	esp/transport//unique#16389
	spid=17 seq=3 pid=947
	refcnt=0
198.18.1.15[any] 198.18.1.12[any] 41(ipv6)
	in discard
	spid=19 seq=2 pid=947
	refcnt=0
198.18.1.12[any] 198.18.1.15[any] 4(ipv4)
	out ipsec
	esp/transport//unique#16390
	spid=18 seq=1 pid=947
	refcnt=0
198.18.1.12[any] 198.18.1.15[any] 41(ipv6)
	out discard
	spid=20 seq=0 pid=947
	refcnt=0

same for an ipsec interface with IPv6:

# sysctl -w net.ipsecif.use_fixed_reqid=0 ; ifconfig ipsec1 create ; ifconfig ipsec1 inet tunnel 198.18.1.12 198.18.1.15 ; ifconfig ipsec1 inet 198.18.12.12/24 198.18.15.15 ; setkey -PD
net.ipsecif.use_fixed_reqid: 0 -> 0
198.18.1.15[any] 198.18.1.12[any] 4(ipv4)
	in ipsec
	esp/transport//unique#16393
	spid=21 seq=3 pid=1597
	refcnt=0
198.18.1.15[any] 198.18.1.12[any] 41(ipv6)
	in ipsec
	esp/transport//unique#16395
	spid=23 seq=2 pid=1597
	refcnt=0
198.18.1.12[any] 198.18.1.15[any] 4(ipv4)
	out ipsec
	esp/transport//unique#16394
	spid=22 seq=1 pid=1597
	refcnt=0
198.18.1.12[any] 198.18.1.15[any] 41(ipv6)
	out ipsec
	esp/transport//unique#16396
	spid=24 seq=0 pid=1597
	refcnt=0

however, when I flip net.ipsecif.use_fixed_reqid=1, things get interesting.

With no IPv6, it assigns 8194 for both inbound and outbound:

# sysctl -w net.ipsecif.use_fixed_reqid=1 ; ifconfig ipsec1 create ; ifconfig ipsec1 -link2 ; ifconfig ipsec1 inet tunnel 198.18.1.12 198.18.1.15 ; ifconfig ipsec1 inet 198.18.12.12/24 198.18.15.15 ; setkey -PD
net.ipsecif.use_fixed_reqid: 1 -> 1
198.18.1.15[any] 198.18.1.12[any] 4(ipv4)
	in ipsec
	esp/transport//unique:8194
	spid=29 seq=3 pid=550
	refcnt=0
198.18.1.15[any] 198.18.1.12[any] 41(ipv6)
	in discard
	spid=31 seq=2 pid=550
	refcnt=0
198.18.1.12[any] 198.18.1.15[any] 4(ipv4)
	out ipsec
	esp/transport//unique:8194
	spid=30 seq=1 pid=550
	refcnt=0
198.18.1.12[any] 198.18.1.15[any] 41(ipv6)
	out discard
	spid=32 seq=0 pid=550
	refcnt=0

and with IPv6, its 8194 for IPv4 and 8195 for IPv6:

# sysctl -w net.ipsecif.use_fixed_reqid=1 ; ifconfig ipsec1 create ; ifconfig ipsec1 inet tunnel 198.18.1.12 198.18.1.15 ; ifconfig ipsec1 inet 198.18.12.12/24 198.18.15.15 ; setkey -PD
net.ipsecif.use_fixed_reqid: 0 -> 1
198.18.1.15[any] 198.18.1.12[any] 4(ipv4)
	in ipsec
	esp/transport//unique:8194
	spid=25 seq=3 pid=1279
	refcnt=0
198.18.1.15[any] 198.18.1.12[any] 41(ipv6)
	in ipsec
	esp/transport//unique:8195
	spid=27 seq=2 pid=1279
	refcnt=0
198.18.1.12[any] 198.18.1.15[any] 4(ipv4)
	out ipsec
	esp/transport//unique:8194
	spid=26 seq=1 pid=1279
	refcnt=0
198.18.1.12[any] 198.18.1.15[any] 41(ipv6)
	out ipsec
	esp/transport//unique:8195
	spid=28 seq=0 pid=1279
	refcnt=0

I can't find anything documenting this.
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index