/* Copy the frame header source and destination out */
memset(&arm, 0, sizeof(arm));
- hw_s = bpf_frame_header_src(ifp, data, &falen);
- if (hw_s != NULL && falen <= sizeof(arm.fsha))
- memcpy(arm.fsha, hw_s, falen);
- hw_t = bpf_frame_header_dst(ifp, data, &falen);
- if (hw_t != NULL && falen <= sizeof(arm.ftha))
- memcpy(arm.ftha, hw_t, falen);
-
- /* Skip past the frame header */
- data += fl;
- len -= fl;
+ if (fl != 0) {
+ hw_s = bpf_frame_header_src(ifp, data, &falen);
+ if (hw_s != NULL && falen <= sizeof(arm.fsha))
+ memcpy(arm.fsha, hw_s, falen);
+ hw_t = bpf_frame_header_dst(ifp, data, &falen);
+ if (hw_t != NULL && falen <= sizeof(arm.ftha))
+ memcpy(arm.ftha, hw_t, falen);
+
+ /* Skip past the frame header */
+ data += fl;
+ len -= fl;
+ }
/* We must have a full ARP header */
if (len < sizeof(ar))