-----Ursprüngliche Nachricht-----
Von: Richard Cochran [mailto:[email protected]] 
Gesendet: Sonntag, 31. Juli 2016 23:49
An: [email protected]
Cc: Jesuiter, Henry (ALC NetworX GmbH) <[email protected]>
Betreff: [PATCH RFC 7/7] clock: Monitor the link status using a RT netlink 
socket.

@@ -1194,9 +1222,12 @@ static int clock_resize_pollfd(struct clock *c, int 
new_nports)
 {
        struct pollfd *new_pollfd;
 
-       /* Need to allocate one extra block of fds for uds */
+       /*
+        * Need to allocate one descriptor for RT netlink and one
+        * whole extra block of fds for UDS.
+        */
        new_pollfd = realloc(c->pollfd,
-                            (new_nports + 1) * N_CLOCK_PFD *
+                            1 + (new_nports + 1) * N_CLOCK_PFD *
                             sizeof(struct pollfd));

---

Hi,

sorry for the late answer, but I was in vacation last week.  

After trying out your patches, I've only one thing to mention.
Since you are using c->pollfd[0] for the netlink fd, the pollfd
resize() should use 'sizeof(struct pollfd)' instead of '1' for this 
descriptor. Otherwise, you will get some memory corruption.

Best regards
Henry


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to