modification of the function src/pcapext.c