[PATCH 0/3] babel: Add compression and support for subtlvs

Ondrej Zajicek santiago at crfreenet.org
Tue Jun 6 12:09:03 CEST 2017


On Mon, Jun 05, 2017 at 11:49:51PM +0200, Toke Høiland-Jørgensen wrote:
> This patch series adds compression of outgoing IPv6 prefixes to the
> Babel protocol, and also adds support to the parser for parsing subtlvs
> as per RFC6126 bis (see
> https://tools.ietf.org/html/draft-ietf-babel-rfc6126bis-02#section-4.4).

Hi

The subtlv parser looks OK. W.r.t. prefix compression i would prefer if
it would be done in the same manner as in the other direction (parsing),
i.e. having u8 def_ip6_prefix[16] in network order in babel_write_state
and using a memcmp()-like function that returns first differing byte
instead of using ip6_common_octets().

+      omit = MIN(omit,
+                MIN(tlv->plen, net6_pxlen(&state->def_ip6_prefix)) / 8);

Note that MIN() is a macro that expands its arguments two times, so it is
not a good idea to nest them.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."



More information about the Bird-users mailing list