Use gdb to inspect the pcap_main_t. In particular, determine vec_len(pm->pcap_data) [“(gdb) vl(pm->pcap_data)”] and pm->n_pcap_data_written. For reasonable N pcap_write(...) is known to work.
D. From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of aihua1...@163.com Sent: Sunday, October 16, 2022 11:23 PM To: vpp-dev@lists.fd.io Subject: [vpp-dev] pcap_write error: bad address #pcap dear all: pcap_write,use type int n; if n is negative。 int n = vec_len (pm->pcap_data) - pm->n_pcap_data_written; write func will failed,errno = 14. n = write (pm->file_descriptor, vec_elt_at_index (pm->pcap_data, pm->n_pcap_data_written), n); int cast to size_t may case some overflow?
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#22041): https://lists.fd.io/g/vpp-dev/message/22041 Mute This Topic: https://lists.fd.io/mt/94377467/21656 Mute #pcap:https://lists.fd.io/g/vpp-dev/mutehashtag/pcap Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-