netmap pkt_gen can't compile successfully

dongshan thomasyang1206 at 126.com
Thu May 22 14:46:14 UTC 2014


Hi,

 

I have some problems in running netmap pkt_gen, the receiving mode seems
okay, but the sending  mode will cause segmentation fault. 

when i compile pkt_gen.c, it warns three times, in Makefile with CFLAGS
-Werror, so the warning is treated as error, so i deleted -Werror, then it
can make pkt_gen binary file, but int can't run successfully.

 

I did it on x86 64 bit Linux 

 

In file included from pkt-gen.c:43:0:

pkt-gen.c: In function 'main':

../sys/net/netmap_user.h:85:58: error: format '%lx' expects argument of type
'long unsigned int', but argument 8 has type 'int' [-Werror=format=]

#define NETMAP_TXRING(nifp, index) _NETMAP_OFFSET(struct netmap_ring *, \

                                                          ^

../sys/net/netmap_user.h:81:4: note: in definition of macro '_NETMAP_OFFSET'

  ((type)(void *)((char *)(ptr) + (offset)))

    ^

../sys/net/netmap_user.h:155:33: note: in expansion of macro 'NETMAP_TXRING'

       __FUNCTION__, __LINE__, ##__VA_ARGS__); \

                                 ^

pkt-gen.c:1825:4: note: in expansion of macro 'D'

    D("   TX%d at 0x%lx", i,

    ^

../sys/net/netmap_user.h:88:58: error: format '%lx' expects argument of type
'long unsigned int', but argument 8 has type 'int' [-Werror=format=]

#define NETMAP_RXRING(nifp, index) _NETMAP_OFFSET(struct netmap_ring *, \

                                                          ^

../sys/net/netmap_user.h:81:4: note: in definition of macro '_NETMAP_OFFSET'

  ((type)(void *)((char *)(ptr) + (offset)))

    ^

../sys/net/netmap_user.h:155:33: note: in expansion of macro 'NETMAP_RXRING'

       __FUNCTION__, __LINE__, ##__VA_ARGS__); \

                                 ^

pkt-gen.c:1829:4: note: in expansion of macro 'D'

    D("   RX%d at 0x%lx", i,

    ^

cc1: all warnings being treated as errors

make[1]: *** [pkt-gen.o] Error 1

make[1]: Leaving directory `/home/dsh/project/netmap/examples'

make: *** [apps] Error 2

 

Did it happen to you?

 

Best regards,

Dongshan

 



More information about the freebsd-net mailing list