bool have_out_key;
bool in_csum;
bool out_csum;
+ bool pmtud;
};
static struct {
struct nlattr *info_data_hdr;
uint16_t iflags = 0;
uint16_t oflags = 0;
- uint8_t pmtudisc = 0;
VLOG_DBG("%s: attempting to create gre device using netlink", name);
nl_msg_put_u16(&request, IFLA_GRE_OFLAGS, oflags);
nl_msg_put_u32(&request, IFLA_GRE_LOCAL, config->local_ip);
nl_msg_put_u32(&request, IFLA_GRE_REMOTE, config->remote_ip);
- nl_msg_put_u8(&request, IFLA_GRE_PMTUDISC, pmtudisc);
+ nl_msg_put_u8(&request, IFLA_GRE_PMTUDISC, config->pmtud);
nl_msg_put_u8(&request, IFLA_GRE_TTL, IPDEFTTL);
nl_msg_put_u8(&request, IFLA_GRE_TOS, config->tos);
p.o_flags |= GRE_CSUM;
}
+ if (config->pmtud) {
+ p.iph.frag_off = htons(IP_DONT_FRAGMENT);
+ }
+
strncpy(ifr.ifr_name, create ? GRE_IOCTL_DEVICE : name, IFNAMSIZ);
ifr.ifr_ifru.ifru_data = (void *)&p;
memset(&config, 0, sizeof config);
config.in_csum = true;
config.out_csum = true;
+ config.pmtud = true;
SHASH_FOR_EACH (node, args) {
if (!strcmp(node->name, "remote_ip")) {
config.in_csum = false;
config.out_csum = false;
}
+ } else if (!strcmp(node->name, "pmtud")) {
+ if (!strcmp(node->data, "false")) {
+ config.pmtud = false;
+ }
} else {
VLOG_WARN("unknown gre argument '%s'", node->name);
}