Page MenuHomeFreeBSD

Make if_enc and if_ipsec kernel modules loadable by ifconfig(8)
ClosedPublic

Authored by ae on May 6 2019, 8:08 AM.

Details

Summary

Currently we have ipsec.ko and if_enc.ko kernel modules, that contain cloners for if_ipsec(4) and if_enc(4) virtual interfaces. But ifconfig can not automatically load kernel modules, when user run ifconfig command.
The kernel has "enc" driver, and ifconfig refuses to load if_enc(4). I renamed "enc" to "ses". It seems there are no strong dependency from the name.
To be able create if_ipsec(4) interfaces, I added symlink if_ipsec.ko->ipsec.ko. And now it is possible to automatically load both if_enc and if_ipsec modules with ifconfig command.

Test Plan
# kldstat -v | egrep "ses|enc|ipsec"
		208 ipsec_support
		 20 ses
# ifconfig enc0
enc0: flags=0<> metric 0 mtu 1536
	groups: enc
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
# kldstat -v | egrep "ses|enc|ipsec"
		208 ipsec_support
		 20 ses
22    1 0xffffffff821c1000      b10 if_enc.ko (/boot/kernel/if_enc.ko)
		281 if_enc
# ifconfig ipsec0 create
# kldstat -v | egrep "ses|enc|ipsec"
		208 ipsec_support
		 20 ses
22    1 0xffffffff821c1000      b10 if_enc.ko (/boot/kernel/if_enc.ko)
		281 if_enc
23    1 0xffffffff821c2000     c8e0 if_ipsec.ko (/boot/kernel/if_ipsec.ko)
		283 ipsec

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ae created this revision.May 6 2019, 8:08 AM
gallatin accepted this revision.May 6 2019, 1:17 PM

Thank you!

This revision is now accepted and ready to land.May 6 2019, 1:17 PM
This revision was automatically updated to reflect the committed changes.