rtnetlink.c (5a2dd72abdae75ea2960145e0549635ce4e0be96) rtnetlink.c (1ce85fe402137824246bad03ff85f3913d565c17)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 441 unchanged lines hidden (view full) ---

450
451int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid)
452{
453 struct sock *rtnl = net->rtnl;
454
455 return nlmsg_unicast(rtnl, skb, pid);
456}
457
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 441 unchanged lines hidden (view full) ---

450
451int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid)
452{
453 struct sock *rtnl = net->rtnl;
454
455 return nlmsg_unicast(rtnl, skb, pid);
456}
457
458int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
459 struct nlmsghdr *nlh, gfp_t flags)
458void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
459 struct nlmsghdr *nlh, gfp_t flags)
460{
461 struct sock *rtnl = net->rtnl;
462 int report = 0;
463
464 if (nlh)
465 report = nlmsg_report(nlh);
466
460{
461 struct sock *rtnl = net->rtnl;
462 int report = 0;
463
464 if (nlh)
465 report = nlmsg_report(nlh);
466
467 return nlmsg_notify(rtnl, skb, pid, group, report, flags);
467 nlmsg_notify(rtnl, skb, pid, group, report, flags);
468}
469
470void rtnl_set_sk_err(struct net *net, u32 group, int error)
471{
472 struct sock *rtnl = net->rtnl;
473
474 netlink_set_err(rtnl, 0, group, error);
475}

--- 765 unchanged lines hidden (view full) ---

1241
1242 err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0);
1243 if (err < 0) {
1244 /* -EMSGSIZE implies BUG in if_nlmsg_size() */
1245 WARN_ON(err == -EMSGSIZE);
1246 kfree_skb(skb);
1247 goto errout;
1248 }
468}
469
470void rtnl_set_sk_err(struct net *net, u32 group, int error)
471{
472 struct sock *rtnl = net->rtnl;
473
474 netlink_set_err(rtnl, 0, group, error);
475}

--- 765 unchanged lines hidden (view full) ---

1241
1242 err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0);
1243 if (err < 0) {
1244 /* -EMSGSIZE implies BUG in if_nlmsg_size() */
1245 WARN_ON(err == -EMSGSIZE);
1246 kfree_skb(skb);
1247 goto errout;
1248 }
1249 err = rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_KERNEL);
1249 rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_KERNEL);
1250 return;
1250errout:
1251 if (err < 0)
1252 rtnl_set_sk_err(net, RTNLGRP_LINK, err);
1253}
1254
1255/* Protected by RTNL sempahore. */
1256static struct rtattr **rta_buf;
1257static int rtattr_max;

--- 173 unchanged lines hidden ---
1251errout:
1252 if (err < 0)
1253 rtnl_set_sk_err(net, RTNLGRP_LINK, err);
1254}
1255
1256/* Protected by RTNL sempahore. */
1257static struct rtattr **rta_buf;
1258static int rtattr_max;

--- 173 unchanged lines hidden ---