[PATCH 21/25] site, netlink: abolish max_end_pad and min_end_pad
Ian Jackson
ijackson at chiark.greenend.org.uk
Sat Jul 20 00:39:05 BST 2013
There is much code to compute these values, but they are never used
anywhere.
Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
---
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 486df6f..f94058a 100644
--- a/netlink.c
+++ b/netlink.c
@@ -811,14 +811,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;
}
@@ -947,7 +945,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 ffefd80..c89cc63 100644
--- a/netlink.h
+++ b/netlink.h
@@ -42,7 +42,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 af0c1f7..41578b4 100644
--- a/secnet.h
+++ b/secnet.h
@@ -341,7 +341,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;
@@ -379,8 +378,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
@@ -416,8 +415,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;
};
@@ -440,8 +438,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 eb8460a..817d5e4 100644
--- a/site.c
+++ b/site.c
@@ -1661,13 +1661,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; i<st->ncomms; i++)
st->comms[i]->request_notify(st->comms[i]->st, st, site_incoming);
diff --git a/transform-cbcmac.c b/transform-cbcmac.c
index b163d33..5640ad8 100644
--- a/transform-cbcmac.c
+++ b/transform-cbcmac.c
@@ -264,7 +264,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 506f05d..f126408 100644
--- a/transform-eax.c
+++ b/transform-eax.c
@@ -238,7 +238,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 77be5b1..ba110fc 100644
--- a/udp.c
+++ b/udp.c
@@ -290,7 +290,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;
--
1.7.2.5
More information about the sgo-software-discuss
mailing list