From 4cca16f20e92a97399d5814fc810af66ce0581d8 Mon Sep 17 00:00:00 2001 From: shemminger Date: Fri, 10 Mar 2006 23:31:46 +0000 Subject: [PATCH] Fix endless loop in netlink error handling. --- ChangeLog | 6 +++++- lib/libnetlink.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0b4d158a..49a1e9cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,12 @@ +2006-03-10 Jean Tourrilhes + + * Fix endless loop in netlink error handling + 2006-03-10 Russell Stuart * Fix missing memset in tc sample -2006-03-10 shemminger +2006-03-10 Stephen Hemminger * Change default lnstat count to 1 * Update to 2.6.16 headers diff --git a/lib/libnetlink.c b/lib/libnetlink.c index 24e1f0b6..67951fe7 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -308,6 +308,9 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer, if (err < 0) return err; } + /* Don't forget to skip that message. */ + status -= NLMSG_ALIGN(len); + h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len)); continue; }