Fix integer types mismatch for flags field in nat64stl_cfg structure.

Also preserve internal flags on NAT64STL reconfiguration.

Obtained from:	Yandex LLC
MFC after:	1 week
Sponsored by:	Yandex LLC
This commit is contained in:
Andrey V. Elsukov 2018-04-12 21:29:40 +00:00
parent fc774835cb
commit 2d8fcffb99
2 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ struct nat64stl_cfg {
struct in6_addr prefix6;/* IPv6 prefix */
uint8_t plen6; /* prefix length */
uint8_t flags; /* flags for internal use */
uint32_t flags; /* flags for internal use */
#define NAT64STL_KIDX 0x0100
#define NAT64STL_46T 0x0200
#define NAT64STL_64T 0x0400

View File

@ -289,8 +289,8 @@ nat64stl_config(struct ip_fw_chain *ch, ip_fw3_opheader *op,
* For now allow to change only following values:
* flags.
*/
cfg->flags = uc->flags & NAT64STL_FLAGSMASK;
cfg->flags &= ~NAT64STL_FLAGSMASK;
cfg->flags |= uc->flags & NAT64STL_FLAGSMASK;
IPFW_UH_WUNLOCK(ch);
return (0);
}