KA10: Fixed some coverity errors.
This commit is contained in:
parent
894871f64d
commit
9b2f13d443
3 changed files with 8 additions and 2 deletions
|
@ -1080,6 +1080,8 @@ void nia_packet_debug(struct nia_device *nia, const char *action,
|
||||||
case ICMP_PROTO:
|
case ICMP_PROTO:
|
||||||
icmp = (struct icmp *)payload;
|
icmp = (struct icmp *)payload;
|
||||||
len = ntohs(ip->ip_len) - (ip->ip_v_hl & 0xf) * 4;
|
len = ntohs(ip->ip_len) - (ip->ip_v_hl & 0xf) * 4;
|
||||||
|
if (len > 1500)
|
||||||
|
len = 1500;
|
||||||
sim_debug(DEBUG_ICMP, &nia_dev, "%s %s %d byte packet from %s to %s\n", action,
|
sim_debug(DEBUG_ICMP, &nia_dev, "%s %s %d byte packet from %s to %s\n", action,
|
||||||
(icmp->type < sizeof(icmp_types)/sizeof(icmp_types[0])) ? icmp_types[icmp->type] : "", (int)len, src_ip, dst_ip);
|
(icmp->type < sizeof(icmp_types)/sizeof(icmp_types[0])) ? icmp_types[icmp->type] : "", (int)len, src_ip, dst_ip);
|
||||||
if (len && (nia_dev.dctrl & DEBUG_ICMP))
|
if (len && (nia_dev.dctrl & DEBUG_ICMP))
|
||||||
|
|
|
@ -1028,7 +1028,7 @@ t_stat dev_pi(uint32 dev, uint64 *data) {
|
||||||
res |= ((uint64)(PIR) << 18);
|
res |= ((uint64)(PIR) << 18);
|
||||||
#endif
|
#endif
|
||||||
#if !KL
|
#if !KL
|
||||||
res |= (parity_irq << 15);
|
res |= ((uint64)parity_irq << 15);
|
||||||
#endif
|
#endif
|
||||||
*data = res;
|
*data = res;
|
||||||
sim_debug(DEBUG_CONI, &cpu_dev, "CONI PI %012llo\n", *data);
|
sim_debug(DEBUG_CONI, &cpu_dev, "CONI PI %012llo\n", *data);
|
||||||
|
@ -4058,7 +4058,7 @@ t_stat dev_apr(uint32 dev, uint64 *data) {
|
||||||
res |= (((FLAGS & PCHNG) != 0) << 6) | (pcchg_irq << 7) ;
|
res |= (((FLAGS & PCHNG) != 0) << 6) | (pcchg_irq << 7) ;
|
||||||
res |= (clk_flg << 9) | (((uint64)clk_en) << 10) | (nxm_flag << 12);
|
res |= (clk_flg << 9) | (((uint64)clk_en) << 10) | (nxm_flag << 12);
|
||||||
res |= (mem_prot << 13) | (((FLAGS & USER) != 0) << 14) | (user_io << 15);
|
res |= (mem_prot << 13) | (((FLAGS & USER) != 0) << 14) | (user_io << 15);
|
||||||
res |= (push_ovf << 16);
|
res |= ((uint64)push_ovf << 16);
|
||||||
*data = res;
|
*data = res;
|
||||||
sim_debug(DEBUG_CONI, &cpu_dev, "CONI APR %012llo\n", *data);
|
sim_debug(DEBUG_CONI, &cpu_dev, "CONI APR %012llo\n", *data);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1508,6 +1508,8 @@ imp_packet_in(struct imp_device *imp)
|
||||||
int i;
|
int i;
|
||||||
char port_buffer[100];
|
char port_buffer[100];
|
||||||
struct udp_hdr udp_hdr;
|
struct udp_hdr udp_hdr;
|
||||||
|
if (l > 1500)
|
||||||
|
l = 1500;
|
||||||
/* Count out 4 commas */
|
/* Count out 4 commas */
|
||||||
for (i = nlen = 0; i < l && nlen < 4; i++) {
|
for (i = nlen = 0; i < l && nlen < 4; i++) {
|
||||||
if (tcp_payload[i] == ',')
|
if (tcp_payload[i] == ',')
|
||||||
|
@ -2098,6 +2100,8 @@ void imp_packet_debug(struct imp_device *imp, const char *action, ETH_PACK *pack
|
||||||
|
|
||||||
}
|
}
|
||||||
len = ntohs(ip->ip_len) - ((ip->ip_v_hl & 0xf) * 4 + (ntohs(tcp->flags) >> 12) * 4);
|
len = ntohs(ip->ip_len) - ((ip->ip_v_hl & 0xf) * 4 + (ntohs(tcp->flags) >> 12) * 4);
|
||||||
|
if (len > 1500)
|
||||||
|
len = 1500;
|
||||||
sim_debug(DEBUG_TCP, &imp_dev, "%s %s%s %d byte packet from %s:%s to %s:%s\n", action,
|
sim_debug(DEBUG_TCP, &imp_dev, "%s %s%s %d byte packet from %s:%s to %s:%s\n", action,
|
||||||
flags, *flags ? ":" : "", (int)len, src_ip, src_port, dst_ip, dst_port);
|
flags, *flags ? ":" : "", (int)len, src_ip, src_port, dst_ip, dst_port);
|
||||||
if (len && (imp_dev.dctrl & DEBUG_TCP))
|
if (len && (imp_dev.dctrl & DEBUG_TCP))
|
||||||
|
|
Loading…
Add table
Reference in a new issue