Skip to content

Commit

Permalink
Increased maximum frame size to accomodate jumbo frames + some check …
Browse files Browse the repository at this point in the history
…we don't go over again.
  • Loading branch information
grossmj committed Feb 16, 2017
1 parent 85cd65c commit 2ec5441
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions hypervisor_iol_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ void *iol_nio_listener(void *data)
perror("recv");
break;
}

if (bytes_received > MAX_MTU) {
fprintf(stderr, "received frame is %zd bytes (maximum is %d bytes)\n", bytes_received, MAX_MTU);
continue;
}

nio->bytes_sent += bytes_received;

if (debug_level > 0) {
Expand Down
2 changes: 1 addition & 1 deletion nio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#define m_min(a,b) (((a) < (b)) ? (a) : (b))

#define NIO_MAX_PKT_SIZE 2048
#define NIO_MAX_PKT_SIZE 10000
#define NIO_DEV_MAXLEN 64

enum {
Expand Down
6 changes: 6 additions & 0 deletions ubridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ static void bridge_nios(nio_t *source_nio, nio_t *destination_nio, bridge_t *bri
perror("recv");
break;
}

if (bytes_received > NIO_MAX_PKT_SIZE) {
fprintf(stderr, "received frame is %zd bytes (maximum is %d bytes)\n", bytes_received, NIO_MAX_PKT_SIZE);
continue;
}

source_nio->bytes_sent += bytes_received;

if (debug_level > 0) {
Expand Down
2 changes: 1 addition & 1 deletion ubridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "nio.h"

#define NAME "ubridge"
#define VERSION "0.9.10"
#define VERSION "0.9.11"
#define CONFIG_FILE "ubridge.ini"

#ifndef FALSE
Expand Down

0 comments on commit 2ec5441

Please sign in to comment.