diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-11-25 23:33:50 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-11-25 23:33:50 +0100 |
commit | d80d3c03a1b7d8e1badabe4c88db570cf776c2e5 (patch) | |
tree | 33b07372724c3911c9eb4a25576fb096c7d21d1e | |
parent | 4f0ecfcc2d048dd57fdd8ba007dd75556864e66f (diff) | |
parent | bb8e28248be0ad1f728433e4884dfe2db3772b30 (diff) |
Merge commit 'bb8e2824' into wireguard-next-tmp7-1
-rw-r--r-- | conf/cf-lex.l | 4 | ||||
-rw-r--r-- | conf/conf.h | 4 | ||||
-rw-r--r-- | conf/confbase.Y | 2 | ||||
-rw-r--r-- | filter/data.c | 2 | ||||
-rw-r--r-- | filter/data.h | 2 | ||||
-rw-r--r-- | filter/f-inst.c | 4 | ||||
-rw-r--r-- | proto/radv/config.Y | 2 | ||||
-rw-r--r-- | proto/radv/radv.h | 2 |
8 files changed, 9 insertions, 13 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 92a25c67..6ac3ab20 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -246,7 +246,7 @@ WHITE [ \t] ({XIGIT}{2}){16,}|{XIGIT}{2}(:{XIGIT}{2}){15,}|hex:({XIGIT}{2}(:?{XIGIT}{2})*)? { char *s = yytext; - struct bytestring *bs; + struct adata *bs; /* Skip 'hex:' prefix */ if (s[0] == 'h' && s[1] == 'e' && s[2] == 'x' && s[3] == ':') @@ -256,7 +256,7 @@ WHITE [ \t] if (len < 0) cf_error("Invalid hex string"); - bs = cfg_allocz(sizeof(struct bytestring) + len); + bs = cfg_allocz(sizeof(struct adata) + len); bs->length = bstrhextobin(s, bs->data); ASSERT(bs->length == len); diff --git a/conf/conf.h b/conf/conf.h index c301df1d..486499ad 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -154,10 +154,6 @@ extern struct sym_scope *global_root_scope; extern pool *global_root_scope_pool; extern linpool *global_root_scope_linpool; -struct bytestring { - size_t length; - byte data[]; -}; #define SYM_MAX_LEN 64 diff --git a/conf/confbase.Y b/conf/confbase.Y index 7b368fc6..0364bc6e 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -94,7 +94,7 @@ CF_DECLS struct channel_limit cl; struct timeformat *tf; mpls_label_stack *mls; - const struct bytestring *bs; + const struct adata *bs; } %token END CLI_MARKER INVALID_TOKEN ELSECOL DDOT diff --git a/filter/data.c b/filter/data.c index a847d414..d01b5764 100644 --- a/filter/data.c +++ b/filter/data.c @@ -216,7 +216,7 @@ val_compare(const struct f_val *v1, const struct f_val *v2) } static inline int -bs_same(const struct bytestring *bs1, const struct bytestring *bs2) +bs_same(const struct adata *bs1, const struct adata *bs2) { return (bs1->length == bs2->length) && !memcmp(bs1->data, bs2->data, bs1->length); } diff --git a/filter/data.h b/filter/data.h index 874c269a..fa8503d5 100644 --- a/filter/data.h +++ b/filter/data.h @@ -87,7 +87,7 @@ struct f_val { ip_addr ip; const net_addr *net; const char *s; - const struct bytestring *bs; + const struct adata *bs; const struct f_tree *t; const struct f_trie *ti; const struct adata *ad; diff --git a/filter/f-inst.c b/filter/f-inst.c index e81bc2fb..17e1e767 100644 --- a/filter/f-inst.c +++ b/filter/f-inst.c @@ -1601,8 +1601,8 @@ if (len < 0) runtime("Invalid hex string"); - struct bytestring *bs; - bs = falloc(sizeof(struct bytestring) + len); + struct adata *bs; + bs = falloc(sizeof(struct adata) + len); bs->length = bstrhextobin(v1.val.s, bs->data); ASSERT(bs->length == (size_t) len); diff --git a/proto/radv/config.Y b/proto/radv/config.Y index c57752d9..3a898b8d 100644 --- a/proto/radv/config.Y +++ b/proto/radv/config.Y @@ -26,7 +26,7 @@ static list radv_dns_list; /* Used by radv_rdnss and radv_dnssl */ static u8 radv_mult_val; /* Used by radv_mult for second return value */ static inline void -radv_add_to_custom_list(list *l, int type, const struct bytestring *payload) +radv_add_to_custom_list(list *l, int type, const struct adata *payload) { if (type < 0 || type > 255) cf_error("RA cusom type must be in range 0-255"); struct radv_custom_config *cf = cfg_allocz(sizeof(struct radv_custom_config)); diff --git a/proto/radv/radv.h b/proto/radv/radv.h index 2baf0bad..ba4a1b6c 100644 --- a/proto/radv/radv.h +++ b/proto/radv/radv.h @@ -129,7 +129,7 @@ struct radv_custom_config { node n; u8 type; /* Identifier of the type of option */ - const struct bytestring *payload; /* Payload of the option */ + const struct adata *payload; /* Payload of the option */ }; /* |