Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion unixdump/unixdump/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,9 @@ def main():
if (l >= BUFFER_SIZE) {
l = BUFFER_SIZE - 1;
}
bpf_probe_read(entry->buffer, l, base);
if (l < BUFFER_SIZE) {
bpf_probe_read(entry->buffer, l, base);
}
}

static inline struct cmsghdr* cmsg_firsthdr_x(struct msghdr* msg) {
Expand Down Expand Up @@ -595,6 +597,7 @@ def main():

int kprobe__unix_stream_sendmsg(struct pt_regs *ctx, struct socket *sock, struct msghdr *msg){
struct notify_t n;
__builtin_memset(&n, 0, sizeof(n));
n.cpu = bpf_get_smp_processor_id();
n.type = SOCK_STREAM;

Expand Down Expand Up @@ -920,6 +923,7 @@ def main():

int kprobe__unix_dgram_sendmsg(struct pt_regs *ctx, struct socket *sock, struct msghdr *msg){
struct notify_t n;
__builtin_memset(&n, 0, sizeof(n));
n.cpu = bpf_get_smp_processor_id();
n.type = SOCK_DGRAM;

Expand Down