aboutgitcodebugslistschat
path: root/passt.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-05-21 11:14:46 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-05-21 11:14:46 +0200
commit8754878fbf68be4557e1fde67ceb59f07457787a (patch)
tree13299e88ab5f3e666ada3c93ab883924f489ff5c /passt.c
parent7e3e36b2c2d6cc233958aa10da8ef703c693f0b9 (diff)
downloadpasst-8754878fbf68be4557e1fde67ceb59f07457787a.tar
passt-8754878fbf68be4557e1fde67ceb59f07457787a.tar.gz
passt-8754878fbf68be4557e1fde67ceb59f07457787a.tar.bz2
passt-8754878fbf68be4557e1fde67ceb59f07457787a.tar.lz
passt-8754878fbf68be4557e1fde67ceb59f07457787a.tar.xz
passt-8754878fbf68be4557e1fde67ceb59f07457787a.tar.zst
passt-8754878fbf68be4557e1fde67ceb59f07457787a.zip
passt: With -DDEBUG, also print protocol number for unsupported protocols
...otherwise, we have no idea what's going on if we receive something unexpected. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'passt.c')
-rw-r--r--passt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/passt.c b/passt.c
index 228a886..c2c630e 100644
--- a/passt.c
+++ b/passt.c
@@ -407,8 +407,8 @@ static int tap4_handler(struct ctx *c, struct tap_msg *msg, size_t count,
if (msg[0].len < sizeof(*uh))
return 1;
- debug("%s from tap: %s:%i -> %s:%i (%i packet%s)",
- IP_PROTO_STR(iph->protocol),
+ debug("%s (%i) from tap: %s:%i -> %s:%i (%i packet%s)",
+ IP_PROTO_STR(iph->protocol), iph->protocol,
inet_ntop(AF_INET, &iph->saddr, buf_s, sizeof(buf_s)),
ntohs(uh->source),
inet_ntop(AF_INET, &iph->daddr, buf_d, sizeof(buf_d)),
@@ -526,8 +526,8 @@ static int tap6_handler(struct ctx *c, struct tap_msg *msg, size_t count,
if (msg[0].len < sizeof(*uh))
return 1;
- debug("%s from tap: [%s]:%i\n\t-> [%s]:%i (%i packet%s)",
- IP_PROTO_STR(proto),
+ debug("%s (%i) from tap: [%s]:%i\n\t-> [%s]:%i (%i packet%s)",
+ IP_PROTO_STR(proto), proto,
inet_ntop(AF_INET6, &ip6h->saddr, buf_s, sizeof(buf_s)),
ntohs(uh->source),
inet_ntop(AF_INET6, &ip6h->daddr, buf_d, sizeof(buf_d)),
@@ -672,7 +672,7 @@ static void sock_handler(struct ctx *c, int s, uint32_t events,
return;
}
- debug("%s: packet from socket %i", IP_PROTO_STR(proto), s);
+ debug("%s (%i): packet from socket %i", IP_PROTO_STR(proto), proto, s);
if (proto == IPPROTO_ICMP || proto == IPPROTO_ICMPV6)
icmp_sock_handler(c, s, events, pkt_buf, now);