Lines Matching refs:ndm
3926 struct ndmsg *ndm; in nlmsg_populate_fdb_fill() local
3928 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), nlflags); in nlmsg_populate_fdb_fill()
3932 ndm = nlmsg_data(nlh); in nlmsg_populate_fdb_fill()
3933 ndm->ndm_family = AF_BRIDGE; in nlmsg_populate_fdb_fill()
3934 ndm->ndm_pad1 = 0; in nlmsg_populate_fdb_fill()
3935 ndm->ndm_pad2 = 0; in nlmsg_populate_fdb_fill()
3936 ndm->ndm_flags = flags; in nlmsg_populate_fdb_fill()
3937 ndm->ndm_type = 0; in nlmsg_populate_fdb_fill()
3938 ndm->ndm_ifindex = dev->ifindex; in nlmsg_populate_fdb_fill()
3939 ndm->ndm_state = ndm_state; in nlmsg_populate_fdb_fill()
3990 int ndo_dflt_fdb_add(struct ndmsg *ndm, in ndo_dflt_fdb_add() argument
4001 if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) { in ndo_dflt_fdb_add()
4050 struct ndmsg *ndm; in rtnl_fdb_add() local
4057 err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, in rtnl_fdb_add()
4062 ndm = nlmsg_data(nlh); in rtnl_fdb_add()
4063 if (ndm->ndm_ifindex == 0) { in rtnl_fdb_add()
4068 dev = __dev_get_by_index(net, ndm->ndm_ifindex); in rtnl_fdb_add()
4093 if ((!ndm->ndm_flags || ndm->ndm_flags & NTF_MASTER) && in rtnl_fdb_add()
4098 err = ops->ndo_fdb_add(ndm, tb, dev, addr, vid, in rtnl_fdb_add()
4103 ndm->ndm_flags &= ~NTF_MASTER; in rtnl_fdb_add()
4107 if ((ndm->ndm_flags & NTF_SELF)) { in rtnl_fdb_add()
4109 err = dev->netdev_ops->ndo_fdb_add(ndm, tb, dev, addr, in rtnl_fdb_add()
4114 err = ndo_dflt_fdb_add(ndm, tb, dev, addr, vid, in rtnl_fdb_add()
4119 ndm->ndm_state); in rtnl_fdb_add()
4120 ndm->ndm_flags &= ~NTF_SELF; in rtnl_fdb_add()
4130 int ndo_dflt_fdb_del(struct ndmsg *ndm, in ndo_dflt_fdb_del() argument
4140 if (!(ndm->ndm_state & NUD_PERMANENT)) { in ndo_dflt_fdb_del()
4158 struct ndmsg *ndm; in rtnl_fdb_del() local
4168 err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, in rtnl_fdb_del()
4173 ndm = nlmsg_data(nlh); in rtnl_fdb_del()
4174 if (ndm->ndm_ifindex == 0) { in rtnl_fdb_del()
4179 dev = __dev_get_by_index(net, ndm->ndm_ifindex); in rtnl_fdb_del()
4204 if ((!ndm->ndm_flags || ndm->ndm_flags & NTF_MASTER) && in rtnl_fdb_del()
4210 err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid); in rtnl_fdb_del()
4215 ndm->ndm_flags &= ~NTF_MASTER; in rtnl_fdb_del()
4219 if (ndm->ndm_flags & NTF_SELF) { in rtnl_fdb_del()
4221 err = dev->netdev_ops->ndo_fdb_del(ndm, tb, dev, addr, in rtnl_fdb_del()
4224 err = ndo_dflt_fdb_del(ndm, tb, dev, addr, vid); in rtnl_fdb_del()
4228 ndm->ndm_state); in rtnl_fdb_del()
4229 ndm->ndm_flags &= ~NTF_SELF; in rtnl_fdb_del()
4303 struct ndmsg *ndm; in valid_fdb_dump_strict() local
4306 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ndm))) { in valid_fdb_dump_strict()
4311 ndm = nlmsg_data(nlh); in valid_fdb_dump_strict()
4312 if (ndm->ndm_pad1 || ndm->ndm_pad2 || ndm->ndm_state || in valid_fdb_dump_strict()
4313 ndm->ndm_flags || ndm->ndm_type) { in valid_fdb_dump_strict()
4323 *brport_idx = ndm->ndm_ifindex; in valid_fdb_dump_strict()
4492 struct ndmsg *ndm; in valid_fdb_get_strict() local
4495 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ndm))) { in valid_fdb_get_strict()
4500 ndm = nlmsg_data(nlh); in valid_fdb_get_strict()
4501 if (ndm->ndm_pad1 || ndm->ndm_pad2 || ndm->ndm_state || in valid_fdb_get_strict()
4502 ndm->ndm_type) { in valid_fdb_get_strict()
4507 if (ndm->ndm_flags & ~(NTF_MASTER | NTF_SELF)) { in valid_fdb_get_strict()
4517 *ndm_flags = ndm->ndm_flags; in valid_fdb_get_strict()
4518 *brport_idx = ndm->ndm_ifindex; in valid_fdb_get_strict()