Lines Matching refs:ifm
610 struct ifinfomsg *ifm; in rtnl_fill_ifinfo() local
615 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ifm), flags); in rtnl_fill_ifinfo()
619 ifm = nlmsg_data(nlh); in rtnl_fill_ifinfo()
620 ifm->ifi_family = AF_UNSPEC; in rtnl_fill_ifinfo()
621 ifm->__ifi_pad = 0; in rtnl_fill_ifinfo()
622 ifm->ifi_type = dev->type; in rtnl_fill_ifinfo()
623 ifm->ifi_index = dev->ifindex; in rtnl_fill_ifinfo()
624 ifm->ifi_flags = dev_get_flags(dev); in rtnl_fill_ifinfo()
625 ifm->ifi_change = change; in rtnl_fill_ifinfo()
762 static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, in do_setlink() argument
855 if (ifm->ifi_index > 0 && ifname[0]) { in do_setlink()
875 if (ifm->ifi_flags || ifm->ifi_change) { in do_setlink()
876 unsigned int flags = ifm->ifi_flags; in do_setlink()
879 if (ifm->ifi_change) in do_setlink()
880 flags = (flags & ifm->ifi_change) | in do_setlink()
881 (dev->flags & ~ifm->ifi_change); in do_setlink()
916 struct ifinfomsg *ifm; in rtnl_setlink() local
922 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); in rtnl_setlink()
932 ifm = nlmsg_data(nlh); in rtnl_setlink()
933 if (ifm->ifi_index > 0) in rtnl_setlink()
934 dev = dev_get_by_index(net, ifm->ifi_index); in rtnl_setlink()
948 err = do_setlink(dev, ifm, tb, ifname, 0); in rtnl_setlink()
960 struct ifinfomsg *ifm; in rtnl_dellink() local
965 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); in rtnl_dellink()
972 ifm = nlmsg_data(nlh); in rtnl_dellink()
973 if (ifm->ifi_index > 0) in rtnl_dellink()
974 dev = __dev_get_by_index(net, ifm->ifi_index); in rtnl_dellink()
1039 struct ifinfomsg *ifm; in rtnl_newlink() local
1049 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); in rtnl_newlink()
1058 ifm = nlmsg_data(nlh); in rtnl_newlink()
1059 if (ifm->ifi_index > 0) in rtnl_newlink()
1060 dev = __dev_get_by_index(net, ifm->ifi_index); in rtnl_newlink()
1123 return do_setlink(dev, ifm, tb, ifname, modified); in rtnl_newlink()
1129 if (ifm->ifi_index || ifm->ifi_flags || ifm->ifi_change) in rtnl_newlink()
1169 struct ifinfomsg *ifm; in rtnl_getlink() local
1175 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); in rtnl_getlink()
1179 ifm = nlmsg_data(nlh); in rtnl_getlink()
1180 if (ifm->ifi_index > 0) { in rtnl_getlink()
1181 dev = dev_get_by_index(net, ifm->ifi_index); in rtnl_getlink()