summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2015-05-01 14:39:54 (GMT)
committerDavid S. Miller <davem@davemloft.net>2015-05-04 04:04:08 (GMT)
commit6a21165480a066a27c1f1dbd32aec581c612ba23 (patch)
treef9322aa5dfe035cf9710b5ef2b1d8a8f03057edd /net
parent087c1a601ad7f851a2d31f5fa0e5e9dfc766df55 (diff)
downloadlinux-6a21165480a066a27c1f1dbd32aec581c612ba23.tar.xz
net: ipv4: route: Fix sending IGMP messages with link address
In setups with a global scope address on an interface, and a lesser scope address on an interface sending IGMP reports, the reports can be sent using the other interfaces global scope address rather than the local interface address. RFC 2236 suggests: Ignore the Report if you cannot identify the source address of the packet as belonging to a subnet assigned to the interface on which the packet was received. since such reports could be forged. Look at the protocol when deciding if a RT_SCOPE_LINK address should be used for the packet. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/route.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 7cad0bf..9e15f5c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2091,7 +2091,8 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
goto out;
}
if (ipv4_is_local_multicast(fl4->daddr) ||
- ipv4_is_lbcast(fl4->daddr)) {
+ ipv4_is_lbcast(fl4->daddr) ||
+ fl4->flowi4_proto == IPPROTO_IGMP) {
if (!fl4->saddr)
fl4->saddr = inet_select_addr(dev_out, 0,
RT_SCOPE_LINK);