Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170456
b: refs/heads/master
c: ee5e81f
h: refs/heads/master
v: v3
  • Loading branch information
Ilia K authored and David S. Miller committed Oct 7, 2009
1 parent d64dbb2 commit f146a9c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7bb5fdc2fb021e32703ed1ff0269876bde1fa962
refs/heads/master: ee5e81f00051b5c373c8de16e3604fd6d3be699e
13 changes: 9 additions & 4 deletions trunk/include/linux/mroute.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,18 @@ struct vifctl {
unsigned char vifc_flags; /* VIFF_ flags */
unsigned char vifc_threshold; /* ttl limit */
unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
struct in_addr vifc_lcl_addr; /* Our address */
union {
struct in_addr vifc_lcl_addr; /* Local interface address */
int vifc_lcl_ifindex; /* Local interface index */
};
struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */
};

#define VIFF_TUNNEL 0x1 /* IPIP tunnel */
#define VIFF_SRCRT 0x2 /* NI */
#define VIFF_REGISTER 0x4 /* register vif */
#define VIFF_TUNNEL 0x1 /* IPIP tunnel */
#define VIFF_SRCRT 0x2 /* NI */
#define VIFF_REGISTER 0x4 /* register vif */
#define VIFF_USE_IFINDEX 0x8 /* use vifc_lcl_ifindex instead of
vifc_lcl_addr to find an interface */

/*
* Cache manipulation structures for mrouted and PIMd
Expand Down
12 changes: 11 additions & 1 deletion trunk/net/ipv4/ipmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,18 @@ static int vif_add(struct net *net, struct vifctl *vifc, int mrtsock)
return err;
}
break;

case VIFF_USE_IFINDEX:
case 0:
dev = ip_dev_find(net, vifc->vifc_lcl_addr.s_addr);
if (vifc->vifc_flags == VIFF_USE_IFINDEX) {
dev = dev_get_by_index(net, vifc->vifc_lcl_ifindex);
if (dev && dev->ip_ptr == NULL) {
dev_put(dev);
return -EADDRNOTAVAIL;
}
} else
dev = ip_dev_find(net, vifc->vifc_lcl_addr.s_addr);

if (!dev)
return -EADDRNOTAVAIL;
err = dev_set_allmulti(dev, 1);
Expand Down

0 comments on commit f146a9c

Please sign in to comment.