From: Ian Jackson Date: Mon, 21 Apr 2014 19:43:06 +0000 (+0100) Subject: netlink: Advise netlink clients of the local link MTU X-Git-Tag: debian/0.3.1_beta1~3 X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/commitdiff_plain/1c085348edf120e964a6cdeff182faccfc8146d7 netlink: Advise netlink clients of the local link MTU From the netlink client's point of view this is advisory: it may be that other peers (perhaps reached via that netlink) would prefer a larger or smaller MTU. This information will be consumed in later patches. Signed-off-by: Ian Jackson --- diff --git a/netlink.c b/netlink.c index 787f4eb..3726456 100644 --- a/netlink.c +++ b/netlink.c @@ -1028,12 +1028,16 @@ 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) + void *dst, uint32_t *localmtu_r) { struct netlink_client *c=sst; + struct netlink *st=c->nst; c->deliver=deliver; c->dst=dst; + + if (localmtu_r) + *localmtu_r=st->mtu; } static struct flagstr netlink_option_table[]={ diff --git a/secnet.h b/secnet.h index 9bec310..d5663ff 100644 --- a/secnet.h +++ b/secnet.h @@ -431,7 +431,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); + void *dst, uint32_t *localmtu_r /* NULL ok */); 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 324a206..00a3a4c 100644 --- a/site.c +++ b/site.c @@ -1837,7 +1837,7 @@ static list_t *site_apply(closure_t *self, struct cloc loc, dict_t *context, } /* We need to register the remote networks with the netlink device */ - st->netlink->reg(st->netlink->st, site_outgoing, st); + st->netlink->reg(st->netlink->st, site_outgoing, st, 0); for (i=0; incomms; i++) st->comms[i]->request_notify(st->comms[i]->st, st, site_incoming);