search for: get_u32

Displaying 10 results from an estimated 10 matches for "get_u32".

Did you mean: get_32
2003 Sep 18
0
hexadecimal fwmark and fwmark mask
...mal values in ip(8) while iptables(8) allows to either use decimal or hexadecimal value is quite inconsistent. I checked ip(8) sources, and here is the point : } else if (strcmp(*argv, "fwmark") == 0) { __u32 fwmark; NEXT_ARG(); if (get_u32(&fwmark, *argv, 16)) invarg("fwmark value is invalid\n", *argv); addattr32(&req.n, sizeof(req), RTA_PROTOINFO, fwmark); get_u32() function just call strtoul(3) among a few sanity checks, and the third parameter (value 16 here) is the base u...
2023 Jun 19
1
[Bridge] [PATCH iproute2-next 1/1] iplink: bridge: Add support for bridge FDB learning limits
...9,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, bm.optval |= no_ll_learn_bit; else bm.optval &= ~no_ll_learn_bit; + } else if (matches(*argv, "fdb_max_learned_entries") == 0) { + __u32 fdb_max_learned_entries; + + NEXT_ARG(); + if (get_u32(&fdb_max_learned_entries, *argv, 0)) + invarg("invalid fdb_max_learned_entries", *argv); + + addattr32(n, 1024, IFLA_BR_FDB_MAX_LEARNED_ENTRIES, fdb_max_learned_entries); } else if (matches(*argv, "fdb_flush") == 0) { addattr(n, 1024, IFLA_BR_FDB_FLUSH); } els...
2023 Sep 05
1
[Bridge] [PATCH iproute2-next v3] iplink: bridge: Add support for bridge FDB learning limits
...69,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, bm.optval |= no_ll_learn_bit; else bm.optval &= ~no_ll_learn_bit; + } else if (strcmp(*argv, "fdb_max_learned_entries") == 0) { + __u32 fdb_max_learned_entries; + + NEXT_ARG(); + if (get_u32(&fdb_max_learned_entries, *argv, 0)) + invarg("invalid fdb_max_learned_entries", *argv); + + addattr32(n, 1024, IFLA_BR_FDB_MAX_LEARNED_ENTRIES, fdb_max_learned_entries); } else if (matches(*argv, "fdb_flush") == 0) { addattr(n, 1024, IFLA_BR_FDB_FLUSH); } els...
2016 Dec 19
0
[ANNOUNCE] libnftnl 1.0.7 release
...rule dumping Laura Garcia Liebana (5): expr: add hash expression expr: add number generation expression expr: numgen: Rename until attribute by modulus expr: hash: Add offset to hash value expr: numgen: add number generation offset Liping Zhang (7): trace: use get_u32 to parse NFPROTO and POLICY attribute expr: queue: remove redundant NFTNL_EXPR_QUEUE_NUM set in json parse tests: queue: add missing NFTNL_EXPR_QUEUE_FLAGS compare test expr: queue: add NFTA_QUEUE_SREG_QNUM attr support expr: log: fix typo in nftnl_expr_log_export expr...
2023 Oct 18
3
[Bridge] [PATCH iproute2-next v5] iplink: bridge: Add support for bridge FDB learning limits
...ot; @@ -168,6 +169,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, bm.optval |= no_ll_learn_bit; else bm.optval &= ~no_ll_learn_bit; + } else if (strcmp(*argv, "fdb_max_learned") == 0) { + __u32 fdb_max_learned; + + NEXT_ARG(); + if (get_u32(&fdb_max_learned, *argv, 0)) + invarg("invalid fdb_max_learned", *argv); + + addattr32(n, 1024, IFLA_BR_FDB_MAX_LEARNED, fdb_max_learned); } else if (matches(*argv, "fdb_flush") == 0) { addattr(n, 1024, IFLA_BR_FDB_FLUSH); } else if (matches(*argv, "vlan_...
2023 Jun 19
4
[Bridge] [PATCH net-next v2 0/3, iproute2-next 0/1] bridge: Add a limit on learned FDB entries
Introduce a limit on the amount of learned FDB entries on a bridge, configured by netlink with a build time default on bridge creation in the kernel config. For backwards compatibility the kernel config default is disabling the limit (0). Without any limit a malicious actor may OOM a kernel by spamming packets with changing MAC addresses on their bridge port, so allow the bridge creator to limit
2007 Apr 17
0
8 commits - configure.ac doc/Makefile.am libswfdec/jpeg libswfdec/swfdec_debug.h libswfdec/swfdec_image.c
...16(bits_t *b) -{ - unsigned int r; - - r = b->ptr[0] | (b->ptr[1]<<8); - b->ptr+=2; - - return r; -} - -static inline unsigned int get_be_u16(bits_t *b) -{ - unsigned int r; - - r = (b->ptr[0]<<8) | b->ptr[1]; - b->ptr+=2; - - return r; -} - -static inline unsigned int get_u32(bits_t *b) -{ - unsigned int r; - - r = b->ptr[0] | (b->ptr[1]<<8) | (b->ptr[2]<<16) | (b->ptr[3]<<24); - b->ptr+=4; - - return r; -} - -static inline void syncbits(bits_t *b) -{ - if(b->idx){ - b->ptr++; - b->idx=0; - } - -} - -#endif - diff --git a/libs...
2007 Feb 13
0
libswfdec/jpeg libswfdec/swfdec_image.c
...u16 (bits_t * b) +static inline unsigned int get_be_u16(bits_t *b) { - unsigned int r; + unsigned int r; - r = (b->ptr[0] << 8) | b->ptr[1]; - b->ptr += 2; + r = (b->ptr[0]<<8) | b->ptr[1]; + b->ptr+=2; - return r; + return r; } -static inline unsigned int -get_u32 (bits_t * b) +static inline unsigned int get_u32(bits_t *b) { - unsigned int r; + unsigned int r; - r = b->ptr[0] | (b->ptr[1] << 8) | (b->ptr[2] << 16) | (b->ptr[3] << 24); - b->ptr += 4; + r = b->ptr[0] | (b->ptr[1]<<8) | (b->ptr[2]<<16)...
2010 Jan 14
1
ssh(1) multiplexing rewrite
...(c->rfd, readset) && + (c->istate == CHAN_INPUT_OPEN || + c->istate == CHAN_INPUT_WAIT_DRAIN)) { + /* + * Don't not read past the precise end of packets to + * avoid disrupting fd passing. + */ + if (read_mux(c, 4) < 4) /* read header */ + return; + need = get_u32(buffer_ptr(&c->input)); +#define CHANNEL_MUX_MAX_PACKET (256 * 1024) + if (need > CHANNEL_MUX_MAX_PACKET) { + debug2("channel %d: packet too big %u > %u", + c->self, CHANNEL_MUX_MAX_PACKET, need); + chan_rcvd_oclose(c); + return; + } + if (read_mux(c, need +...
2006 Mar 02
33
Patch to allow for the ATM "cell tax"
...8(&overhead, *argv, 10)) { + if (get_u8(&overhead, *argv, 10) || (overhead & 1)) { explain1("overhead"); return -1; } + } else if (matches(*argv, "atm") == 0) { + atm = 1; } else if (matches(*argv, "quantum") == 0) { NEXT_ARG(); if (get_u32(&opt.quantum, *argv, 10)) { @@ -515,7 +518,7 @@ if (!cbuffer) cbuffer = opt.ceil.rate / get_hz() + mtu; /* encode overhead and mpu, 8 bits each, into lower 16 bits */ - mpu = (unsigned)mpu8 | (unsigned)overhead << 8; + mpu = (unsigned)mpu8 | (unsigned)(overhead + atm) << 8; o...