Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Quagga: Dev
[PATCH] zebra: no need to clear memory of the netlink buffers
 

Index | Next | Previous | View Flat


jorge at dti2

Apr 20, 2012, 5:28 AM


Views: 111
Permalink
[PATCH] zebra: no need to clear memory of the netlink buffers

From: "Jorge Boncompte [DTI2]" <jorge [at] dti2>

- The memory it's always written before sending.

- This slows down considerably netlink_route_multipath() and it's pretty
noticeable in a full-internet table scenario loading.

Signed-off-by: Jorge Boncompte [DTI2] <jorge [at] dti2>
---
zebra/rt_netlink.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 5909131..15475e2 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1368,7 +1368,7 @@ netlink_route (int cmd, int family, void *dest, int length, void *gate,
char buf[NL_PKT_BUF_SIZE];
} req;

- memset (&req, 0, sizeof req);
+ memset (&req, 0, sizeof req - NL_PKT_BUF_SIZE);

bytelen = (family == AF_INET ? 4 : 16);

@@ -1443,7 +1443,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib,
char buf[NL_PKT_BUF_SIZE];
} req;

- memset (&req, 0, sizeof req);
+ memset (&req, 0, sizeof req - NL_PKT_BUF_SIZE);

bytelen = (family == AF_INET ? 4 : 16);

@@ -1903,7 +1903,7 @@ netlink_address (int cmd, int family, struct interface *ifp,
} req;

p = ifc->address;
- memset (&req, 0, sizeof req);
+ memset (&req, 0, sizeof req - NL_PKT_BUF_SIZE);

bytelen = (family == AF_INET ? 4 : 16);

--
1.7.8.3


_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev

Subject User Time
[PATCH] zebra: no need to clear memory of the netlink buffers jorge at dti2 Apr 20, 2012, 5:28 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.