[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 49/64: pfinet: make the demuxers payload-aware
From: |
Samuel Thibault |
Subject: |
[hurd] 49/64: pfinet: make the demuxers payload-aware |
Date: |
Wed, 10 Dec 2014 15:17:07 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 2514b693920124eb47eb48f50f07b179bc5090e9
Author: Justus Winter <address@hidden>
Date: Sun Apr 13 14:03:48 2014 +0200
pfinet: make the demuxers payload-aware
* pfinet/ethernet.c (ethernet_demuxer): Make the demuxer payload-aware.
* pfinet/main.c (pfinet_demuxer): Likewise.
---
pfinet/ethernet.c | 20 +++++++++++++++++++-
pfinet/main.c | 12 ++++++++++--
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/pfinet/ethernet.c b/pfinet/ethernet.c
index 053fd1b..1678243 100644
--- a/pfinet/ethernet.c
+++ b/pfinet/ethernet.c
@@ -116,12 +116,30 @@ ethernet_demuxer (mach_msg_header_t *inp,
int datalen;
struct ether_device *edev;
struct device *dev = 0;
+ mach_port_t local_port;
if (inp->msgh_id != NET_RCV_MSG_ID)
return 0;
+ if (MACH_MSGH_BITS_LOCAL (inp->msgh_bits) ==
+ MACH_MSG_TYPE_PROTECTED_PAYLOAD)
+ {
+ struct port_info *pi = ports_lookup_payload (NULL,
+ inp->msgh_protected_payload,
+ NULL);
+ if (pi)
+ {
+ local_port = pi->port_right;
+ ports_port_deref (pi);
+ }
+ else
+ local_port = MACH_PORT_NULL;
+ }
+ else
+ local_port = inp->msgh_local_port;
+
for (edev = ether_dev; edev; edev = edev->next)
- if (inp->msgh_local_port == edev->readptname)
+ if (local_port == edev->readptname)
dev = &edev->dev;
if (! dev)
diff --git a/pfinet/main.c b/pfinet/main.c
index 0f1fbfc..8716fdb 100644
--- a/pfinet/main.c
+++ b/pfinet/main.c
@@ -86,8 +86,16 @@ pfinet_demuxer (mach_msg_header_t *inp,
/* We have several classes in one bucket, which need to be demuxed
differently. */
- pi = ports_lookup_port(pfinet_bucket, inp->msgh_local_port,
socketport_class);
-
+ if (MACH_MSGH_BITS_LOCAL (inp->msgh_bits) ==
+ MACH_MSG_TYPE_PROTECTED_PAYLOAD)
+ pi = ports_lookup_payload (pfinet_bucket,
+ inp->msgh_protected_payload,
+ socketport_class);
+ else
+ pi = ports_lookup_port (pfinet_bucket,
+ inp->msgh_local_port,
+ socketport_class);
+
if (pi)
{
ports_port_deref (pi);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 39/64: libdiskfs: add payload-aware intrans functions, (continued)
- [hurd] 39/64: libdiskfs: add payload-aware intrans functions, Samuel Thibault, 2014/12/10
- [hurd] 18/64: startup: be more specific in the shutdown message, Samuel Thibault, 2014/12/10
- [hurd] 42/64: libpager: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 19/64: startup: fix the declaration of the *_server functions, Samuel Thibault, 2014/12/10
- [hurd] 43/64: libcons: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 46/64: console-client: make the demuxer payload-aware, Samuel Thibault, 2014/12/10
- [hurd] 41/64: libtrivfs: add payload-aware intrans functions, Samuel Thibault, 2014/12/10
- [hurd] 20/64: startup: bind the startup server to /servers/startup, Samuel Thibault, 2014/12/10
- [hurd] 28/64: boot: implement pseudo-time device, Samuel Thibault, 2014/12/10
- [hurd] 47/64: exec: add payload-aware intrans functions, Samuel Thibault, 2014/12/10
- [hurd] 49/64: pfinet: make the demuxers payload-aware,
Samuel Thibault <=
- [hurd] 50/64: pflocal: add payload-aware intrans functions, Samuel Thibault, 2014/12/10
- [hurd] 48/64: pfinet: add payload-aware intrans functions, Samuel Thibault, 2014/12/10
- [hurd] 51/64: proc: add payload-aware intrans functions, Samuel Thibault, 2014/12/10
- [hurd] 24/64: boot: drop bootstrap compat code, Samuel Thibault, 2014/12/10
- [hurd] 52/64: startup: disable default payload to port mapping, Samuel Thibault, 2014/12/10
- [hurd] 55/64: trans/ifsock: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 27/64: boot: support ds_device_get_status with flavor DEV_GET_RECORDS, Samuel Thibault, 2014/12/10
- [hurd] 35/64: libshouldbeinlibc: move the reference counting primitives here, Samuel Thibault, 2014/12/10
- [hurd] 56/64: trans/password: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 36/64: Fix coding style, Samuel Thibault, 2014/12/10