Skip to content

Conversation

@MarkusPettersson98
Copy link
Contributor

Title. Found myself doing the following thing in my code:

let message_builder = RouteMessageBuilder::<Ipv4Addr>::new();
// Assemble the RouteMessage
let mut msg: RouteMessage = message_builder.build();
// HACK: Set route MTU on the assembled RouteMessage
// TODO: Submit PR upstream for doing this on the builder instead.
let mtu = RouteMetric::Mtu(1280);
msg.attributes.push(RouteAttribute::Metrics(vec![mtu]));

With this patch, I would not need to create a mutable RouteMessage :)

let msg = RouteMessageBuilder::<Ipv4Addr>::new()
    .mtu(1280)
    .build();

pub fn mtu(mut self, mtu: u32) -> Self {
self.message
.attributes
.push(RouteAttribute::Metrics(vec![RouteMetric::Mtu(mtu)]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This override future changes to other RouteMetric (e.g. cwnd).

Please create similar stuff like RouteNextHopBuilder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants