r4035 - in /packages/libnet-arp-perl/trunk/debian: changelog
patches/00list patches/10alignment-and-headers.dpatch
ntyni-guest at users.alioth.debian.org
ntyni-guest at users.alioth.debian.org
Thu Oct 5 18:42:13 UTC 2006
Author: ntyni-guest
Date: Thu Oct 5 18:42:13 2006
New Revision: 4035
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=4035
Log:
* debian/patches/10alignment-and-headers.dpatch:
- fix FTBFS due to unaligned assignment problems. (Closes: #390020)
- include all the needed header files.
Added:
packages/libnet-arp-perl/trunk/debian/patches/00list
packages/libnet-arp-perl/trunk/debian/patches/10alignment-and-headers.dpatch (with props)
Modified:
packages/libnet-arp-perl/trunk/debian/changelog
Modified: packages/libnet-arp-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-arp-perl/trunk/debian/changelog?rev=4035&op=diff
==============================================================================
--- packages/libnet-arp-perl/trunk/debian/changelog (original)
+++ packages/libnet-arp-perl/trunk/debian/changelog Thu Oct 5 18:42:13 2006
@@ -1,8 +1,11 @@
libnet-arp-perl (0.8-2) unstable; urgency=low
* Add dpatch framework.
+ * debian/patches/10alignment-and-headers.dpatch:
+ - fix FTBFS due to unaligned assignment problems. (Closes: #390020)
+ - include all the needed header files.
- -- Niko Tyni <ntyni at iki.fi> Thu, 5 Oct 2006 21:36:43 +0300
+ -- Niko Tyni <ntyni at iki.fi> Thu, 5 Oct 2006 21:40:31 +0300
libnet-arp-perl (0.8-1) unstable; urgency=low
Added: packages/libnet-arp-perl/trunk/debian/patches/00list
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-arp-perl/trunk/debian/patches/00list?rev=4035&op=file
==============================================================================
--- packages/libnet-arp-perl/trunk/debian/patches/00list (added)
+++ packages/libnet-arp-perl/trunk/debian/patches/00list Thu Oct 5 18:42:13 2006
@@ -1,0 +1,1 @@
+10alignment-and-headers.dpatch
Added: packages/libnet-arp-perl/trunk/debian/patches/10alignment-and-headers.dpatch
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libnet-arp-perl/trunk/debian/patches/10alignment-and-headers.dpatch?rev=4035&op=file
==============================================================================
--- packages/libnet-arp-perl/trunk/debian/patches/10alignment-and-headers.dpatch (added)
+++ packages/libnet-arp-perl/trunk/debian/patches/10alignment-and-headers.dpatch Thu Oct 5 18:42:13 2006
@@ -1,0 +1,100 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10alignment-and-headers.dpatch by Niko Tyni <ntyni at iki.fi>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix an unaligned assignment issue (#390020)
+## DP: Also include all the needed header files.
+
+ at DPATCH@
+diff -urNad trunk~/ARP.xs trunk/ARP.xs
+--- trunk~/ARP.xs 2006-10-05 21:34:38.000000000 +0300
++++ trunk/ARP.xs 2006-10-05 21:38:40.522608147 +0300
+@@ -27,6 +27,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <net/ethernet.h>
++#include <netinet/ether.h>
+ #include <net/if.h>
+ #include <arpa/inet.h>
+ #include "arp.h"
+@@ -44,11 +45,12 @@
+
+ CODE:
+ int uid;
+- unsigned int packetsize = sizeof(struct arphdr) + sizeof(struct ether_header);
++ unsigned int packetsize = sizeof(struct my_arphdr) + sizeof(struct ether_header);
+ unsigned char packet[packetsize];
+ struct ether_header *ethhdr = (struct ether_header *)packet;
+- struct arphdr *arp = (struct arphdr *)(packet + sizeof(struct ether_header));
++ struct my_arphdr *arp = (struct my_arphdr *)(packet + sizeof(struct ether_header));
+ u_short op;
++ in_addr_t ipaddr;
+
+ // Are you root?
+ uid = getuid();
+@@ -128,12 +130,14 @@
+ arp->pa_len = IP_ALEN; // Protocol address length
+ arp->opcode = htons(op); // ARP operation
+ memcpy(arp->source_add,(u_char *)ether_aton(smac),ETH_ALEN); // Source MAC
+- *(u_long *)arp->source_ip = inet_addr(sip); // Source IP
++ ipaddr = inet_addr(sip);
++ memcpy(arp->source_ip, (u_char *)&ipaddr, IP_ALEN); // Source IP
+
+ if(strcmp(dmac,"ff:ff:ff:ff:ff:ff"))
+ memcpy(arp->dest_add,(u_char *)ether_aton(dmac),ETH_ALEN); // Destination MAC
+
+- *(u_long *)arp->dest_ip = inet_addr(dip); // Destination IP
++ ipaddr = inet_addr(dip);
++ memcpy(arp->dest_ip, (u_char *)&ipaddr, IP_ALEN); // Destination IP
+
+
+ // Run packet!! Run!
+diff -urNad trunk~/arp.h trunk/arp.h
+--- trunk~/arp.h 2006-10-05 21:34:38.000000000 +0300
++++ trunk/arp.h 2006-10-05 21:38:40.522608147 +0300
+@@ -43,7 +43,7 @@
+ #define IP_ALEN 4
+
+ // ARP Header Struktur
+-struct arphdr {
++struct my_arphdr {
+ u_short hw_type; // hardware type
+ u_short proto_type; // protocol type
+ u_char ha_len; // hardware address len
+diff -urNad trunk~/arp_lookup_linux.c trunk/arp_lookup_linux.c
+--- trunk~/arp_lookup_linux.c 2006-10-05 21:34:38.000000000 +0300
++++ trunk/arp_lookup_linux.c 2006-10-05 21:38:40.522608147 +0300
+@@ -19,6 +19,7 @@
+ */
+
+ #include <stdio.h>
++#include <string.h>
+
+ #define _PATH_PROCNET_ARP "/proc/net/arp"
+
+diff -urNad trunk~/get_mac_linux.c trunk/get_mac_linux.c
+--- trunk~/get_mac_linux.c 2006-10-05 21:34:38.000000000 +0300
++++ trunk/get_mac_linux.c 2006-10-05 21:38:40.523607976 +0300
+@@ -20,6 +20,9 @@
+
+ #include <sys/ioctl.h>
+ #include <net/ethernet.h>
++#include <string.h>
++#include <stdlib.h>
++#include <stdio.h>
+ #include <net/if.h>
+
+ int get_mac_linux(u_char *dev, char *mac)
+diff -urNad trunk~/send_packet_linux.c trunk/send_packet_linux.c
+--- trunk~/send_packet_linux.c 2006-10-05 21:34:38.000000000 +0300
++++ trunk/send_packet_linux.c 2006-10-05 21:38:40.523607976 +0300
+@@ -20,6 +20,9 @@
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
++#include <string.h>
++#include <stdlib.h>
++#include <stdio.h>
+ #include "arp.h"
+
+ int send_packet_linux(u_char *dev, u_char *packet, u_int packetsize)
Propchange: packages/libnet-arp-perl/trunk/debian/patches/10alignment-and-headers.dpatch
------------------------------------------------------------------------------
svn:executable = *
More information about the Pkg-perl-cvs-commits
mailing list