[PATCH] Netlink: fix segfault on debug
From: Arthur Gautier <baloo@gandi.net> When enabling debug on netlink, the message formating will segfault in net_format(). From my understanding %N expects a pointer --- sysdep/linux/netlink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index 84591eb2ec488..36dc6f4e7b5f8 100644 --- a/sysdep/linux/netlink.c +++ b/sysdep/linux/netlink.c @@ -953,7 +953,7 @@ nl_parse_addr4(struct ifaddrmsg *i, int scan, int new) DBG("KIF: IF%d(%s): %s IPA %I, flg %x, net %N, brd %I, opp %I\n", ifi->index, ifi->name, new ? "added" : "removed", - ifa.ip, ifa.flags, ifa.prefix, ifa.brd, ifa.opposite); + ifa.ip, ifa.flags, &ifa.prefix, ifa.brd, ifa.opposite); if (new) ifa_update(&ifa); @@ -1045,7 +1045,7 @@ nl_parse_addr6(struct ifaddrmsg *i, int scan, int new) DBG("KIF: IF%d(%s): %s IPA %I, flg %x, net %N, brd %I, opp %I\n", ifi->index, ifi->name, new ? "added" : "removed", - ifa.ip, ifa.flags, ifa.prefix, ifa.brd, ifa.opposite); + ifa.ip, ifa.flags, &ifa.prefix, ifa.brd, ifa.opposite); if (new) ifa_update(&ifa); @@ -1525,7 +1525,7 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h) /* Do we know this table? */ p = HASH_FIND(nl_table_map, RTH, i->rtm_family, table_id); if (!p) - SKIP("unknown table %d\n", table); + SKIP("unknown table %d\n", table_id); if (a[RTA_SRC] && (p->p.net_type != NET_IP6_SADR)) SKIP("src prefix for non-SADR channel\n"); -- 2.20.1
On Thu, Dec 27, 2018 at 02:03:34PM +0000, baloo@gandi.net wrote:
From: Arthur Gautier <baloo@gandi.net>
When enabling debug on netlink, the message formating will segfault in net_format(). From my understanding %N expects a pointer
Thanks, merged. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@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."
participants (2)
-
balooï¼ gandi.net -
Ondrej Zajicek