diff options
author | Jim Gibson <gibson+fdio@cisco.com> | 2017-03-27 19:46:12 +0000 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-03-28 13:21:57 +0000 |
commit | 22db11b491f80539438418eaaa0aa864202dadf6 (patch) | |
tree | c41d24afa6950224bee8f2b04530a7fccd43d821 /src | |
parent | da1f2c7cffb0de4ef05a48ffd107214eb11fa45f (diff) |
af_packet driver needs to check VLIB_BUFFER_NEXT_PRESENT flag is set
when walking vlib_buffer_t next_buffer chain on transmit.
On buffer allocation:
- next_buffer is not and may contain a stale invalid value that
should be ignored if not overwritten by a valid value.
- VLIB_BUFFER_NEXT_PRESENT flag is cleared and only set
if a valid value is written to next_buffer.
Change-Id: I9b0ccdc54f4f7456f8328ce7c4a0d52d0fba8caa
Signed-off-by: Jim Gibson <gibson+fdio@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/devices/af_packet/device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vnet/devices/af_packet/device.c b/src/vnet/devices/af_packet/device.c index e3bf9bbc51b..9a94fc5e4a9 100644 --- a/src/vnet/devices/af_packet/device.c +++ b/src/vnet/devices/af_packet/device.c @@ -125,7 +125,8 @@ af_packet_interface_tx (vlib_main_t * vm, vlib_buffer_get_current (b0), len); offset += len; } - while ((bi = b0->next_buffer)); + while ((bi = + (b0->flags & VLIB_BUFFER_NEXT_PRESENT) ? b0->next_buffer : 0)); tph->tp_len = tph->tp_snaplen = offset; tph->tp_status = TP_STATUS_SEND_REQUEST; |