diff options
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r-- | drivers/net/tun.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 0476549841ac..4825c52924bf 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -260,10 +260,16 @@ static int update_filter(struct tap_filter *filter, void __user *arg) | |||
260 | 260 | ||
261 | nexact = n; | 261 | nexact = n; |
262 | 262 | ||
263 | /* The rest is hashed */ | 263 | /* Remaining multicast addresses are hashed, |
264 | * unicast will leave the filter disabled. */ | ||
264 | memset(filter->mask, 0, sizeof(filter->mask)); | 265 | memset(filter->mask, 0, sizeof(filter->mask)); |
265 | for (; n < uf.count; n++) | 266 | for (; n < uf.count; n++) { |
267 | if (!is_multicast_ether_addr(addr[n].u)) { | ||
268 | err = 0; /* no filter */ | ||
269 | goto done; | ||
270 | } | ||
266 | addr_hash_set(filter->mask, addr[n].u); | 271 | addr_hash_set(filter->mask, addr[n].u); |
272 | } | ||
267 | 273 | ||
268 | /* For ALLMULTI just set the mask to all ones. | 274 | /* For ALLMULTI just set the mask to all ones. |
269 | * This overrides the mask populated above. */ | 275 | * This overrides the mask populated above. */ |