diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1999-02-25 19:21:10 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1999-02-25 19:21:10 +0000 |
commit | d1b7a1a21038197b77053daed71e4b0d82cc83cd (patch) | |
tree | c1d7a6a020c97d37d98448356516e90144da81ae | |
parent | 1a640e961183ab661b950c8fbf5623945fb12ef0 (diff) |
Clear the DF bit, so packets don't get dropped inside a tunnel.
The real solution is probably to keep soft state; however, it's not
entirely clear what a tunnel's properties with regards to
fragmentation are (it may be considered a infinitely-large MTU pipe).
-rw-r--r-- | sys/netinet/ip_ip4.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/netinet/ip_ip4.c b/sys/netinet/ip_ip4.c index 29e28b00e89..c142d46aa84 100644 --- a/sys/netinet/ip_ip4.c +++ b/sys/netinet/ip_ip4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ip4.c,v 1.24 1999/02/24 23:45:51 angelos Exp $ */ +/* $OpenBSD: ip_ip4.c,v 1.25 1999/02/25 19:21:09 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -110,7 +110,6 @@ ip4_input(m, va_alist) */ if (iphlen > sizeof(struct ip)) { - DPRINTF(("ip4_input(): stripping options\n")); ip_stripoptions(m, (struct mbuf *) 0); iphlen = sizeof(struct ip); } @@ -231,11 +230,17 @@ ipe4_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, ipo->ip_hl = 5; ipo->ip_tos = ipi->ip_tos; ipo->ip_len = htons(ilen + sizeof(struct ip)); - ipo->ip_id = ip_randomid(); - HTONS(ipo->ip_id); - ipo->ip_off = ipi->ip_off & ~(IP_MF | IP_OFFMASK); /* XXX keep C and DF */ ipo->ip_ttl = ip_defttl; ipo->ip_p = IPPROTO_IPIP; + ipo->ip_id = ip_randomid(); + HTONS(ipo->ip_id); + + /* + * XXX We should be keeping tunnel soft-state and send back ICMPs + * if needed + */ + ipo->ip_off = ipi->ip_off & ~(IP_DF | IP_MF | IP_OFFMASK); + ipo->ip_sum = 0; ipo->ip_src = tdb->tdb_src.sin.sin_addr; |