bin/111493: [ PATCH ] routed doesn't use multicasts for RIPv2 via
P2P interfaces
Dan Lukes
dan at obluda.cz
Wed Apr 11 23:10:02 UTC 2007
>Number: 111493
>Category: bin
>Synopsis: [ PATCH ] routed doesn't use multicasts for RIPv2 via P2P interfaces
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Apr 11 23:10:00 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Dan Lukes
>Release: FreeBSD 6.2-STABLE i386
>Organization:
Obludarium
>Environment:
System: FreeBSD 6.2-STABLE
src/sbin/routed/output.c,v 1.12 2005/05/31 20:28:48
>Description:
RIPv2 should use multicasts when possible. Current code test IFF_MULTICAST
on IFF_BROADCAST interfaces only. It doesn't use multicast on non-broadcast interfaces
even they are multicast capable.
>How-To-Repeat:
Configure RIPv2 on a multicast capable point to point link (GRE or so), use
tcpdump to see packets
>Fix:
Honor the IFF_MULTICAST on IFF_POINTOPOINT interfaces also.
P2P logic follow the ethernet logic - multicasts are not used when:
1. P2P interface is not multicast capable
2. RIPv1 compatibility requested
3. disabled by configuration (no_rip_mcast configuration directive - note,
it's not new directive created by patch, it exist already)
--- patch-sbin-routed-output.c begins here ---
--- sbin/routed/output.c.ORIG Tue May 31 22:28:48 2005
+++ sbin/routed/output.c Wed Apr 11 22:26:59 2007
@@ -140,7 +140,7 @@
flags = MSG_DONTROUTE;
break;
case OUT_MULTICAST:
- if (ifp->int_if_flags & IFF_POINTOPOINT) {
+ if (ifp->int_if_flags & IFF_POINTOPOINT && ! ifp->int_if_flags & IFF_MULTICAST) {
msg = "Send pt-to-pt";
} else if (ifp->int_state & IS_DUP) {
trace_act("abort multicast output via %s"
@@ -874,7 +874,13 @@
} else if (ifp->int_if_flags & IFF_POINTOPOINT) {
/* point-to-point hardware interface */
dst.sin_addr.s_addr = ifp->int_dstaddr;
- type = OUT_UNICAST;
+
+ if (vers == RIPv2
+ && !(ifp->int_state & IS_NO_RIP_MCAST)) {
+ type = OUT_MULTICAST;
+ } else {
+ type = OUT_UNICAST;
+ }
} else if (ifp->int_state & IS_REMOTE) {
/* remote interface */
@@ -963,7 +969,17 @@
} else if (ifp->int_if_flags & IFF_POINTOPOINT) {
/* point-to-point hardware interface */
dst.sin_addr.s_addr = ifp->int_dstaddr;
- type = OUT_UNICAST;
+
+ /* Broadcast RIPv1 queries and RIPv2 queries
+ * when the hardware cannot multicast.
+ */
+ if (buf.rip_vers == RIPv2
+ && (ifp->int_if_flags & IFF_MULTICAST)
+ && !(ifp->int_state & IS_NO_RIP_MCAST)) {
+ type = OUT_MULTICAST;
+ } else {
+ type = OUT_UNICAST;
+ }
} else if (ifp->int_state & IS_REMOTE) {
/* remote interface */
--- patch-DAN-routed-output.c ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list