From 45a1170652384baf744a5e61d576af534c7b8b14 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 25 Jul 2013 18:30:52 +0100 Subject: [PATCH] site, netlink: abolish max_end_pad and min_end_pad There is much code to compute these values, but they are never used anywhere. Signed-off-by: Ian Jackson --- netlink.c | 5 +---- netlink.h | 1 - secnet.h | 11 ++++------- site.c | 4 +--- transform-cbcmac.c | 1 - transform-eax.c | 1 - udp.c | 1 - 7 files changed, 6 insertions(+), 18 deletions(-) diff --git a/netlink.c b/netlink.c index b2bd224..5d586d0 100644 --- a/netlink.c +++ b/netlink.c @@ -808,14 +808,12 @@ static void netlink_inst_set_mtu(void *sst, int32_t new_mtu) } static void netlink_inst_reg(void *sst, netlink_deliver_fn *deliver, - void *dst, int32_t max_start_pad, - int32_t max_end_pad) + void *dst, int32_t max_start_pad) { struct netlink_client *c=sst; struct netlink *st=c->nst; if (max_start_pad > st->max_start_pad) st->max_start_pad=max_start_pad; - if (max_end_pad > st->max_end_pad) st->max_end_pad=max_end_pad; c->deliver=deliver; c->dst=dst; } @@ -944,7 +942,6 @@ netlink_deliver_fn *netlink_init(struct netlink *st, st->cl.apply=netlink_inst_apply; st->cl.interface=st; st->max_start_pad=0; - st->max_end_pad=0; st->clients=NULL; st->routes=NULL; st->n_clients=0; diff --git a/netlink.h b/netlink.h index a7bc9af..5e6ad49 100644 --- a/netlink.h +++ b/netlink.h @@ -46,7 +46,6 @@ struct netlink { void *dst; /* Pointer to host interface state */ cstring_t name; int32_t max_start_pad; - int32_t max_end_pad; struct ipset *networks; /* Local networks */ struct subnet_list *subnets; /* Same as networks, for display */ struct ipset *remote_networks; /* Allowable remote networks */ diff --git a/secnet.h b/secnet.h index 0433c1e..46aac5b 100644 --- a/secnet.h +++ b/secnet.h @@ -326,7 +326,6 @@ typedef const char *comm_addr_to_string_fn(void *commst, struct comm_if { void *st; int32_t min_start_pad; - int32_t min_end_pad; comm_request_notify_fn *request_notify; comm_release_notify_fn *release_notify; comm_sendmsg_fn *sendmsg; @@ -364,8 +363,8 @@ struct site_if { /* TRANSFORM interface */ /* A reversable transformation. Transforms buffer in-place; may add - data to start or end. Maximum amount of data to be added specified - in max_start_pad and max_end_pad. (Reverse transformations decrease + data to start or end. Maximum amount of data to be added before + the packet specified in max_start_pad. (Reverse transformations decrease length, of course.) Transformations may be key-dependent, in which case key material is passed in at initialisation time. They may also depend on internal factors (eg. time) and keep internal @@ -401,8 +400,7 @@ struct transform_inst_if { struct transform_if { void *st; - int32_t max_start_pad; /* these three are all <<< INT_MAX */ - int32_t max_end_pad; + int32_t max_start_pad; /* these two are both <<< INT_MAX */ int32_t keylen; /* 0 means give the transform exactly as much as there is */ transform_createinstance_fn *create; }; @@ -425,8 +423,7 @@ typedef void netlink_deliver_fn(void *st, struct buffer_if *buf); #define MAXIMUM_LINK_QUALITY 3 typedef void netlink_link_quality_fn(void *st, uint32_t quality); typedef void netlink_register_fn(void *st, netlink_deliver_fn *deliver, - void *dst, int32_t max_start_pad, - int32_t max_end_pad); + void *dst, int32_t max_start_pad); typedef void netlink_output_config_fn(void *st, struct buffer_if *buf); typedef bool_t netlink_check_config_fn(void *st, struct buffer_if *buf); typedef void netlink_set_mtu_fn(void *st, int32_t new_mtu); diff --git a/site.c b/site.c index f9a005a..2cb53f6 100644 --- a/site.c +++ b/site.c @@ -1703,13 +1703,11 @@ static list_t *site_apply(closure_t *self, struct cloc loc, dict_t *context, worst_##pad=thispad; \ } COMPUTE_WORST(min_start_pad) - COMPUTE_WORST(min_end_pad) /* We need to register the remote networks with the netlink device */ st->netlink->reg(st->netlink->st, site_outgoing, st, st->transform->max_start_pad+(4*4)+ - worst_min_start_pad, - st->transform->max_end_pad+worst_min_end_pad); + worst_min_start_pad); for (i=0; incomms; i++) st->comms[i]->request_notify(st->comms[i]->st, st, site_incoming); diff --git a/transform-cbcmac.c b/transform-cbcmac.c index 5fb66ba..6920165 100644 --- a/transform-cbcmac.c +++ b/transform-cbcmac.c @@ -263,7 +263,6 @@ static list_t *transform_apply(closure_t *self, struct cloc loc, st->ops.st=st; st->ops.max_start_pad=28; /* 4byte seqnum, 16byte pad, 4byte MACIV, 4byte IV */ - st->ops.max_end_pad=16; /* 16byte CBCMAC */ /* We need 256*2 bits for serpent keys, 32 bits for CBC-IV and 32 bits for CBCMAC-IV, and 32 bits for init sequence number */ diff --git a/transform-eax.c b/transform-eax.c index 5c7a120..89c46c8 100644 --- a/transform-eax.c +++ b/transform-eax.c @@ -293,7 +293,6 @@ static list_t *transform_apply(closure_t *self, struct cloc loc, st->p.padding_mask = padding_round-1; st->ops.max_start_pad=0; - st->ops.max_end_pad= padding_round + st->p.tag_length + SEQLEN; st->ops.keylen=0; st->ops.create=transform_create; diff --git a/udp.c b/udp.c index 483ed37..12fcfe8 100644 --- a/udp.c +++ b/udp.c @@ -289,7 +289,6 @@ static list_t *udp_apply(closure_t *self, struct cloc loc, dict_t *context, st->cl.interface=&st->ops; st->ops.st=st; st->ops.min_start_pad=0; - st->ops.min_end_pad=0; st->ops.request_notify=request_notify; st->ops.release_notify=release_notify; st->ops.sendmsg=udp_sendmsg; -- 2.30.2