From b20fb5d12c472bbc0648355805df6c379894180b Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Mon, 26 Feb 2018 16:45:08 +0200 Subject: nhrp-events: IPv6 support --- dmvpn.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'dmvpn.lua') diff --git a/dmvpn.lua b/dmvpn.lua index 82a9722..32419f8 100644 --- a/dmvpn.lua +++ b/dmvpn.lua @@ -21,12 +21,13 @@ local decoders={ end end, ['sbgp-ipAddrBlock']=function(d) - local res = {} + local res = {{}, {}} for _, ab in ipairs(rfc3779.IPAddrBlocks.decode(d)) do - if ab.ipAddressChoice and ab.ipAddressChoice.addressesOrRanges then + local afi = ab.addressFamily.afi + if res[afi] and ab.ipAddressChoice and ab.ipAddressChoice.addressesOrRanges then for _, a in ipairs(ab.ipAddressChoice.addressesOrRanges) do if a.addressPrefix then - table.insert(res, a.addressPrefix) + table.insert(res[afi], a.addressPrefix) end end end -- cgit v1.2.3