diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2018-10-22 12:24:05 +0200 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2018-10-23 09:44:45 +0300 |
commit | 7103ae4d8b24b171f5321894a9bb045d018f0f40 (patch) | |
tree | 56957d744295ad7571da10676a7db6549b3e7f4a /accel-pppd/extra/pppd_compat.c | |
parent | 938bad250baa7bd6f0761e70ce68a2de063c528c (diff) | |
download | accel-ppp-7103ae4d8b24b171f5321894a9bb045d018f0f40.tar.gz accel-ppp-7103ae4d8b24b171f5321894a9bb045d018f0f40.zip |
ipv6: fix IPv6 processing of sessions that only have only a link-local address
Several modules assume that if ses->ipv6 is set, then
ses->ipv6->addr_list contains at least one element. But this is not
true if ipv6 was allocated by the pseudo ipdb backend of ipv6cp
(ipv6cp_opt_intfid.c). That is, if the PPP session only has an
automatic link-local address.
This leads modules like pppd-compat and dhcpv6 to access invalid memory
when trying to retrieve the IPv6 address of a PPP session.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/extra/pppd_compat.c')
-rw-r--r-- | accel-pppd/extra/pppd_compat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c index 318327e8..7c23eca0 100644 --- a/accel-pppd/extra/pppd_compat.c +++ b/accel-pppd/extra/pppd_compat.c @@ -622,7 +622,7 @@ static void fill_env(char **env, char *mem, struct pppd_compat_pd *pd) mem += write_sz + 1; ++n; - if (ses->ipv6) { + if (ses->ipv6 && !list_empty(&ses->ipv6->addr_list)) { ///FIXME only first address is passed to env struct ipv6db_addr_t *a = list_first_entry(&ses->ipv6->addr_list, typeof(*a), entry); |