Skip to content

Commit 4b3418f

Browse files
bmorkdavem330
authored andcommitted
ipv6: icmp: include addresses in debug messages
Messages like "icmp6_send: no reply to icmp error" are close to useless. Adding source and destination addresses to provide some more clue. Signed-off-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1075ef5 commit 4b3418f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

net/ipv6/icmp.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,15 +453,17 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
453453
* and anycast addresses will be checked later.
454454
*/
455455
if ((addr_type == IPV6_ADDR_ANY) || (addr_type & IPV6_ADDR_MULTICAST)) {
456-
net_dbg_ratelimited("icmp6_send: addr_any/mcast source\n");
456+
net_dbg_ratelimited("icmp6_send: addr_any/mcast source [%pI6c > %pI6c]\n",
457+
&hdr->saddr, &hdr->daddr);
457458
return;
458459
}
459460

460461
/*
461462
* Never answer to a ICMP packet.
462463
*/
463464
if (is_ineligible(skb)) {
464-
net_dbg_ratelimited("icmp6_send: no reply to icmp error\n");
465+
net_dbg_ratelimited("icmp6_send: no reply to icmp error [%pI6c > %pI6c]\n",
466+
&hdr->saddr, &hdr->daddr);
465467
return;
466468
}
467469

@@ -513,7 +515,8 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
513515
len = skb->len - msg.offset;
514516
len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) - sizeof(struct icmp6hdr));
515517
if (len < 0) {
516-
net_dbg_ratelimited("icmp: len problem\n");
518+
net_dbg_ratelimited("icmp: len problem [%pI6c > %pI6c]\n",
519+
&hdr->saddr, &hdr->daddr);
517520
goto out_dst_release;
518521
}
519522

@@ -785,7 +788,8 @@ static int icmpv6_rcv(struct sk_buff *skb)
785788
if (type & ICMPV6_INFOMSG_MASK)
786789
break;
787790

788-
net_dbg_ratelimited("icmpv6: msg of unknown type\n");
791+
net_dbg_ratelimited("icmpv6: msg of unknown type [%pI6c > %pI6c]\n",
792+
saddr, daddr);
789793

790794
/*
791795
* error of unknown type.

0 commit comments

Comments
 (0)