]> git.ipfire.org Git - thirdparty/iproute2.git/commit
Fix struct alignment with cris architecture
authorAndy Gay <andy@andynet.net>
Fri, 11 Aug 2006 00:25:40 +0000 (20:25 -0400)
committerStephen Hemminger <shemminger@osdl.org>
Fri, 11 Aug 2006 16:44:36 +0000 (09:44 -0700)
commitaf1b6a41d4c7ed8aab98cfdcdafd55ec6c638b07
tree3d61e204621f4f3fdfc9edf91c3ad3fb1a83090c
parent34e9564753075c756f96597e7aa57f969a403aaf
Fix struct alignment with cris architecture

[IPROUTE]: Fix struct alignment with cris architecture

gcc for the cris arch does not pad structures to the next multiple of 4
bytes, as the i386 gcc does.

This causes errors like this when displaying xfrm policies:

# ip x p
!!!Deficit 3, rta_len=300
src 192.168.251.32/29 dst 192.168.251.32/29
        dir in priority 0
!!!Deficit 3, rta_len=180
src 0.0.0.0/0 dst 192.168.251.32/29
        dir in priority 2208
....

Similar errors are seen from ip x s.

This patch fixes the errors when printing. I'm not sure whether we
should worry about other uses of the affected structs, I've not seen any
other bad effects from this though, so hopefully this is enough.

(Thanks to Herbert Xu for pointing out that NLMSG_SPACE is the correct
macro to use here.)

Tested against 2.6.17.6 kernel on i386, and 2.6.16.1 kernel on cris.

Signed-off-by: Andy Gay <andy@andynet.net>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
ip/xfrm_policy.c
ip/xfrm_state.c