commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 01/03: libmachdev: fix net_rcv_msg-messages


From: Samuel Thibault
Subject: [hurd] 01/03: libmachdev: fix net_rcv_msg-messages
Date: Sun, 09 Nov 2014 11:04:57 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch dde
in repository hurd.

commit e363aa56321f652684ffed281030d95d365c53c0
Author: Justus Winter <address@hidden>
Date:   Tue Jun 10 11:42:23 2014 +0200

    libmachdev: fix net_rcv_msg-messages
    
    Previously, all net_rcv_msg-messages sent by netif_rx_handle were
    malformed.  It never was a problem in practice, since the messages are
    not complex and thus the kernel does not try to parse the message.
    
    struct net_rcv_msg contains an additional field of type
    boolean_t.  This field has no associated type descriptor, so it must
    not be included in the message.
    
    * libmachdev/net.c (netif_rx_handle): Account for the extra field in
    the msgh_size calculation.
---
 libmachdev/net.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libmachdev/net.c b/libmachdev/net.c
index 07bb74a..e04b558 100644
--- a/libmachdev/net.c
+++ b/libmachdev/net.c
@@ -243,8 +243,10 @@ netif_rx_handle (char *data, int len, struct net_device 
*dev)
 
   pack_size = len - sizeof (struct ethhdr);
   /* remember message sizes must be rounded up */
-  net_msg->msg_hdr.msgh_size = (((mach_msg_size_t) (sizeof(struct net_rcv_msg)
-                                              - NET_RCV_MAX + pack_size)) + 3) 
& ~3;
+  net_msg->msg_hdr.msgh_size =
+    (((mach_msg_size_t) (sizeof (struct net_rcv_msg)
+                        - sizeof net_msg->sent
+                        - NET_RCV_MAX + pack_size)) + 3) & ~3;
 
   /* Copy packet into message buffer.  */
   eh = (struct ether_header *) (net_msg->header);

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]