[ixp1200] Vera Software update
Yitzchak M. Gottlieb
zuki at CS.Princeton.EDU
Mon Mar 25 09:34:44 EST 2002
Qiu Qiang,
You are quite right, I seemed to have released slightly problematic code. The
fix is, as you suggest to comment out that LIB_HDRS line in the Makefile. For
the other problem I have attached a patch which should be applied to
Vera/Libixprouter/sa/src/control.c it removed references to the atoi function
and used a substitute available in Libsck. To apply the patch, simply run
# patch control.c controlpatch
Remember to keep a copy of the old control.c, and don't hesitate to point out
any other bugs that you find.
Zuki
--
Yitzchak Gottlieb
zuki at CS.Princeton.EDU
On Sat, 23 Mar 2002, Qiu Qiang wrote:
> Hi Zuki,
>
> I just try out the new released VERA. I met some problem during compiling.
>
> 1. I cannot find the file p3tosa.h metioned in
> Libixprouter/common/src/makefile
> LIB_HDRS +=p3tosa.h
>
> 2. After I comment out the line metioned above, all the Library was compiled
> succefully; However, when I try to compile IPmm application, it report some
> error like:
> ..../Vera/Libixprouter/sa/lib/libIXPRouter.a(control.o)(.text+0x124):fake:
> relocation truncated to fit: ARM_26 atoi
>
> I cannot figure out the reason. Wish you could give me some idea.
>
> Thanks,
>
> Best Regards,
> Qiu Qiang
>
-------------- next part --------------
12c12,13
< #include <stdlib.h> /* atoi */
---
>
> #include <sck/strtoule.h>/* strtoule */
137c138,139
< int portnum = atoi(buffer);
---
> int err = 0;
> unsigned long portnum = strtoule(buffer, NULL, 10, &err);
139,140c141,142
< if ((0 <= portnum) && (portnum < 8)) {
< Pktgen_SimplePacket(portnum);
---
> if ((!err) && (portnum < 8)) {
> Pktgen_SimplePacket(portnum);
159c161,162
< int uenum = atoi(buffer);
---
> int err = 0;
> unsigned long uenum = strtoule(buffer, NULL, 10, &err);
161c164
< if ((0 <= uenum) && (uenum < 6)) {
---
> if ((!err) && (uenum < 6)) {
181c184,185
< int portnum = atoi(buffer);
---
> int err = 0;
> unsigned long portnum = strtoule(buffer, NULL, 10, &err);
183c187
< if ((0 <= portnum) && (portnum < 8)) {
---
> if ((!err) && (portnum < 8)) {
203c207,208
< int portnum = atoi(buffer);
---
> int err = 0;
> unsigned long portnum = strtoule(buffer, NULL, 10, &err);
205c210
< if ((0 <= portnum) && (portnum < 8)) {
---
> if ((!err) && (portnum < 8)) {
225c230,231
< int uenum = atoi(buffer);
---
> int err = 0;
> unsigned long uenum = strtoule(buffer, NULL, 10, &err);
227c233
< if ((0 <= uenum) && (uenum < 6)) {
---
> if ((!err) && (uenum < 6)) {
More information about the ixp1200
mailing list