summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d714da2)
Apparently, a long time ago, MSG5 and MSG6 used to contain some
netlink configuration data, which the receiver of the MSG5 or MSG6
would check.
However, for a long time now the output_config function has been a
no-op and the check function has unconditionally eaten and discarded
anything extra in the message.
Furthermore, because the MSG6 is not retransmitted, this mechanism
couldn't be reliable without a protocol change. So the existing
interface is defective.
So, abolish it the interface, the dummy implementation, and all the
call sites. The check_config call sites in site.c now instead
directly discard any unexpected data at the end of MSG5 and MSG6.
This patch should cause no behavioural change in actual operation.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
netlink_dump_routes(st,True);
}
netlink_dump_routes(st,True);
}
-static void netlink_inst_output_config(void *sst, struct buffer_if *buf)
-{
-/* struct netlink_client *c=sst; */
-/* struct netlink *st=c->nst; */
-
- /* For now we don't output anything */
- BUF_ASSERT_USED(buf);
-}
-
-static bool_t netlink_inst_check_config(void *sst, struct buffer_if *buf)
-{
-/* struct netlink_client *c=sst; */
-/* struct netlink *st=c->nst; */
-
- BUF_ASSERT_USED(buf);
- /* We need to eat all of the configuration information from the buffer
- for backward compatibility. */
- buf->size=0;
- return True;
-}
-
static void netlink_inst_set_mtu(void *sst, int32_t new_mtu)
{
struct netlink_client *c=sst;
static void netlink_inst_set_mtu(void *sst, int32_t new_mtu)
{
struct netlink_client *c=sst;
c->ops.reg=netlink_inst_reg;
c->ops.deliver=netlink_inst_incoming;
c->ops.set_quality=netlink_set_quality;
c->ops.reg=netlink_inst_reg;
c->ops.deliver=netlink_inst_incoming;
c->ops.set_quality=netlink_set_quality;
- c->ops.output_config=netlink_inst_output_config;
- c->ops.check_config=netlink_inst_check_config;
c->ops.set_mtu=netlink_inst_set_mtu;
c->nst=st;
c->ops.set_mtu=netlink_inst_set_mtu;
c->nst=st;
netlink_register_fn *reg;
netlink_deliver_fn *deliver;
netlink_link_quality_fn *set_quality;
netlink_register_fn *reg;
netlink_deliver_fn *deliver;
netlink_link_quality_fn *set_quality;
- netlink_output_config_fn *output_config;
- netlink_check_config_fn *check_config;
netlink_set_mtu_fn *set_mtu;
};
netlink_set_mtu_fn *set_mtu;
};
buffer_init(&st->buffer,st->transform->max_start_pad+(4*4));
/* Give the netlink code an opportunity to put its own stuff in the
message (configuration information, etc.) */
buffer_init(&st->buffer,st->transform->max_start_pad+(4*4));
/* Give the netlink code an opportunity to put its own stuff in the
message (configuration information, etc.) */
- st->netlink->output_config(st->netlink->st,&st->buffer);
buf_prepend_uint32(&st->buffer,LABEL_MSG5);
st->new_transform->forwards(st->new_transform->st,&st->buffer,
&transform_err);
buf_prepend_uint32(&st->buffer,LABEL_MSG5);
st->new_transform->forwards(st->new_transform->st,&st->buffer,
&transform_err);
slog(st,LOG_SEC,"MSG5/PING packet contained wrong label");
return False;
}
slog(st,LOG_SEC,"MSG5/PING packet contained wrong label");
return False;
}
- if (!st->netlink->check_config(st->netlink->st,msg5)) {
- slog(st,LOG_SEC,"MSG5/PING packet contained bad netlink config");
- return False;
- }
- CHECK_EMPTY(msg5);
+ /* Older versions of secnet used to write some config data here
+ * which we ignore. So we don't CHECK_EMPTY */
buffer_init(&st->buffer,st->transform->max_start_pad+(4*4));
/* Give the netlink code an opportunity to put its own stuff in the
message (configuration information, etc.) */
buffer_init(&st->buffer,st->transform->max_start_pad+(4*4));
/* Give the netlink code an opportunity to put its own stuff in the
message (configuration information, etc.) */
- st->netlink->output_config(st->netlink->st,&st->buffer);
buf_prepend_uint32(&st->buffer,LABEL_MSG6);
st->new_transform->forwards(st->new_transform->st,&st->buffer,
&transform_err);
buf_prepend_uint32(&st->buffer,LABEL_MSG6);
st->new_transform->forwards(st->new_transform->st,&st->buffer,
&transform_err);
slog(st,LOG_SEC,"MSG6/PONG packet contained invalid data");
return False;
}
slog(st,LOG_SEC,"MSG6/PONG packet contained invalid data");
return False;
}
- if (!st->netlink->check_config(st->netlink->st,msg6)) {
- slog(st,LOG_SEC,"MSG6/PONG packet contained bad netlink config");
- return False;
- }
- CHECK_EMPTY(msg6);
+ /* Older versions of secnet used to write some config data here
+ * which we ignore. So we don't CHECK_EMPTY */