summaryrefslogtreecommitdiff
path: root/lib/netdev-linux.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2010-02-18 11:42:36 -0500
committerJesse Gross <jesse@nicira.com>2010-03-05 16:31:27 -0500
commita9a4b30c0091b507dfe0f7c59c80355693836f04 (patch)
tree49fd1eeddfe69b89c46a54d7d870aa51858fc4d0 /lib/netdev-linux.c
parent3c8740c5be5a63c65d7d38e08179a43157d4c4b1 (diff)
downloadopenvswitch-a9a4b30c0091b507dfe0f7c59c80355693836f04.tar.gz
gre: Always set TTL on outer packet to 64.
Currently the TTL is copied from the inner packet of the tunnel to the outer packet if the inner packet is IP. This is good if your GRE packets might make it into the input of your device but bad if you want to be fully transparent. This also resolves an inconsistency between tunnels set up using the ioctl and using Netlink. The ioctl version would force PMTUD on if a fixed TTL is set as a backup way to prevent loops but it never made it over to the newer Netlink code so obviously no one cares too much about it. This removes it to provide consistency and transparency. Basically, don't create loops and you will be happy.
Diffstat (limited to 'lib/netdev-linux.c')
-rw-r--r--lib/netdev-linux.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 5341ed06f..daf00a480 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -316,7 +316,7 @@ setup_gre_netlink(const char *name OVS_UNUSED,
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_TTL, 0);
+ nl_msg_put_u8(&request, IFLA_GRE_TTL, IPDEFTTL);
nl_msg_put_u8(&request, IFLA_GRE_TOS, 0);
info_data_hdr->nla_len = (char *)ofpbuf_tail(&request)
@@ -356,6 +356,7 @@ setup_gre_ioctl(const char *name, struct gre_config *config, bool create)
p.iph.protocol = IPPROTO_GRE;
p.iph.saddr = config->local_ip;
p.iph.daddr = config->remote_ip;
+ p.iph.ttl = IPDEFTTL;
if (config->have_in_key) {
p.i_flags |= GRE_KEY;