ARM/L4Linux alignment

Change access of IP header in 'icmp_echo' to work with unaligned data
This commit is contained in:
Sebastian Sumpf 2012-07-10 15:13:49 +02:00 committed by Norman Feske
parent 3cfbc53754
commit e52a33783a
2 changed files with 15 additions and 2 deletions

View File

@ -8,7 +8,7 @@ VERBOSE ?= @
ECHO = @echo
TARGET ?= l4linux
PATCH-l4linux = patches/l4lx_genode.patch
PATCH-l4linux = patches/l4lx_genode.patch patches/icmp_align.patch
REV-l4linux = 23
REPO-l4linux = http://svn.tudos.org/repos/oc/l4linux/trunk
@ -62,7 +62,7 @@ help:
prepare: clean
$(VERBOSE)$(UPDATE)
$(ECHO) "applying patches to '$(REAL_CONTRIB_DIR)/$(TARGET)'"
$(VERBOSE)$(PATCH) -d $(REAL_CONTRIB_DIR)/$(TARGET) -i $(realpath $(PATCH-$(TARGET)))
$(VERBOSE)for i in $(PATCH-$(TARGET)); do $(PATCH) -d $(REAL_CONTRIB_DIR)/$(TARGET) < $$i; done
$(VERBOSE)ln -s $(shell pwd)/src/drivers $(REAL_CONTRIB_DIR)/$(TARGET)/arch/l4/drivers
$(ECHO)
$(ECHO) "Preparation completed!"

View File

@ -0,0 +1,13 @@
Index: net/ipv4/icmp.c
===================================================================
--- net/ipv4/icmp.c (revision 23)
+++ net/ipv4/icmp.c (working copy)
@@ -818,7 +818,7 @@
if (!net->ipv4.sysctl_icmp_echo_ignore_all) {
struct icmp_bxm icmp_param;
- icmp_param.data.icmph = *icmp_hdr(skb);
+ memcpy(&icmp_param.data.icmph, icmp_hdr(skb), sizeof(struct icmphdr));
icmp_param.data.icmph.type = ICMP_ECHOREPLY;
icmp_param.skb = skb;
icmp_param.offset = 0;