summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaul <paul>2004-09-27 12:46:37 +0000
committerpaul <paul>2004-09-27 12:46:37 +0000
commit9172ee0e5dc8c6f6929821fb1433699700e53114 (patch)
tree63c8f3d3c3c375fe9613217e8e22213a7e10bf42
parentddb07e5bf4e16889b0845c83d8a73ebfa435bcba (diff)
2004-09-27 Paul Jakma <paul@dishone.st>
* zebra.h: Add WANT_OSPF_WRITE_FRAGMENT for ospfd to try to fragment oversized packets. Enabled only for Linux. Add HAVE_IP_HDRINCL_BSD_ORDER to define struct ip byte order, to consolidate various ad-hoc platform defines for same thing.
-rw-r--r--lib/ChangeLog7
-rw-r--r--lib/zebra.h36
2 files changed, 43 insertions, 0 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 0dee53b5..05ad4db5 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-27 Paul Jakma <paul@dishone.st>
+
+ * zebra.h: Add WANT_OSPF_WRITE_FRAGMENT for ospfd
+ to try to fragment oversized packets. Enabled only for Linux.
+ Add HAVE_IP_HDRINCL_BSD_ORDER to define struct ip byte order,
+ to consolidate various ad-hoc platform defines for same thing.
+
2004-09-26 Hasso Tepper <hasso at quagga.net>
* vty.c, sockopt.c: Fix compiler warnings.
diff --git a/lib/zebra.h b/lib/zebra.h
index 6412655c..e53a40c5 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -245,6 +245,42 @@ struct in_pktinfo
};
#endif
+/*
+ * OSPF Fragmentation / fragmented writes
+ *
+ * ospfd can support writing fragmented packets, for cases where
+ * kernel will not fragment IP_HDRINCL and/or multicast destined
+ * packets (ie TTBOMK all kernels, BSD, SunOS, Linux). However,
+ * SunOS, probably BSD too, clobber the user supplied IP ID and IP
+ * flags fields, hence user-space fragmentation will not work.
+ * Only Linux is known to leave IP header unmolested.
+ * Further, fragmentation really should be done the kernel, which already
+ * supports it, and which avoids nasty IP ID state problems.
+ *
+ * Fragmentation of OSPF packets can be required on networks with router
+ * with many many interfaces active in one area, or on networks with links
+ * with low MTUs.
+ */
+#ifdef GNU_LINUX
+#define WANT_OSPF_WRITE_FRAGMENT
+#endif
+
+/*
+ * IP_HDRINCL / struct ip byte order
+ *
+ * Linux: network byte order
+ * *BSD: network, except for length and offset. (cf Stevens)
+ * SunOS: nominally as per BSD. but bug: network order on LE.
+ * OpenBSD: network byte order, apart from older versions which are as per
+ * *BSD
+ */
+#if defined(__NetBSD__) || defined(__FreeBSD__) \
+ || (defined(__OpenBSD__) && (OpenBSD < 200311)) \
+ || (defined(SUNOS_5) && defined(WORDS_BIGENDIAN))
+#define HAVE_IP_HDRINCL_BSD_ORDER
+#endif
+
+/*
/* MAX / MIN are not commonly defined, but useful */
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))