summaryrefslogtreecommitdiffstats
path: root/net-dialup
diff options
context:
space:
mode:
authorRobert Gerus <arachnist@i.am-a.cat>2015-05-20 15:19:21 +0200
committerRobert Gerus <arachnist@i.am-a.cat>2015-05-20 15:19:21 +0200
commit8608de0b791921bc7348981a8f318ca932d59894 (patch)
tree6d908428bf0d1e7095ab608f072dff8de17e7e21 /net-dialup
parent50b38f75dc1a2391fb1c9fc85d1be174be7a4b96 (diff)
downloadgentoo-overlay-8608de0b791921bc7348981a8f318ca932d59894.tar.gz
gentoo-overlay-8608de0b791921bc7348981a8f318ca932d59894.tar.bz2
gentoo-overlay-8608de0b791921bc7348981a8f318ca932d59894.tar.xz
gentoo-overlay-8608de0b791921bc7348981a8f318ca932d59894.zip
Patch dhcp support in ppp for musl.
Diffstat (limited to 'net-dialup')
-rw-r--r--net-dialup/ppp/files/ppp-2.4.7-dhcp-musl.diff33
-rw-r--r--net-dialup/ppp/ppp-2.4.7-r1.ebuild5
2 files changed, 38 insertions, 0 deletions
diff --git a/net-dialup/ppp/files/ppp-2.4.7-dhcp-musl.diff b/net-dialup/ppp/files/ppp-2.4.7-dhcp-musl.diff
new file mode 100644
index 0000000..373000b
--- /dev/null
+++ b/net-dialup/ppp/files/ppp-2.4.7-dhcp-musl.diff
@@ -0,0 +1,33 @@
+diff -ur ppp-2.4.7.orig/pppd/plugins/dhcp/clientpacket.c ppp-2.4.7/pppd/plugins/dhcp/clientpacket.c
+--- ppp-2.4.7.orig/pppd/plugins/dhcp/clientpacket.c 2002-08-31 12:19:20.000000000 +0000
++++ ppp-2.4.7/pppd/plugins/dhcp/clientpacket.c 2015-05-20 13:14:45.329979828 +0000
+@@ -205,9 +205,9 @@
+
+ /* Make sure its the right packet for us, and that it passes sanity checks */
+ if (packet.ip.protocol != IPPROTO_UDP || packet.ip.version != IPVERSION ||
+- packet.ip.ihl != sizeof(packet.ip) >> 2 || packet.udp.dest != htons(CLIENT_PORT) ||
++ packet.ip.ihl != sizeof(packet.ip) >> 2 || packet.udp.uh_dport != htons(CLIENT_PORT) ||
+ bytes > (int) sizeof(struct udp_dhcp_packet) ||
+- ntohs(packet.udp.len) != (short) (bytes - sizeof(packet.ip))) {
++ ntohs(packet.udp.uh_ulen) != (short) (bytes - sizeof(packet.ip))) {
+ DEBUG(LOG_INFO, "unrelated/bogus packet");
+ return -1;
+ }
+@@ -223,14 +223,14 @@
+ /* verify the UDP checksum by replacing the header with a psuedo header */
+ source = packet.ip.saddr;
+ dest = packet.ip.daddr;
+- check = packet.udp.check;
+- packet.udp.check = 0;
++ check = packet.udp.uh_sum;
++ packet.udp.uh_sum = 0;
+ memset(&packet.ip, 0, sizeof(packet.ip));
+
+ packet.ip.protocol = IPPROTO_UDP;
+ packet.ip.saddr = source;
+ packet.ip.daddr = dest;
+- packet.ip.tot_len = packet.udp.len; /* cheat on the psuedo-header */
++ packet.ip.tot_len = packet.udp.uh_ulen; /* cheat on the psuedo-header */
+ if (check && check != checksum(&packet, bytes)) {
+ DEBUG(LOG_ERR, "packet with bad UDP checksum received, ignoring");
+ return -1;
diff --git a/net-dialup/ppp/ppp-2.4.7-r1.ebuild b/net-dialup/ppp/ppp-2.4.7-r1.ebuild
index 004c552..1e73eda 100644
--- a/net-dialup/ppp/ppp-2.4.7-r1.ebuild
+++ b/net-dialup/ppp/ppp-2.4.7-r1.ebuild
@@ -85,6 +85,11 @@ src_prepare() {
if use elibc_musl ; then
einfo "Conditionally patching for musl"
epatch "${FILESDIR}"/${P}-musl.diff
+
+ if use dhcp ; then
+ einfo "Conditionally patching dhcp support for musl"
+ epatch "${FILESDIR}"/${P}-dhcp-musl.diff
+ fi
fi
}