Quantcast

Re: CVS: cvs.openbsd.org: src

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CVS: cvs.openbsd.org: src

Paul de Weerd
Hi Rafael, others,

It looks like your commit to ip_mroute.[ch] from January 11th broke
multicast forwarding.  I found another thread that may suffer from the
same problem: http://marc.info/?l=openbsd-bugs&m=148605155027668&w=2 -
I'm CC:'ing the OP from that thread here (hope you don't mind :).

On Wed, Jan 11, 2017 at 06:17:35AM -0700, Rafael Zalamena wrote:
| CVSROOT: /cvs
| Module name: src
| Changes by: [hidden email] 2017/01/11 06:17:35
|
| Modified files:
| sys/netinet    : ip_mroute.c ip_mroute.h
|
| Log message:
| Remove mfc hash tables and use the OpenBSD routing table for multicast
| routes. Beside the code simplification and removal, we also get to see
| the multicast routes now in the route(8) utility.
|
| ok mpi@

After I last upgraded my home gateway my television setup stopped
working.  I use a settopbox that utilizes multicast streaming from my
provider to watch television with the net/igmpproxy port.

Using an archive of older kernels, I determined things broke between
bsd.mp.2017-01-10_21:40:04.127 and bsd.mp.2017-01-11_14:22:26.129
(build times and kernel version numbers as found in the snapshot
bsd.mp kernel using what(1)).

After bisecting and building a bunch of kernels, I found this commit
broke things for me: building source that's current as of 2017-01-11
14:00 (CET) gives a kernel that forwards multicast traffic as
configured, while source from 10 minutes later doesn't (checked
out with `cvs -q up -D "2017-01-11 14:10" -PAd`); with the
ip_mroute.[ch] change the only difference between the two trees.

When things work, I see multicast traffic coming in on the upstream
interface and go out on the downstream interface.  With the change in,
tcpdump shows the traffic on the upstream interface, but there's no
traffic forwarded to the downstream interface.  Both interfaces are
vlan(4) devices.  The only change I make between reboots is the
kernel, the rest of the configuration doesn't change.

Cheers,

Paul 'WEiRD' de Weerd

