diff options
-rw-r--r-- | include/osmo-pcap/osmo_pcap_server.h | 6 | ||||
-rw-r--r-- | src/osmo_server_network.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/osmo-pcap/osmo_pcap_server.h b/include/osmo-pcap/osmo_pcap_server.h index 1f2f6fc..edb29d3 100644 --- a/include/osmo-pcap/osmo_pcap_server.h +++ b/include/osmo-pcap/osmo_pcap_server.h @@ -23,6 +23,8 @@ #ifndef OSMO_PCAP_SERVER_H #define OSMO_PCAP_SERVER_H +#include "wireformat.h" + #include <osmocom/core/select.h> #include <osmocom/core/linuxlist.h> @@ -40,6 +42,8 @@ struct osmo_pcap_server; #define STATE_INITIAL 0 #define STATE_DATA 1 +#define SERVER_MAX_DATA_SIZE 10000 + struct osmo_pcap_conn { /* list of connections */ struct llist_head entry; @@ -64,7 +68,7 @@ struct osmo_pcap_conn { int state; int pend; int reopen; - char buf[4096]; + char buf[SERVER_MAX_DATA_SIZE + sizeof(struct osmo_pcap_data)]; struct osmo_pcap_data *data; }; diff --git a/src/osmo_server_network.c b/src/osmo_server_network.c index 78cda94..7127401 100644 --- a/src/osmo_server_network.c +++ b/src/osmo_server_network.c @@ -199,7 +199,7 @@ static int read_cb_initial(struct osmo_fd *fd, struct osmo_pcap_conn *conn) } else if (conn->pend == 0) { conn->data->len = ntohs(conn->data->len); - if (conn->data->len > 2000) { + if (conn->data->len > SERVER_MAX_DATA_SIZE) { LOGP(DSERVER, LOGL_ERROR, "Implausible data length: %u\n", conn->data->len); close_connection(conn); |