[Babel-users] Babeld news

Dave Taht dave.taht at gmail.com
Thu Oct 25 19:53:41 BST 2018


I see there's been some activity on the  rfc6126bis branch which I'll
go test this weekend. Yea! (did anyone duplicate my ifup/ifdown bug?

I have no "urgent" fixes for babel, but I do have a few small, useful
cleanup patches I think you might accept after more stuff is merged
up.

babeld-janitorial/0001-Eliminate-8-byte-hole-in-the-zone-struct-for-64-bit-.patch
babeld-janitorial/0002-eliminate-set_src_prefix.patch # unused function call
babeld-janitorial/0003-log-late-hellos.patch
babeld-janitorial/0004-mv-plen-below-src_prefix-for-better-alignment.patch

The last I figure is controversial, but - the default layout of all
the babel structures
forces an unaligned memcmp a lot:

diff --git a/resend.h b/resend.h
index 05e182c..d1e0a7e 100644
--- a/resend.h
+++ b/resend.h
@@ -32,8 +32,8 @@ struct resend {
     unsigned short delay;
     struct timeval time;
     unsigned char prefix[16];
-    unsigned char plen;
     unsigned char src_prefix[16];
+    unsigned char plen;
     unsigned char src_plen;
     unsigned short seqno;
     unsigned char id[8];

In terms of "big changes"... well, throughout the code there's stuff
like this which has
an aging code smell to it, and makes it hard to (for example) come up
with a universal
mechanism better than a linked list to store these critical params,
and/or reduce the
register impact on the function call ABI. There's plenty of calls with
more stuff that overwhelms the x86_64 abi than this...

struct resend *find_request(const unsigned char *prefix, unsigned char plen,
                    const unsigned char *src_prefix, unsigned char src_plen,
                    struct resend **previous_return);


Instead, sort of influenced by the existing "zone" structure:

struct babel_addrs { // could use a better name
     unsigned char src_prefix[16]
     unsigned char prefix[16];
     unsigned char src_plen;
     unsigned char plen;
     unsigned short nexthop; // an index, not a ptr, into the nexthop
table, sometimes unused
};

struct resend *find_request(const struct babel_addrs *, struct resend
**previous_return);

A refactor of this magnitude is a huge PITA (I did it once, with a
bunch of sed scripts, some regexes, and semantic in emacs. I still
have the sed scrips around somewhere), and given how futile and
useless my last attempt at a refactor for memcmp was, I figure this is
not in the cards... but I do think it would make it easier to move the
code forward to smarter structures overall.



More information about the Babel-users mailing list