OpenBSD 6.0-current (GENERIC.MP) #8: Fri Mar 10 15:54:57 CET 2017
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 2120876032 (2022MB)
avail mem = 2052001792 (1956MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xfc690 (23 entries)
bios0: vendor American Megatrends Inc. version "080015" date 09/15/2010
bios0: AXIOMTEK NA-320
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S4 S5
acpi0: tables DSDT FACP APIC MCFG OEMB GSCI SSDT
acpi0: wakeup devices P0P1(S4) USB0(S4) USB1(S4) USB2(S4) USB3(S4) EUSB(S4) P0P4(S4) P0P5(S4) P0P6(S4) P0P7(S4) P0P8(S4) P0P9(S4) USB4(S4) USB5(S4) USBE(S4) GBEC(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Atom(TM) CPU D510 @ 1.66GHz, 1662.72 MHz
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,TM2,SSSE3,CX16,xTPR,PDCM,MOVBE,NXE,LONG,LAHF,PERF,SENSOR
cpu0: 512KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 166MHz
cpu0: mwait min=64, max=64, C-substates=0.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Atom(TM) CPU D510 @ 1.66GHz, 1662.51 MHz
cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,TM2,SSSE3,CX16,xTPR,PDCM,MOVBE,NXE,LONG,LAHF,PERF,SENSOR
cpu1: 512KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 1 (application processor)
cpu2: Intel(R) Atom(TM) CPU D510 @ 1.66GHz, 1662.51 MHz
cpu2: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,TM2,SSSE3,CX16,xTPR,PDCM,MOVBE,NXE,LONG,LAHF,PERF,SENSOR
cpu2: 512KB 64b/line 8-way L2 cache
cpu2: smt 1, core 0, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Atom(TM) CPU D510 @ 1.66GHz, 1662.51 MHz
cpu3: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,TM2,SSSE3,CX16,xTPR,PDCM,MOVBE,NXE,LONG,LAHF,PERF,SENSOR
cpu3: 512KB 64b/line 8-way L2 cache
cpu3: smt 1, core 1, package 0
ioapic0 at mainbus0: apid 4 pa 0xfec00000, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (P0P4)
acpiprt2 at acpi0: bus 3 (P0P5)
acpiprt3 at acpi0: bus 4 (P0P6)
acpiprt4 at acpi0: bus 5 (P0P7)
acpiprt5 at acpi0: bus 6 (P0P8)
acpiprt6 at acpi0: bus 7 (P0P9)
acpicpu0 at acpi0: C1(1000@1 mwait.1)
acpicpu1 at acpi0: C1(1000@1 mwait.1)
acpicpu2 at acpi0: C1(@1 halt!)
acpicpu3 at acpi0: C1(@1 halt!)
"AWY0001" at acpi0 not configured
"PNP0501" at acpi0 not configured
"PNP0501" at acpi0 not configured
acpibtn0 at acpi0: PWRB
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Pineview DMI" rev 0x02
inteldrm0 at pci0 dev 2 function 0 "Intel Pineview Video" rev 0x02
drm0 at inteldrm0
intagp0 at inteldrm0
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0: msi
Raw EDID:

00 00 00 00 00 00 00 00  01 01 01 01 01 01 01 01
03 03 03 03 03 03 03 03  07 07 07 07 07 07 07 07
0f 0f 0f 0f 0f 0f 0f 0f  1f 1f 1f 1f 1f 1f 1f 1f
3f 3f 3f 3f 3f 3f 3f 3f  7f 7f 7f 7f 7f 7f 7f 7f
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
Raw EDID:

f8 f8 f8 f8 f8 f8 f8 f8  f1 f1 f1 f1 f1 f1 f1 f1
e3 e3 e3 e3 e3 e3 e3 e3  c7 c7 c7 c7 c7 c7 c7 c7
8f 8f 8f 8f 8f 8f 8f 8f  1f 1f 1f 1f 1f 1f 1f 1f
3f 3f 3f 3f 3f 3f 3f 3f  7f 7f 7f 7f 7f 7f 7f 7f
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
Raw EDID:

f8 f8 f8 f8 f8 f8 f8 f8  f1 f1 f1 f1 f1 f1 f1 f1
e3 e3 e3 e3 e3 e3 e3 e3  c7 c7 c7 c7 c7 c7 c7 c7
8f 8f 8f 8f 8f 8f 8f 8f  1f 1f 1f 1f 1f 1f 1f 1f
3f 3f 3f 3f 3f 3f 3f 3f  7f 7f 7f 7f 7f 7f 7f 7f
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
Raw EDID:

f8 f8 f8 f8 f8 f8 f8 f8  f1 f1 f1 f1 f1 f1 f1 f1
e3 e3 e3 e3 e3 e3 e3 e3  c7 c7 c7 c7 c7 c7 c7 c7
8f 8f 8f 8f 8f 8f 8f 8f  1f 1f 1f 1f 1f 1f 1f 1f
3f 3f 3f 3f 3f 3f 3f 3f  7f 7f 7f 7f 7f 7f 7f 7f
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
drm:pid0:drm_do_get_edid *WARNING* VGA-1: EDID block 0 invalid.
inteldrm0: 1024x768, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
ppb0 at pci0 dev 28 function 0 "Intel 82801H PCIE" rev 0x04: msi
pci1 at ppb0 bus 2
em0 at pci1 dev 0 function 0 "Intel 82583V" rev 0x00: msi, address 00:60:e0:52:0f:96
ppb1 at pci0 dev 28 function 1 "Intel 82801H PCIE" rev 0x04: msi
pci2 at ppb1 bus 3
em1 at pci2 dev 0 function 0 "Intel 82583V" rev 0x00: msi, address 00:60:e0:52:0f:97
ppb2 at pci0 dev 28 function 2 "Intel 82801H PCIE" rev 0x04: msi
pci3 at ppb2 bus 4
em2 at pci3 dev 0 function 0 "Intel 82583V" rev 0x00: msi, address 00:60:e0:52:0f:98
ppb3 at pci0 dev 28 function 3 "Intel 82801H PCIE" rev 0x04: msi
pci4 at ppb3 bus 5
em3 at pci4 dev 0 function 0 "Intel 82583V" rev 0x00: msi, address 00:60:e0:52:0f:99
ppb4 at pci0 dev 28 function 4 "Intel 82801H PCIE" rev 0x04: msi
pci5 at ppb4 bus 6
em4 at pci5 dev 0 function 0 "Intel 82583V" rev 0x00: msi, address 00:60:e0:52:0f:9a
ppb5 at pci0 dev 28 function 5 "Intel 82801H PCIE" rev 0x04: msi
pci6 at ppb5 bus 7
em5 at pci6 dev 0 function 0 "Intel 82583V" rev 0x00: msi, address 00:60:e0:52:0f:9b
uhci0 at pci0 dev 29 function 0 "Intel 82801H USB" rev 0x04: apic 4 int 23
uhci1 at pci0 dev 29 function 1 "Intel 82801H USB" rev 0x04: apic 4 int 19
uhci2 at pci0 dev 29 function 2 "Intel 82801H USB" rev 0x04: apic 4 int 18
ehci0 at pci0 dev 29 function 7 "Intel 82801H USB" rev 0x04: apic 4 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb6 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xf4
pci7 at ppb6 bus 1
pcib0 at pci0 dev 31 function 0 "Intel 82801HBM LPC" rev 0x04
pciide0 at pci0 dev 31 function 1 "Intel 82801HBM IDE" rev 0x04: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility
pciide0: channel 0 disabled (no drives)
pciide0: channel 1 ignored (disabled)
ahci0 at pci0 dev 31 function 2 "Intel 82801HBM AHCI" rev 0x04: msi, AHCI 1.1
ahci0: port 0: 3.0Gb/s
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, M4-CT256M4SSD2, 070H> SCSI3 0/direct fixed naa.500a07510927b253
sd0: 244198MB, 512 bytes/sector, 500118192 sectors, thin
ichiic0 at pci0 dev 31 function 3 "Intel 82801H SMBus" rev 0x04: apic 4 int 17
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 2GB DDR2 SDRAM non-parity PC2-6400CL6 SO-DIMM
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: console
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
wbsio0 at isa0 port 0x2e/2: W83627DHG-P rev 0x73
lm1 at wbsio0 port 0xa00/8: W83627DHG
vmm at mainbus0 not configured
umass0 at uhub0 port 1 configuration 1 interface 0 "Western Digital My Passport 259D" rev 2.10/10.12 addr 2
umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: <WD, My Passport 259D, 1012> SCSI4 0/direct fixed
sd1: 3815415MB, 512 bytes/sector, 7813969920 sectors
ses0 at scsibus2 targ 1 lun 1: <WD, SES Device, 1012> SCSI4 13/enclosure services fixed
ses0: unable to read enclosure configuration
uhub4 at uhub0 port 2 configuration 1 interface 0 "Genesys Logic USB2.0 Hub" rev 2.00/85.32 addr 3
uhub4: device problem, disabling port 1
uftdi0 at uhub4 port 2 configuration 1 interface 0 "FTDI SYNLEAF - FT232R USB UART" rev 2.00/6.00 addr 4
ucom0 at uftdi0 portno 1
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd0a (86b81881bbaa38a1.a) swap on sd0b dump on sd0b

--
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                 http://www.weirdnet.nl/                 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CVS: cvs.openbsd.org: src

Rafael Zalamena-2
On Fri, Mar 10, 2017 at 04:14:44PM +0100, Paul de Weerd wrote:

> Hi Rafael, others,
>
> It looks like your commit to ip_mroute.[ch] from January 11th broke
> multicast forwarding.  I found another thread that may suffer from the
> same problem: http://marc.info/?l=openbsd-bugs&m=148605155027668&w=2 -
> I'm CC:'ing the OP from that thread here (hope you don't mind :).
>
> On Wed, Jan 11, 2017 at 06:17:35AM -0700, Rafael Zalamena wrote:
> | CVSROOT: /cvs
> | Module name: src
> | Changes by: [hidden email] 2017/01/11 06:17:35
> |
> | Modified files:
> | sys/netinet    : ip_mroute.c ip_mroute.h
> |
> | Log message:
> | Remove mfc hash tables and use the OpenBSD routing table for multicast
> | routes. Beside the code simplification and removal, we also get to see
> | the multicast routes now in the route(8) utility.
> |
> | ok mpi@

After exchanging a few e-mails with Paul we identified and fixed the
problem reported.

The problem was that the mfc_find() function was matching default route
as a multicast route, so it was never notifying the multicast routing
daemon that we had a new IGMP message. Without sending the IGMP messages
to the userland, igmpproxy never had a chance to install the needed
routes for the rest to work.

The diff below makes mfc_find() route search more strict.

ok?

Index: sys/netinet/ip_mroute.c
===================================================================
RCS file: /home/obsdcvs/src/sys/netinet/ip_mroute.c,v
retrieving revision 1.110
diff -u -p -r1.110 ip_mroute.c
--- sys/netinet/ip_mroute.c 9 Feb 2017 15:36:46 -0000 1.110
+++ sys/netinet/ip_mroute.c 13 Mar 2017 11:25:13 -0000
@@ -157,11 +157,14 @@ mfc_find(struct ifnet *ifp, struct in_ad
  if (rt == NULL)
  return (NULL);
 
- /* Return first ocurrence if interface is not specified. */
- if (ifp == NULL)
- return (rt);
-
  do {
+ /* Don't consider non multicast routes. */
+ if (ISSET(rt->rt_flags, RTF_HOST | RTF_MULTICAST) !=
+    (RTF_HOST | RTF_MULTICAST))
+ continue;
+ /* Return first occurrence if interface is not specified. */
+ if (ifp == NULL)
+ return (rt);
  if (rt->rt_ifidx == ifp->if_index)
  return (rt);
  } while ((rt = rtable_iterate(rt)) != NULL);

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CVS: cvs.openbsd.org: src

Paul de Weerd
I can confirm Rafael's diff fixes the issues I was having with
multicast.

Thank you very much, Rafael!

Paul

On Mon, Mar 13, 2017 at 06:03:56PM +0100, Rafael Zalamena wrote:
| On Fri, Mar 10, 2017 at 04:14:44PM +0100, Paul de Weerd wrote:
| > Hi Rafael, others,
| >
| > It looks like your commit to ip_mroute.[ch] from January 11th broke
| > multicast forwarding.  I found another thread that may suffer from the
| > same problem: http://marc.info/?l=openbsd-bugs&m=148605155027668&w=2 -
| > I'm CC:'ing the OP from that thread here (hope you don't mind :).
| >
| > On Wed, Jan 11, 2017 at 06:17:35AM -0700, Rafael Zalamena wrote:
| > | CVSROOT: /cvs
| > | Module name: src
| > | Changes by: [hidden email] 2017/01/11 06:17:35
| > |
| > | Modified files:
| > | sys/netinet    : ip_mroute.c ip_mroute.h
| > |
| > | Log message:
| > | Remove mfc hash tables and use the OpenBSD routing table for multicast
| > | routes. Beside the code simplification and removal, we also get to see
| > | the multicast routes now in the route(8) utility.
| > |
| > | ok mpi@
|
| After exchanging a few e-mails with Paul we identified and fixed the
| problem reported.
|
| The problem was that the mfc_find() function was matching default route
| as a multicast route, so it was never notifying the multicast routing
| daemon that we had a new IGMP message. Without sending the IGMP messages
| to the userland, igmpproxy never had a chance to install the needed
| routes for the rest to work.
|
| The diff below makes mfc_find() route search more strict.
|
| ok?
|
| Index: sys/netinet/ip_mroute.c
| ===================================================================
| RCS file: /home/obsdcvs/src/sys/netinet/ip_mroute.c,v
| retrieving revision 1.110
| diff -u -p -r1.110 ip_mroute.c
| --- sys/netinet/ip_mroute.c 9 Feb 2017 15:36:46 -0000 1.110
| +++ sys/netinet/ip_mroute.c 13 Mar 2017 11:25:13 -0000
| @@ -157,11 +157,14 @@ mfc_find(struct ifnet *ifp, struct in_ad
|   if (rt == NULL)
|   return (NULL);
|  
| - /* Return first ocurrence if interface is not specified. */
| - if (ifp == NULL)
| - return (rt);
| -
|   do {
| + /* Don't consider non multicast routes. */
| + if (ISSET(rt->rt_flags, RTF_HOST | RTF_MULTICAST) !=
| +    (RTF_HOST | RTF_MULTICAST))
| + continue;
| + /* Return first occurrence if interface is not specified. */
| + if (ifp == NULL)
| + return (rt);
|   if (rt->rt_ifidx == ifp->if_index)
|   return (rt);
|   } while ((rt = rtable_iterate(rt)) != NULL);

--
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                 http://www.weirdnet.nl/                 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CVS: cvs.openbsd.org: src

Claudio Jeker-3
In reply to this post by Rafael Zalamena-2
On Mon, Mar 13, 2017 at 06:03:56PM +0100, Rafael Zalamena wrote:

> On Fri, Mar 10, 2017 at 04:14:44PM +0100, Paul de Weerd wrote:
> > Hi Rafael, others,
> >
> > It looks like your commit to ip_mroute.[ch] from January 11th broke
> > multicast forwarding.  I found another thread that may suffer from the
> > same problem: http://marc.info/?l=openbsd-bugs&m=148605155027668&w=2 -
> > I'm CC:'ing the OP from that thread here (hope you don't mind :).
> >
> > On Wed, Jan 11, 2017 at 06:17:35AM -0700, Rafael Zalamena wrote:
> > | CVSROOT: /cvs
> > | Module name: src
> > | Changes by: [hidden email] 2017/01/11 06:17:35
> > |
> > | Modified files:
> > | sys/netinet    : ip_mroute.c ip_mroute.h
> > |
> > | Log message:
> > | Remove mfc hash tables and use the OpenBSD routing table for multicast
> > | routes. Beside the code simplification and removal, we also get to see
> > | the multicast routes now in the route(8) utility.
> > |
> > | ok mpi@
>
> After exchanging a few e-mails with Paul we identified and fixed the
> problem reported.
>
> The problem was that the mfc_find() function was matching default route
> as a multicast route, so it was never notifying the multicast routing
> daemon that we had a new IGMP message. Without sending the IGMP messages
> to the userland, igmpproxy never had a chance to install the needed
> routes for the rest to work.
>
> The diff below makes mfc_find() route search more strict.
>
> ok?

Reads fine by me. OK claudio@

I think you can move the RTF_HOST check outside of the while loop since
rtable_iterate will only return routes with the same addr/mask and therfor
RTF_HOST flag. Minor optimization, probably not worth the effort though.
 

> Index: sys/netinet/ip_mroute.c
> ===================================================================
> RCS file: /home/obsdcvs/src/sys/netinet/ip_mroute.c,v
> retrieving revision 1.110
> diff -u -p -r1.110 ip_mroute.c
> --- sys/netinet/ip_mroute.c 9 Feb 2017 15:36:46 -0000 1.110
> +++ sys/netinet/ip_mroute.c 13 Mar 2017 11:25:13 -0000
> @@ -157,11 +157,14 @@ mfc_find(struct ifnet *ifp, struct in_ad
>   if (rt == NULL)
>   return (NULL);
>  
> - /* Return first ocurrence if interface is not specified. */
> - if (ifp == NULL)
> - return (rt);
> -
>   do {
> + /* Don't consider non multicast routes. */
> + if (ISSET(rt->rt_flags, RTF_HOST | RTF_MULTICAST) !=
> +    (RTF_HOST | RTF_MULTICAST))
> + continue;
> + /* Return first occurrence if interface is not specified. */
> + if (ifp == NULL)
> + return (rt);
>   if (rt->rt_ifidx == ifp->if_index)
>   return (rt);
>   } while ((rt = rtable_iterate(rt)) != NULL);
>

--
:wq Claudio

Loading...