Skip to contentSkip to conversation

pgsql: correct `ulog2.ip_totlen` type

PATCH In review Jeremy Sowden 2 participants 2 messages Nov 29, 2022 – Dec 8, 2022 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pgsql: correct `ulog2.ip_totlen` type

The types of ip_totlen in the ulog view and the INSERT_IP_PACKET_FULL function are integer, but the column in the ulog2 table is smallint. The "total length" field of an IP packet is an unsigned 16-bit integer, whereas smallint in PostgreSQL is a signed 16-bit integer type. Change the type of ulog2.ip_totlen to integer.

---
 doc/pgsql-ulogd2-flat.sql | 2 +-
 doc/pgsql-ulogd2.sql      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
doc/pgsql-ulogd2-flat.sql +1 -1
index 6cd2150cd96b..94c903795ede 100644
@@ -43,7 +43,7 @@ CREATE TABLE ulog2 (
   ip_protocol smallint default NULL,
   ip_tos smallint default NULL,
   ip_ttl smallint default NULL,
-  ip_totlen smallint default NULL,
+  ip_totlen integer default NULL,
   ip_ihl smallint default NULL,
   ip_csum integer default NULL,
   ip_id integer default NULL,
doc/pgsql-ulogd2.sql +1 -1
index 0e01ba4ba57d..edc81e760768 100644
@@ -55,7 +55,7 @@ CREATE TABLE ulog2 (
   ip_protocol smallint default NULL,
   ip_tos smallint default NULL,
   ip_ttl smallint default NULL,
-  ip_totlen smallint default NULL,
+  ip_totlen integer default NULL,
   ip_ihl smallint default NULL,
   ip_csum integer default NULL,
   ip_id integer default NULL,
Signature · 1 line
2.35.1
#1 lore raw
Quoted 5 lines · Jeremy Sowden

The types of ip_totlen in the ulog view and the INSERT_IP_PACKET_FULL function are integer, but the column in the ulog2 table is smallint. The "total length" field of an IP packet is an unsigned 16-bit integer, whereas smallint in PostgreSQL is a signed 16-bit integer type. Change the type of ulog2.ip_totlen to integer.

Also applied this to ulogd2, thanks.