]> git.ozlabs.org Git - ppp.git/commit
pppd: Set local and remote IPv6 addresses by one call
authorPali Rohár <pali@kernel.org>
Sun, 10 Jan 2021 18:46:07 +0000 (19:46 +0100)
committerPali Rohár <pali@kernel.org>
Mon, 15 Feb 2021 22:37:32 +0000 (23:37 +0100)
commit44404e38ed984b12df453bf39c3a39dd0d336d23
treeb16f85d04cd713396500193ecadc3940e2935f51
parent5d97adda1862153e29f918b58a36831b2e038f9b
pppd: Set local and remote IPv6 addresses by one call

Currently local IPv6 address is set by SIOCSIFADDR ioctl and remote peer
address is appended by rtnetlink RTM_NEWADDR/NLM_F_REPLACE call. For
RTM_NEWADDR/NLM_F_REPLACE call it is needed to specify both local + remote
addresses as local address is used for matching to which address needs to
be remote peer address appended. When issuing this call kernel first
removes currently configured local address and then inserts a new pair of
local + remote addresses.

Simplify whole setup by just one rtnetlink RTM_NEWADDR/NLM_F_CREATE call by
inserting pair of local + remote addresses atomically. Therefore calling
SIOCSIFADDR ioctl for local IPv6 address is not used or needed anymore.

Signed-off-by: Pali Rohár <pali@kernel.org>
pppd/sys-linux.c