From 0150c9c969cfbacb28fa9e05c8bf7f65448d9914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=89RARD?= Date: Tue, 11 May 2010 10:17:53 +0200 Subject: Fix ip_len byte order in DragonFly's raw socket --- ospfd/ospf_packet.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 1066e64f..1b68fd5a 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -653,6 +653,13 @@ ospf_write (struct thread *thread) iph.ip_tos = IPTOS_PREC_INTERNETCONTROL; iph.ip_len = (iph.ip_hl << OSPF_WRITE_IPHL_SHIFT) + op->length; +#if defined(__DragonFly__) + /* + * DragonFly's raw socket expects ip_len/ip_off in network byte order. + */ + iph.ip_len = htons(iph.ip_len); +#endif + #ifdef WANT_OSPF_WRITE_FRAGMENT /* XXX-MT: not thread-safe at all.. * XXX: this presumes this is only programme sending OSPF packets @@ -2080,6 +2087,15 @@ ospf_recv_packet (int fd, struct interface **ifp, struct stream *ibuf) ip_len = ip_len + (iph->ip_hl << 2); #endif +#if defined(__DragonFly__) + /* + * in DragonFly's raw socket, ip_len/ip_off are read + * in network byte order. + * As OpenBSD < 200311 adjust ip_len to strip IP header size! + */ + ip_len = ntohs(iph->ip_len) + (iph->ip_hl << 2); +#endif + ifindex = getsockopt_ifindex (AF_INET, &msgh); *ifp = if_lookup_by_index (ifindex); -- cgit v1.2.1 From d42306d98fa327eb0ea6094cc6d6ae9202a07475 Mon Sep 17 00:00:00 2001 From: Dmitrij Tejblum Date: Fri, 22 Apr 2011 19:27:54 +0400 Subject: ospf6d: copy "mtu-ignore" option from ospfd "mtu-ignore" is an option ospfd used to mimic from the vendor's implementation, now ospf6d will also implement it. * ospf6_interface.h: extend ospf6_interface structure by one flag * ospf6_interface.c: (ipv6_ospf6_mtu_ignore, no_ipv6_ospf6_mtu_ignore): new declarations; (ospf6_interface_create): show initial value for consistency; (ospf6_interface_show): print flag status * ospf6_message.c: (ospf6_dbdesc_recv): consider interface-specific flag when checking MTU --- ospf6d/ospf6_interface.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ ospf6d/ospf6_interface.h | 3 +++ ospf6d/ospf6_message.c | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index cb347451..236baf17 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -118,6 +118,7 @@ ospf6_interface_create (struct interface *ifp) oi->cost = 1; oi->state = OSPF6_INTERFACE_DOWN; oi->flag = 0; + oi->mtu_ignore = 0; /* Try to adjust I/O buffer size with IfMtu */ oi->ifmtu = ifp->mtu6; @@ -784,6 +785,8 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp) { vty_out (vty, " Instance ID %d, Interface MTU %d (autodetect: %d)%s", oi->instance_id, oi->ifmtu, ifp->mtu6, VNL); + vty_out (vty, " MTU mismatch detection: %s%s", oi->mtu_ignore ? + "disabled" : "enabled", VNL); inet_ntop (AF_INET, &oi->area->area_id, strbuf, sizeof (strbuf)); vty_out (vty, " Area ID %s, Cost %hu%s", strbuf, oi->cost, @@ -1368,6 +1371,55 @@ DEFUN (no_ipv6_ospf6_passive, return CMD_SUCCESS; } +DEFUN (ipv6_ospf6_mtu_ignore, + ipv6_ospf6_mtu_ignore_cmd, + "ipv6 ospf6 mtu-ignore", + IP6_STR + OSPF6_STR + "Ignore MTU mismatch on this interface\n" + ) +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->mtu_ignore = 1; + + return CMD_SUCCESS; +} + +DEFUN (no_ipv6_ospf6_mtu_ignore, + no_ipv6_ospf6_mtu_ignore_cmd, + "no ipv6 ospf6 mtu-ignore", + NO_STR + IP6_STR + OSPF6_STR + "Ignore MTU mismatch on this interface\n" + ) +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->mtu_ignore = 0; + + return CMD_SUCCESS; +} + DEFUN (ipv6_ospf6_advertise_prefix_list, ipv6_ospf6_advertise_prefix_list_cmd, "ipv6 ospf6 advertise prefix-list WORD", @@ -1495,6 +1547,9 @@ config_write_ospf6_interface (struct vty *vty) if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE)) vty_out (vty, " ipv6 ospf6 passive%s", VNL); + if (oi->mtu_ignore) + vty_out (vty, " ipv6 ospf6 mtu-ignore%s", VNL); + vty_out (vty, "!%s", VNL); } return 0; @@ -1547,6 +1602,9 @@ ospf6_interface_init (void) install_element (INTERFACE_NODE, &ipv6_ospf6_passive_cmd); install_element (INTERFACE_NODE, &no_ipv6_ospf6_passive_cmd); + install_element (INTERFACE_NODE, &ipv6_ospf6_mtu_ignore_cmd); + install_element (INTERFACE_NODE, &no_ipv6_ospf6_mtu_ignore_cmd); + install_element (INTERFACE_NODE, &ipv6_ospf6_advertise_prefix_list_cmd); install_element (INTERFACE_NODE, &no_ipv6_ospf6_advertise_prefix_list_cmd); } diff --git a/ospf6d/ospf6_interface.h b/ospf6d/ospf6_interface.h index 878c29e2..cf758c07 100644 --- a/ospf6d/ospf6_interface.h +++ b/ospf6d/ospf6_interface.h @@ -76,6 +76,9 @@ struct ospf6_interface /* OSPF6 Interface flag */ char flag; + /* MTU mismatch check */ + u_char mtu_ignore; + /* Decision of DR Election */ u_int32_t drouter; u_int32_t bdrouter; diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index d06eba26..51933b76 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -832,7 +832,7 @@ ospf6_dbdesc_recv (struct in6_addr *src, struct in6_addr *dst, ((caddr_t) oh + sizeof (struct ospf6_header)); /* Interface MTU check */ - if (ntohs (dbdesc->ifmtu) != oi->ifmtu) + if (!oi->mtu_ignore && ntohs (dbdesc->ifmtu) != oi->ifmtu) { if (IS_OSPF6_DEBUG_MESSAGE (oh->type, RECV)) zlog_debug ("I/F MTU mismatch"); -- cgit v1.2.1 From fe0a1a45c31f4ce8c15041cd213de4b6ac9f76a1 Mon Sep 17 00:00:00 2001 From: Greg Troxel Date: Tue, 28 Jun 2011 15:05:05 -0400 Subject: Omit --opaque-lsa from build (now default). --- README.NetBSD | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.NetBSD b/README.NetBSD index 9aac4c35..6bbc680b 100755 --- a/README.NetBSD +++ b/README.NetBSD @@ -20,13 +20,15 @@ PREFIX=/usr/pkg case $1 in build) + # Omitted because it is now default: + # --enable-opaque-lsa ./bootstrap.sh LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib" CPPFLAGS="-I/usr/pkg/include" \ ./configure --prefix=${PREFIX} \ --sysconfdir=/etc/zebra --localstatedir=/var/run/zebra \ --enable-exampledir=${PREFIX}/share/examples/zebra \ --enable-pkgsrcrcdir=${PREFIX}/etc/rc.d \ - --enable-opaque-lsa --enable-vtysh + --enable-vtysh ${MAKE} ;; -- cgit v1.2.1 From 7e924e11a965fc1053a16945ace10c9bd1d868f8 Mon Sep 17 00:00:00 2001 From: Roman Hoog Antink Date: Mon, 27 Jun 2011 17:24:21 +0200 Subject: fix typo --- HACKING.pending | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HACKING.pending b/HACKING.pending index 25ea0bd4..5e0defd8 100644 --- a/HACKING.pending +++ b/HACKING.pending @@ -28,7 +28,7 @@ the list have been stored. Tom Henderson of Boeing has created a repository to work on multi-topology routing support for OSPF. Work on this repository -takes place on the branch mtr, which has a branch poing of 0.99.17 +takes place on the branch mtr, which has a branch point of 0.99.17 * posted patches -- cgit v1.2.1