Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion elements/etherswitch/etherswitch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ EtherSwitch::broadcast(int source, Packet *p)
for (int i = 0; i < n && w > 0; i++) {
if (pfr.bv[i]) {
Packet *pp = (w > 1 ? p->clone() : p);
output(i).push(pp);
if (pp)
output(i).push(pp);
w--;
}
}
Expand Down
2 changes: 1 addition & 1 deletion elements/icmp/icmpsendpings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ ICMPPingSource::make_packet(WritablePacket *q)
q->set_ip_header(nip, sizeof(click_ip));
q->timestamp_anno().assign_now();

if (_receiver)
if (q && _receiver)
_receiver->send_timestamp[icp->icmp_sequence] = q->timestamp_anno();

return q;
Expand Down
4 changes: 3 additions & 1 deletion include/click/hashtable.hh
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,9 @@ template <typename T>
typename HashTable<T>::value_type &
HashTable<T>::operator[](key_const_reference key)
{
return *find_insert(key);
HashTable_iterator<T> i = find_insert(key);
assert(i.get());
return *i;
}

template <typename T>
Expand Down
5 changes: 5 additions & 0 deletions lib/fromfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ FromFile::read_buffer_mmap(ErrorHandler *errh)
return error(errh, "mmap: %s", strerror(errno));

_data_packet = Packet::make((unsigned char *)mmap_data, _len, munmap_destructor, 0);
if (!_data_packet) {
munmap_destructor((unsigned char *)mmap_data, _len, NULL);
return error(errh, "Packet::make failed");
}

_buffer = _data_packet->data();
_file_offset = _mmap_off;
_mmap_off += _len;
Expand Down