chiark / gitweb /
site, netlink: abolish max_end_pad and min_end_pad
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Jul 2013 17:30:52 +0000 (18:30 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Jul 2013 17:30:52 +0000 (18:30 +0100)
There is much code to compute these values, but they are never used
anywhere.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
netlink.c
netlink.h
secnet.h
site.c
transform-cbcmac.c
transform-eax.c
udp.c

index b2bd2248d632d90b5faefe91e9d664527d710a3a..5d586d03dbd14e4e6b9ba92a36db1b5c0ecb50b3 100644 (file)
--- 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;
index a7bc9afd31b70aa09ae5e8be00920992ab4ab4d0..5e6ad49c218de2d22a4ab27a9fc73fe55493ba77 100644 (file)
--- 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 */
index 0433c1e2635b514ea20d2aa95738a46ab0bb3f8b..46aac5b4a9c08b0a3dfe1eabf75e23521b527952 100644 (file)
--- 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 f9a005a7495dc444a441502086bcb3c13f02b243..2cb53f6038a8fc8775eabdc7e88b33e9298d42e9 100644 (file)
--- 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; i<st->ncomms; i++)
        st->comms[i]->request_notify(st->comms[i]->st, st, site_incoming);
index 5fb66ba4728bee7b0502202450de42ac4d42309f..69201654da6f9e7c6e80f297f2b92e501f038c15 100644 (file)
@@ -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 */
index 5c7a1203c41a4dd3159d7513317d229e0d969a8c..89c46c87b17cf0d78655ea550cc4223f820dc70c 100644 (file)
@@ -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 483ed375e7ae876bf34a222250c90063cabc57c2..12fcfe8c6ec6edb5c0904c1952d36b00c8ddd94f 100644 (file)
--- 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;