Bug 745

Summary: ping with ipv6 crashes on arm
Product: Busybox Reporter: Nikos Mavrogianopoulos <nmav>
Component: NetworkingAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: aldot, busybox-cvs
Priority: P5    
Version: 1.15.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: ping ipv6 fix
Patch which went into git

Description Nikos Mavrogianopoulos 2009-11-26 09:50:28 UTC
ARM does not allow unaligned memory access thus the following code from ping:
hoplimit = *(int*)CMSG_DATA(mp);
crashes. The attached patch fixes the issue for me.
Comment 1 Nikos Mavrogianopoulos 2009-11-26 09:51:29 UTC
Created attachment 763 [details]
ping ipv6 fix
Comment 2 Bernhard Reutner-Fischer 2009-11-26 11:23:40 UTC
What's your
$ gcc -v
$ as --version
and what CFLAGS (EXTRA_CFLAGS) were used to build busybox?

Doesn't the compiler convert unaligned accesses into aligned ones on CPUs that are known not to support certain unaligned accesses?
Comment 3 Denys Vlasenko 2009-11-26 14:29:04 UTC
(In reply to comment #2)
> Doesn't the compiler convert unaligned accesses into aligned ones on CPUs that
> are known not to support certain unaligned accesses?

I think compiler usually assumes we know what we are doing. It will only handle attribute(packed) structure members and such. Simple casts assumed to result in aligned ptrs.

I pushed a fix in 57be1ee, will be in 1.16.x. Please test current git.
Comment 4 Denys Vlasenko 2009-11-26 14:33:42 UTC
Created attachment 765 [details]
Patch which went into git
Comment 5 Denys Vlasenko 2009-11-29 02:14:05 UTC
Please reopen if current git still doesn't work.