# \[RFC\]: IPv4 mroute interface referencing

- From: David Lamparter \<hidden\>
- Date: 2010-02-13 18:54:06 
- List: netdev
- Page: https://ratatoskr.run/netdev/2010/02/10839773
- Thread: https://ratatoskr.run/netdev/2010/02/10839773/t.md

```text
The attached patch introduces a new struct vifctln which is identical to
vifctl except for a new vifi_ifindex field. This allows creating mroute
vifs if you have multiple interfaces with the same IP (i.e.
"unnumbered", PtP interfaces) on your box.

Other ways to support this could be:
* new mroute API
  + it really needs an overhaul anyway
  + netlink would be more appropriate for mroute (IMHO)
  - complicated, non-immediate fix
  - complex user space software rewriting
* new MRT_ADD_VIF_EXT setsockopt
  + a bit more clean
  - not needed really, sockopt mess
* stuff ifindex in lcl_addr field ("0.0.0.ifindex IP")
  + no new struct field
  - idiotic (IMHO) API-monging
  o compatibility gain if BSD did this, but BSD doesn't, no point

* add ifindex field (attached patch does this)
  + compatibility by setsockopt length parameter
  + doesn't break userspace software (none of the existing multicast
    routers tries to pass excess junk)
  - new struct, new struct field

This patch causes userspace-visible changes, but is fully backwards
compatible. Patch is against 2.6.32.8, I will provide an updated one if
discussion is in favour of something I can code up (i.e. not netlink).

Regards,


David

```

## Attachments

- [0001-ipmr-new-struct-vifctln-to-support-ifindex-for-MIF\_A.patch](https://ratatoskr.run/netdev/2010/02/10839773/attachment/0) (text/x-patch, 4419 bytes)
