Modify

Opened 8 years ago

Closed 8 years ago

Last modified 22 months ago

#3751 closed defect (duplicate)

ipcalc.sh returns wrong values on ixp4xx

Reported by: GLR <glr@…> Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: base system Version:
Keywords: ipcalc ixp4xx Cc:

Description

Kamikaze ixp4xx r11765 :
ipcalc.sh returns wrong values :

# ipcalc.sh 192.168.1.1
IP=0.0.0.1
NETMASK=0.0.0.0
BROADCAST=0.0.0.255
NETWORK=0.0.0.0
PREFIX=16

Therefore or also (?) syslogd remote logging doesn't work and certainly dnsmasq too.

Note : same ipcalc.sh and /usr/lib/common.awk code work correctly on bcm-2.4 platform.

Attachments (2)

kmod-fpe.mk (437 bytes) - added by Giampaolo Mancini <giampaolo.mancini@…> 8 years ago.
Fake FPE Kernel Module
ipcalc.sh (2.9 KB) - added by Pascal 8 years ago.
In-place replacement for ipcalc.sh

Download all attachments as: .zip

Change History (16)

comment:1 Changed 8 years ago by thepeople

This also occurs on AVR32. The issue also breaks the firewall init script.

Changed 8 years ago by Giampaolo Mancini <giampaolo.mancini@…>

Fake FPE Kernel Module

comment:2 Changed 8 years ago by Giampaolo Mancini <giampaolo.mancini@…>

AFAIK, it's due a to a strange behaviour of rshift function implementation in busybox' awk and eventually is an FPE-related issue.

To get rshift to get working back, you need both to disable the soft-float option for the toolchain (already done in r11338) and to enable the FPE code in kernel configuration:

CONFIG_FPE_NWFPE=y
CONFIG_FPE_NWFPE_XP=n
CONFIG_FPE_FASTFPE=n

I'm getting this automatically done with an OpenWRT fake kernel module (please, see attachment).

comment:3 follow-up: Changed 8 years ago by anonymous

you are really wrong, ixp4xx doesn't have an fpu, nor most of the targets..
also, if it's a software issue in busybox, it has to be fixed there.

also, this issue was there way before openwrt started to use softfloat

comment:4 in reply to: ↑ 3 Changed 8 years ago by anonymous

Replying to anonymous:

you are really wrong, ixp4xx doesn't have an fpu, nor most of the targets..

You're right, ixp4xx and co doesn't have an FPU. Indeed, the proposed fix enables the in-kernel Floating Point Emulation not the on-board/on-chip Floating Point Unit.

also, if it's a software issue in busybox, it has to be fixed there.

also, this issue was there way before openwrt started to use softfloat

As far as i can remember, the issue was introduced by a busybox upgrade, in which the busybox developers changed the awk's rshift implementation.

Anyhow, we do run ixp4xx-based machines with the proposed fixes, doing extensive use of ipcalc.sh and everything is working fine.

# dmesg | sed -ne '1p' -e '2p' -e '42p'                        
Linux version 2.6.26 (mancho@spike) (gcc version 4.1.2) #6 Tue Jul 15 12:20:15 8
CPU: XScale-IXP42x Family [690541c2] revision 2 (ARMv5TE), cr=000039ff          
NetWinder Floating Point Emulator V0.97 (double precision)       
# uname -a                                                     
Linux Naaw-wp188 2.6.26 #6 Tue Jul 15 12:20:15 CEST 2008 armv5teb unknown 
# ipcalc.sh 192.168.1.1                                        
IP=192.168.1.1                                                                  
NETMASK=0.0.0.0                                                                 
BROADCAST=255.255.255.255                                                       
NETWORK=0.0.0.0                                                                 
PREFIX=-8                                     

comment:5 follow-up: Changed 8 years ago by kaloz

look at #3012

comment:6 in reply to: ↑ 5 Changed 8 years ago by GLR <glr@…>

Hmmm... I presume my build is not ok here :

root@OpenWrt:~# dmesg | sed -ne '1p' -e '2p' -e '42p'
Linux version 2.6.26 (glr@hades) (gcc version 4.1.2) #1 Tue Jul 15 23:47:30 CEST 2008
CPU: XScale-IXP42x Family [690541f1] revision 1 (ARMv5TE), cr=000039ff
IXP4xx Queue Manager initialized.
root@OpenWrt:~# uname -a
Linux OpenWrt 2.6.26 #1 Tue Jul 15 23:47:30 CEST 2008 armv5teb unknown

comment:7 Changed 8 years ago by GLR <glr@…>

Where must the file kmod-fpe.mk be put ?
in the ./kamikaze/target/linux/ixp4xx/ directory or ?

comment:8 Changed 8 years ago by anonymous

Just put in in openwrt/package/kernel/modules/fpe.mk, enable it in (make menuconfig) Kernel Modules->Other Modules->kmod-fpe and build the usual way.

comment:9 Changed 8 years ago by GLR <glr@…>

I don't have exactly such a directory. What I have in my openwrt folder is a kamikaze/package/kernel/modules/ directory with other modules :

glr@hades:~/openwrt$ ls kamikaze/package/kernel/modules/
block.mk   fs.mk     i2c.mk        network.mk  sound.mk  video.mk  wireless.mk
crypto.mk  hwmon.mk  netfilter.mk  other.mk    usb.mk    w1.mk

If I put fpe.mk in this directory, it still doesn't appear in the kernel modules config menu.

I've also a packages directory at the same level (openwrt root) as kamikaze but without kernel sub-directory. This is the folder of the packages not belonging to the base system :

glr@hades:~/openwrt$ ls packages/
admin  devel  ipv6  lang  libs  mail  multimedia  net  skels  sound  utils  XOrg

Changed 8 years ago by Pascal

In-place replacement for ipcalc.sh

comment:10 follow-up: Changed 8 years ago by GLR <glr@…>

Thanks a lot ! It works fine :

root@NSLU2:~# ipcalc.sh 192.168.1.1 255.255.255.0
IP=192.168.1.1
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
NETWORK=192.168.1.0
PREFIX=24

However, it seems that the remote syslog still doesn't work, but this is perhaps another subject/case to be confirmed and deeper investigated...

comment:11 in reply to: ↑ 10 Changed 8 years ago by GLR <glr@…>

No in fact remote syslog works fine to (I just had a case issue in my syslog-ng filter).
dnsmasq is also OK.
So everything's working, thanks again !

comment:12 Changed 8 years ago by Giampaolo Mancini <giampaolo.mancini@…>

You welcome! Have a nice... hacking!

comment:13 Changed 8 years ago by agb

  • Resolution set to duplicate
  • Status changed from new to closed

Dupe of #3012

comment:14 Changed 22 months ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.