Bug 745 - ping with ipv6 crashes on arm
Summary: ping with ipv6 crashes on arm
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.15.x
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-26 09:50 UTC by Nikos Mavrogianopoulos
Modified: 2009-11-29 02:14 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments
ping ipv6 fix (519 bytes, patch)
2009-11-26 09:51 UTC, Nikos Mavrogianopoulos
Details
Patch which went into git (1.55 KB, patch)
2009-11-26 14:33 UTC, Denys Vlasenko
Details

Note You need to log in before you can comment on or make changes to this bug.
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.