summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_dump.c
diff options
context:
space:
mode:
authorpaul <paul>2004-09-27 12:56:30 +0000
committerpaul <paul>2004-09-27 12:56:30 +0000
commita8f5b804dadb72676644f601f728bd0f6c807a1e (patch)
tree5554a76d8960a2e2e8dbfaec15560aedf0091a4e /ospfd/ospf_dump.c
parented8dd169b23868836cdd620b42103d96455a3d07 (diff)
downloadquagga-a8f5b804dadb72676644f601f728bd0f6c807a1e.tar.bz2
quagga-a8f5b804dadb72676644f601f728bd0f6c807a1e.tar.xz
2004-09-27 Paul Jakma <paul@dishone.st>
* ospf_dump.c: (ospf_ip_header_dump) Use HAVE_IP_HDRINCL_BSD_ORDER Apply to offset too. Print ip_cksum, lets not worry about possible 2.0.37 compile problems. * ospf_packet.c: (ospf_swap_iph_to{n,h}) Use HAVE_IP_HDRINCL_BSD_ORDER. (ospf_recv_packet) ditto. (ospf_write) Fixup iov argument to ospf_write_frags.
Diffstat (limited to 'ospfd/ospf_dump.c')
-rw-r--r--ospfd/ospf_dump.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index 958baa40..248cfbbc 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -602,15 +602,18 @@ void
ospf_ip_header_dump (struct stream *s)
{
u_int16_t length;
+ u_int16_t offset;
struct ip *iph;
iph = (struct ip *) STREAM_PNT (s);
-#ifdef GNU_LINUX
- length = ntohs (iph->ip_len);
-#else /* GNU_LINUX */
+#ifdef HAVE_IP_HDRINCL_BSD_ORDER
length = iph->ip_len;
-#endif /* GNU_LINUX */
+ offset = iph->ip_off;
+#else /* !HAVE_IP_HDRINCL_BSD_ORDER */
+ length = ntohs (iph->ip_len);
+ offset = ntohs (iph->ip_off);
+#endif /* HAVE_IP_HDRINCL_BSD_ORDER */
/* IP Header dump. */
zlog_info ("ip_v %d", iph->ip_v);
@@ -618,12 +621,10 @@ ospf_ip_header_dump (struct stream *s)
zlog_info ("ip_tos %d", iph->ip_tos);
zlog_info ("ip_len %d", length);
zlog_info ("ip_id %u", (u_int32_t) iph->ip_id);
- zlog_info ("ip_off %u", (u_int32_t) iph->ip_off);
+ zlog_info ("ip_off %u", (u_int32_t) offset);
zlog_info ("ip_ttl %d", iph->ip_ttl);
zlog_info ("ip_p %d", iph->ip_p);
- /* There is a report that Linux 2.0.37 does not have ip_sum. But
- I'm not sure. Temporary commented out by kunihiro. */
- /* zlog_info ("ip_sum 0x%x", (u_int32_t) ntohs (iph->ip_sum)); */
+ zlog_info ("ip_sum 0x%x", (u_int32_t) ntohs (iph->ip_sum));
zlog_info ("ip_src %s", inet_ntoa (iph->ip_src));
zlog_info ("ip_dst %s", inet_ntoa (iph->ip_dst));
}