summaryrefslogtreecommitdiff
path: root/debian/patches/0013-pfinet-make-the-demuxers-payload-aware.patch
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-12-01 22:24:07 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-12-01 22:24:07 +0100
commit98436554dde9ed58ff56bc1f8b9afdebdec1fd53 (patch)
treee3cd1733a34d880c162f44a7e29c022f2cd1ff2d /debian/patches/0013-pfinet-make-the-demuxers-payload-aware.patch
parent127b9d289d134e1220f61d4face082981da4e68d (diff)
add patch series
Diffstat (limited to 'debian/patches/0013-pfinet-make-the-demuxers-payload-aware.patch')
-rw-r--r--debian/patches/0013-pfinet-make-the-demuxers-payload-aware.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/debian/patches/0013-pfinet-make-the-demuxers-payload-aware.patch b/debian/patches/0013-pfinet-make-the-demuxers-payload-aware.patch
new file mode 100644
index 00000000..9c531945
--- /dev/null
+++ b/debian/patches/0013-pfinet-make-the-demuxers-payload-aware.patch
@@ -0,0 +1,74 @@
+From 09be8ecd3a467ab1772f9fd533212afaefd1e814 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sun, 13 Apr 2014 14:03:48 +0200
+Subject: [PATCH hurd 13/27] 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);
+--
+2.1.3
+