CVSROOT:        /cvs
Module name:    src
Changes by:     ren...@cvs.openbsd.org  2016/02/21 11:38:37

Modified files:
        usr.sbin/eigrpd: tlv.c 

Log message:
Make eigrpd work against newer IOS routers.

Different versions of IOS can use a different number of bytes to encode
the same IPv6 prefix inside route TLVs. This sucks but we have to deal
with it.  Instead of calculating the number of bytes based on the value
of the prefixlen field, let's get this number by subtracting the size
of all other fields from the total size of the TLV. It works because
all the other fields have a fixed length.

For reference, the EIGRP draft says that length of the prefix field
should be obtained according to this function:

((Bit Count - 1) / 8) + 1

But older IOS versions use this for IPv6 (obtained through reverse
engineering):

((Bit Count == 128) ? 16 : ((Bit Count / 8) + 1))

Now, the new IOS-XR apparently uses the first formula for both IPv4 and
IPv6. With this patch, eigrpd will work against both older and newer
versions of IOS.

Reply via email to