229 lines
8.5 KiB
Diff
Executable File
229 lines
8.5 KiB
Diff
Executable File
Index: libnl-2.0/include/netlink/netfilter/ct.h
|
|
===================================================================
|
|
--- libnl-2.0.orig/include/netlink/netfilter/ct.h 2010-10-13 22:43:44.000000000 +0800
|
|
+++ libnl-2.0/include/netlink/netfilter/ct.h 2018-09-01 14:05:48.632850391 +0800
|
|
@@ -77,6 +77,10 @@
|
|
extern int nfnl_ct_test_mark(const struct nfnl_ct *);
|
|
extern uint32_t nfnl_ct_get_mark(const struct nfnl_ct *);
|
|
|
|
+extern void nfnl_ct_set_zextmark(struct nfnl_ct *, uint32_t);
|
|
+extern int nfnl_ct_test_zextmark(const struct nfnl_ct *);
|
|
+extern uint32_t nfnl_ct_get_zextmark(const struct nfnl_ct *);
|
|
+
|
|
extern void nfnl_ct_set_use(struct nfnl_ct *, uint32_t);
|
|
extern int nfnl_ct_test_use(const struct nfnl_ct *);
|
|
extern uint32_t nfnl_ct_get_use(const struct nfnl_ct *);
|
|
Index: libnl-2.0/include/netlink/netfilter/queue_msg.h
|
|
===================================================================
|
|
--- libnl-2.0.orig/include/netlink/netfilter/queue_msg.h 2010-10-13 22:43:44.000000000 +0800
|
|
+++ libnl-2.0/include/netlink/netfilter/queue_msg.h 2018-09-01 14:05:48.632850391 +0800
|
|
@@ -52,6 +52,10 @@
|
|
extern int nfnl_queue_msg_test_hook(const struct nfnl_queue_msg *);
|
|
extern uint8_t nfnl_queue_msg_get_hook(const struct nfnl_queue_msg *);
|
|
|
|
+extern void nfnl_queue_msg_set_zextmark(struct nfnl_queue_msg *, uint32_t);
|
|
+extern int nfnl_queue_msg_test_zextmark(const struct nfnl_queue_msg *);
|
|
+extern uint32_t nfnl_queue_msg_get_zextmark(const struct nfnl_queue_msg *);
|
|
+
|
|
extern void nfnl_queue_msg_set_mark(struct nfnl_queue_msg *, uint32_t);
|
|
extern int nfnl_queue_msg_test_mark(const struct nfnl_queue_msg *);
|
|
extern uint32_t nfnl_queue_msg_get_mark(const struct nfnl_queue_msg *);
|
|
Index: libnl-2.0/include/linux/netfilter/nfnetlink_queue.h
|
|
===================================================================
|
|
--- libnl-2.0.orig/include/linux/netfilter/nfnetlink_queue.h 2018-09-01 14:05:48.624850391 +0800
|
|
+++ libnl-2.0/include/linux/netfilter/nfnetlink_queue.h 2018-09-01 14:05:48.632850391 +0800
|
|
@@ -38,6 +38,7 @@
|
|
NFQA_PACKET_HDR,
|
|
NFQA_VERDICT_HDR, /* nfqnl_msg_verdict_hrd */
|
|
NFQA_MARK, /* u_int32_t nfmark */
|
|
+ NFQA_ZEXTMARK, /* u_int32_t nfmark */
|
|
NFQA_TIMESTAMP, /* nfqnl_msg_packet_timestamp */
|
|
NFQA_IFINDEX_INDEV, /* u_int32_t ifindex */
|
|
NFQA_IFINDEX_OUTDEV, /* u_int32_t ifindex */
|
|
@@ -45,7 +46,6 @@
|
|
NFQA_IFINDEX_PHYSOUTDEV, /* u_int32_t ifindex */
|
|
NFQA_HWADDR, /* nfqnl_msg_packet_hw */
|
|
NFQA_PAYLOAD, /* opaque data payload */
|
|
- NFQA_ZEXTMARK, /* u_int32_t nfmark */
|
|
|
|
__NFQA_MAX
|
|
};
|
|
Index: libnl-2.0/include/linux/netfilter/nfnetlink_conntrack.h
|
|
===================================================================
|
|
--- libnl-2.0.orig/include/linux/netfilter/nfnetlink_conntrack.h 2018-09-01 14:05:48.624850391 +0800
|
|
+++ libnl-2.0/include/linux/netfilter/nfnetlink_conntrack.h 2018-09-01 14:12:36.709803366 +0800
|
|
@@ -31,12 +31,23 @@
|
|
#define CTA_NAT CTA_NAT_SRC /* backwards compatibility */
|
|
CTA_TIMEOUT,
|
|
CTA_MARK,
|
|
- CTA_ZEXTMARK,
|
|
CTA_COUNTERS_ORIG,
|
|
CTA_COUNTERS_REPLY,
|
|
CTA_USE,
|
|
CTA_ID,
|
|
CTA_NAT_DST,
|
|
+ CTA_TUPLE_MASTER,
|
|
+ CTA_NAT_SEQ_ADJ_ORIG,
|
|
+ CTA_NAT_SEQ_ADJ_REPLY,
|
|
+ CTA_SECMARK, /* obsolete */
|
|
+ CTA_ZONE,
|
|
+ CTA_SECCTX,
|
|
+ CTA_TIMESTAMP,
|
|
+ CTA_MARK_MASK,
|
|
+ CTA_LABELS,
|
|
+ CTA_LABELS_MASK,
|
|
+ CTA_ZEXTMARK, // zyxel jessy 20180621
|
|
+ CTA_ZEXTMARK_MASK, // zyxel jessy 20180621
|
|
__CTA_MAX
|
|
};
|
|
#define CTA_MAX (__CTA_MAX - 1)
|
|
Index: libnl-2.0/include/netlink-types.h
|
|
===================================================================
|
|
--- libnl-2.0.orig/include/netlink-types.h 2018-09-01 14:05:48.624850391 +0800
|
|
+++ libnl-2.0/include/netlink-types.h 2018-09-01 14:05:48.636850391 +0800
|
|
@@ -781,6 +781,7 @@
|
|
uint8_t log_msg_hook;
|
|
uint16_t log_msg_hwproto;
|
|
uint32_t log_msg_mark;
|
|
+ uint32_t log_msg_zextmark;
|
|
struct timeval log_msg_timestamp;
|
|
uint32_t log_msg_indev;
|
|
uint32_t log_msg_outdev;
|
|
Index: libnl-2.0/lib/netfilter/ct.c
|
|
===================================================================
|
|
--- libnl-2.0.orig/lib/netfilter/ct.c 2018-09-01 14:05:48.624850391 +0800
|
|
+++ libnl-2.0/lib/netfilter/ct.c 2018-09-01 15:24:54.280810014 +0800
|
|
@@ -51,6 +51,9 @@
|
|
//[CTA_NAT_SRC]
|
|
[CTA_TIMEOUT] = { .type = NLA_U32 },
|
|
[CTA_MARK] = { .type = NLA_U32 },
|
|
+#ifdef ZYXEL_EXT_MARK
|
|
+ [CTA_ZEXTMARK] = { .type = NLA_U32 },
|
|
+#endif
|
|
[CTA_COUNTERS_ORIG] = { .type = NLA_NESTED },
|
|
[CTA_COUNTERS_REPLY] = { .type = NLA_NESTED },
|
|
[CTA_USE] = { .type = NLA_U32 },
|
|
@@ -330,9 +333,9 @@
|
|
if (tb[CTA_MARK])
|
|
nfnl_ct_set_mark(ct, ntohl(nla_get_u32(tb[CTA_MARK])));
|
|
#ifdef ZYXEL_EXT_MARK
|
|
if (tb[CTA_ZEXTMARK])
|
|
- nfnl_ct_set_mark(ct, ntohl(nla_get_u32(tb[CTA_ZEXTMARK])));
|
|
+ nfnl_ct_set_zextmark(ct, ntohl(nla_get_u32(tb[CTA_ZEXTMARK])));
|
|
#endif
|
|
if (tb[CTA_USE])
|
|
nfnl_ct_set_use(ct, ntohl(nla_get_u32(tb[CTA_USE])));
|
|
if (tb[CTA_ID])
|
|
Index: libnl-2.0/lib/netfilter/ct_obj.c
|
|
===================================================================
|
|
--- libnl-2.0.orig/lib/netfilter/ct_obj.c 2018-09-01 14:05:48.624850391 +0800
|
|
+++ libnl-2.0/lib/netfilter/ct_obj.c 2018-09-01 15:25:34.212809674 +0800
|
|
@@ -193,6 +193,10 @@
|
|
if (nfnl_ct_test_mark(ct) && nfnl_ct_get_mark(ct))
|
|
nl_dump(p, "mark %u ", nfnl_ct_get_mark(ct));
|
|
|
|
+#ifdef ZYXEL_EXT_MARK
|
|
+ if (nfnl_ct_test_zextmark(ct) && nfnl_ct_get_zextmark(ct))
|
|
+ nl_dump(p, "zextmark %u ", nfnl_ct_get_zextmark(ct));
|
|
+#endif
|
|
nl_dump(p, "\n");
|
|
}
|
|
|
|
Index: libnl-2.0/lib/netfilter/log_msg.c
|
|
===================================================================
|
|
--- libnl-2.0.orig/lib/netfilter/log_msg.c 2010-10-13 22:43:45.000000000 +0800
|
|
+++ libnl-2.0/lib/netfilter/log_msg.c 2018-09-01 14:05:48.636850391 +0800
|
|
@@ -44,6 +44,9 @@
|
|
.minlen = sizeof(struct nfulnl_msg_packet_hdr)
|
|
},
|
|
[NFULA_MARK] = { .type = NLA_U32 },
|
|
+#ifdef ZYXEL_EXT_MARK
|
|
+ [NFULA_ZEXTMARK] = { .type = NLA_U32 },
|
|
+#endif
|
|
[NFULA_TIMESTAMP] = {
|
|
.minlen = sizeof(struct nfulnl_msg_packet_timestamp)
|
|
},
|
|
@@ -95,6 +98,11 @@
|
|
if (attr)
|
|
nfnl_log_msg_set_mark(msg, ntohl(nla_get_u32(attr)));
|
|
|
|
+#ifdef ZYXEL_EXT_MARK
|
|
+ attr = tb[NFULA_ZEXTMARK];
|
|
+ if (attr)
|
|
+ nfnl_log_msg_set_zextmark(msg, ntohl(nla_get_u32(attr)));
|
|
+#endif
|
|
attr = tb[NFULA_TIMESTAMP];
|
|
if (attr) {
|
|
struct nfulnl_msg_packet_timestamp *timestamp = nla_data(attr);
|
|
Index: libnl-2.0/lib/netfilter/log_msg_obj.c
|
|
===================================================================
|
|
--- libnl-2.0.orig/lib/netfilter/log_msg_obj.c 2010-10-13 22:43:45.000000000 +0800
|
|
+++ libnl-2.0/lib/netfilter/log_msg_obj.c 2018-09-01 15:25:20.056809794 +0800
|
|
@@ -33,6 +33,7 @@
|
|
#define LOG_MSG_ATTR_GID (1UL << 13)
|
|
#define LOG_MSG_ATTR_SEQ (1UL << 14)
|
|
#define LOG_MSG_ATTR_SEQ_GLOBAL (1UL << 15)
|
|
+#define LOG_MSG_ATTR_ZEXTMARK (1UL << 16)
|
|
/** @endcond */
|
|
|
|
static void log_msg_free_data(struct nl_object *c)
|
|
@@ -151,6 +152,10 @@
|
|
if (msg->ce_mask & LOG_MSG_ATTR_MARK)
|
|
nl_dump(p, "MARK=%u ", msg->log_msg_mark);
|
|
|
|
+#ifdef ZYXEL_EXT_MARK
|
|
+ if (msg->ce_mask & LOG_MSG_ATTR_ZEXTMARK)
|
|
+ nl_dump(p, "ZEXTMARK=%u ", msg->log_msg_zextmark);
|
|
+#endif
|
|
if (msg->ce_mask & LOG_MSG_ATTR_PAYLOAD)
|
|
nl_dump(p, "PAYLOADLEN=%d ", msg->log_msg_payload_len);
|
|
|
|
@@ -258,6 +263,23 @@
|
|
return msg->log_msg_mark;
|
|
}
|
|
|
|
+#ifdef ZYXEL_EXT_MARK
|
|
+void nfnl_log_msg_set_zextmark(struct nfnl_log_msg *msg, uint32_t mark)
|
|
+{
|
|
+ msg->log_msg_zextmark = mark;
|
|
+ msg->ce_mask |= LOG_MSG_ATTR_ZEXTMARK;
|
|
+}
|
|
+
|
|
+int nfnl_log_msg_test_zextmark(const struct nfnl_log_msg *msg)
|
|
+{
|
|
+ return !!(msg->ce_mask & LOG_MSG_ATTR_ZEXTMARK);
|
|
+}
|
|
+
|
|
+uint32_t nfnl_log_msg_get_zextmark(const struct nfnl_log_msg *msg)
|
|
+{
|
|
+ return msg->log_msg_zextmark;
|
|
+}
|
|
+#endif
|
|
void nfnl_log_msg_set_timestamp(struct nfnl_log_msg *msg, struct timeval *tv)
|
|
{
|
|
msg->log_msg_timestamp.tv_sec = tv->tv_sec;
|
|
Index: libnl-2.0/lib/netfilter/queue_msg_obj.c
|
|
===================================================================
|
|
--- libnl-2.0.orig/lib/netfilter/queue_msg_obj.c 2018-09-01 14:05:48.624850391 +0800
|
|
+++ libnl-2.0/lib/netfilter/queue_msg_obj.c 2018-09-01 14:05:48.636850391 +0800
|
|
@@ -30,7 +30,7 @@
|
|
#define QUEUE_MSG_ATTR_HWADDR (1UL << 11)
|
|
#define QUEUE_MSG_ATTR_PAYLOAD (1UL << 12)
|
|
#define QUEUE_MSG_ATTR_VERDICT (1UL << 13)
|
|
-#define QUEUE_MSG_ATTR_ZEXTMARK (1UL << 14) //Zyxel, Rune
|
|
+#define QUEUE_MSG_ATTR_ZEXTMARK (1UL << 26) //Zyxel, Rune
|
|
/** @endcond */
|
|
|
|
static void nfnl_queue_msg_free_data(struct nl_object *c)
|
|
@@ -141,6 +141,10 @@
|
|
if (msg->ce_mask & QUEUE_MSG_ATTR_MARK)
|
|
nl_dump(p, "MARK=%d ", msg->queue_msg_mark);
|
|
|
|
+#ifdef ZYXEL_EXT_MARK
|
|
+ if (msg->ce_mask & QUEUE_MSG_ATTR_ZEXTMARK)
|
|
+ nl_dump(p, "ZEXTMARK=%d ", msg->queue_msg_zextmark);
|
|
+#endif
|
|
if (msg->ce_mask & QUEUE_MSG_ATTR_PAYLOAD)
|
|
nl_dump(p, "PAYLOADLEN=%d ", msg->queue_msg_payload_len);
|
|
|