mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-20 19:44:56 +02:00
xt_mp2t: mark payload_ptr const and annotate
This commit is contained in:
@@ -899,7 +899,7 @@ detect_cc_drops(struct pid_data_t *pid_data, int8_t cc_curr,
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dissect_tsp(unsigned char *payload_ptr, u16 payload_len,
|
dissect_tsp(const unsigned char *payload_ptr, u16 payload_len,
|
||||||
const struct sk_buff *skb, struct mp2t_stream *stream)
|
const struct sk_buff *skb, struct mp2t_stream *stream)
|
||||||
{
|
{
|
||||||
__be32 header;
|
__be32 header;
|
||||||
@@ -909,7 +909,11 @@ dissect_tsp(unsigned char *payload_ptr, u16 payload_len,
|
|||||||
int skips = 0;
|
int skips = 0;
|
||||||
struct pid_data_t *pid_data;
|
struct pid_data_t *pid_data;
|
||||||
|
|
||||||
/* Process header*/
|
/*
|
||||||
|
* Process header. TSP headers come every MP2T_PACKET_SIZE bytes,
|
||||||
|
* which is a multiple of 32 bits, so not using get_unaligned
|
||||||
|
* is ok here.
|
||||||
|
*/
|
||||||
header = ntohl(*(u32 *)payload_ptr);
|
header = ntohl(*(u32 *)payload_ptr);
|
||||||
pid = (header & MP2T_PID_MASK) >> MP2T_PID_SHIFT;
|
pid = (header & MP2T_PID_MASK) >> MP2T_PID_SHIFT;
|
||||||
afc = (header & MP2T_AFC_MASK) >> MP2T_AFC_SHIFT;
|
afc = (header & MP2T_AFC_MASK) >> MP2T_AFC_SHIFT;
|
||||||
@@ -942,7 +946,7 @@ dissect_tsp(unsigned char *payload_ptr, u16 payload_len,
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dissect_mp2t(unsigned char *payload_ptr, u16 payload_len,
|
dissect_mp2t(const unsigned char *payload_ptr, u16 payload_len,
|
||||||
const struct sk_buff *skb, const struct udphdr *uh,
|
const struct sk_buff *skb, const struct udphdr *uh,
|
||||||
const struct xt_mp2t_mtinfo *info)
|
const struct xt_mp2t_mtinfo *info)
|
||||||
{
|
{
|
||||||
@@ -1034,7 +1038,7 @@ dissect_mp2t(unsigned char *payload_ptr, u16 payload_len,
|
|||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
is_mp2t_packet(unsigned char *payload_ptr, u16 payload_len)
|
is_mp2t_packet(const unsigned char *payload_ptr, u16 payload_len)
|
||||||
{
|
{
|
||||||
u16 offset = 0;
|
u16 offset = 0;
|
||||||
|
|
||||||
@@ -1073,7 +1077,7 @@ xt_mp2t_match(const struct sk_buff *skb, struct xt_action_param *par)
|
|||||||
u16 ulen;
|
u16 ulen;
|
||||||
u16 hdr_size;
|
u16 hdr_size;
|
||||||
u16 payload_len;
|
u16 payload_len;
|
||||||
unsigned char *payload_ptr;
|
const unsigned char *payload_ptr;
|
||||||
|
|
||||||
bool res = false;
|
bool res = false;
|
||||||
int skips = 0;
|
int skips = 0;
|
||||||
|
Reference in New Issue
Block a user