Lines Matching refs:entry
166 struct br_mdb_entry *entry, u32 pid, in nlmsg_populate_mdb_fill() argument
188 if (nla_put(skb, MDBA_MDB_ENTRY_INFO, sizeof(*entry), entry)) in nlmsg_populate_mdb_fill()
208 static void __br_mdb_notify(struct net_device *dev, struct br_mdb_entry *entry, in __br_mdb_notify() argument
219 err = nlmsg_populate_mdb_fill(skb, dev, entry, 0, 0, type, NTF_SELF); in __br_mdb_notify()
234 struct br_mdb_entry entry; in br_mdb_notify() local
236 memset(&entry, 0, sizeof(entry)); in br_mdb_notify()
237 entry.ifindex = port->dev->ifindex; in br_mdb_notify()
238 entry.addr.proto = group->proto; in br_mdb_notify()
239 entry.addr.u.ip4 = group->u.ip4; in br_mdb_notify()
241 entry.addr.u.ip6 = group->u.ip6; in br_mdb_notify()
243 __br_mdb_notify(dev, &entry, type); in br_mdb_notify()
246 static bool is_valid_mdb_entry(struct br_mdb_entry *entry) in is_valid_mdb_entry() argument
248 if (entry->ifindex == 0) in is_valid_mdb_entry()
251 if (entry->addr.proto == htons(ETH_P_IP)) { in is_valid_mdb_entry()
252 if (!ipv4_is_multicast(entry->addr.u.ip4)) in is_valid_mdb_entry()
254 if (ipv4_is_local_multicast(entry->addr.u.ip4)) in is_valid_mdb_entry()
257 } else if (entry->addr.proto == htons(ETH_P_IPV6)) { in is_valid_mdb_entry()
258 if (ipv6_addr_is_ll_all_nodes(&entry->addr.u.ip6)) in is_valid_mdb_entry()
263 if (entry->state != MDB_PERMANENT && entry->state != MDB_TEMPORARY) in is_valid_mdb_entry()
273 struct br_mdb_entry *entry; in br_mdb_parse() local
308 entry = nla_data(tb[MDBA_SET_ENTRY]); in br_mdb_parse()
309 if (!is_valid_mdb_entry(entry)) { in br_mdb_parse()
314 *pentry = entry; in br_mdb_parse()
354 struct br_mdb_entry *entry) in __br_mdb_add() argument
364 dev = __dev_get_by_index(net, entry->ifindex); in __br_mdb_add()
373 ip.proto = entry->addr.proto; in __br_mdb_add()
375 ip.u.ip4 = entry->addr.u.ip4; in __br_mdb_add()
378 ip.u.ip6 = entry->addr.u.ip6; in __br_mdb_add()
382 ret = br_mdb_add_group(br, p, &ip, entry->state); in __br_mdb_add()
390 struct br_mdb_entry *entry; in br_mdb_add() local
395 err = br_mdb_parse(skb, nlh, &dev, &entry); in br_mdb_add()
401 err = __br_mdb_add(net, br, entry); in br_mdb_add()
403 __br_mdb_notify(dev, entry, RTM_NEWMDB); in br_mdb_add()
407 static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry) in __br_mdb_del() argument
420 ip.proto = entry->addr.proto; in __br_mdb_del()
425 ip.u.ip4 = entry->addr.u.ip4; in __br_mdb_del()
431 ip.u.ip6 = entry->addr.u.ip6; in __br_mdb_del()
445 if (!p->port || p->port->dev->ifindex != entry->ifindex) in __br_mdb_del()
471 struct br_mdb_entry *entry; in br_mdb_del() local
475 err = br_mdb_parse(skb, nlh, &dev, &entry); in br_mdb_del()
481 err = __br_mdb_del(br, entry); in br_mdb_del()
483 __br_mdb_notify(dev, entry, RTM_DELMDB); in br_mdb_del()