printf(")");
}
- if ((u_char *)ipds->ip + hlen <= snapend) {
+ if (!Kflag && (u_char *)ipds->ip + hlen <= snapend) {
sum = in_cksum((const u_short *)ipds->ip, hlen, 0);
if (sum != 0) {
ip_sum = EXTRACT_16BITS(&ipds->ip->ip_sum);
}
udpipaddr_print(ip, sport, dport);
- if (IP_V(ip) == 4 && (vflag > 1) && !fragmented) {
+ if (IP_V(ip) == 4 && vflag && !Kflag && !fragmented) {
int sum = up->uh_sum;
if (sum == 0) {
(void)printf("[no cksum] ");
}
}
#ifdef INET6
- if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) {
+ if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !Kflag && !fragmented) {
int sum = up->uh_sum;
/* for IPv6, UDP checksum is mandatory */
if (TTEST2(cp[0], length)) {
will be shown.
.TP
.B \-K
-Don't attempt to verify TCP checksums. This is useful for interfaces
-that perform the TCP checksum calculation in hardware; otherwise,
-all outgoing TCP checksums will be flagged as bad.
+Don't attempt to verify IP, TCP, or UDP checksums. This is useful for
+interfaces that perform some or all of those checksum calculation in
+hardware; otherwise, all outgoing TCP checksums will be flagged as bad.
.TP
.B \-l
Make stdout line buffered.