]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[NETLINK]: illegal use of pid in rtnetlink
authorAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Fri, 10 Feb 2006 00:40:58 +0000 (16:40 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 10 Feb 2006 00:43:41 +0000 (16:43 -0800)
When a netlink message is not related to a netlink socket,
it is issued by kernel socket with pid 0. Netlink "pid" has nothing
to do with current->pid. I called it incorrectly, if it was named "port",
the confusion would be avoided.

Signed-off-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c
net/ipv4/devinet.c
net/ipv4/fib_semantics.c

index 8700379685e0d7b1b7c74d6d6e5a5e46f7faed85..eca2976abb25b5c2b727191b72c8f5dc861c8285 100644 (file)
@@ -455,7 +455,7 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
        if (!skb)
                return;
 
-       if (rtnetlink_fill_ifinfo(skb, dev, type, current->pid, 0, change, 0) < 0) {
+       if (rtnetlink_fill_ifinfo(skb, dev, type, 0, 0, change, 0) < 0) {
                kfree_skb(skb);
                return;
        }
index 95b9d81ac488659808a93d289ddea362294a170c..3ffa60dadc0c6b7360ce91c2b58404785d6d1be3 100644 (file)
@@ -1135,7 +1135,7 @@ static void rtmsg_ifa(int event, struct in_ifaddr* ifa)
 
        if (!skb)
                netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, ENOBUFS);
-       else if (inet_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) {
+       else if (inet_fill_ifaddr(skb, ifa, 0, 0, event, 0) < 0) {
                kfree_skb(skb);
                netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, EINVAL);
        } else {
index ef4724de7350ad3ccf613b19a55afe4c662b0ab7..0f4145babb14cf78c324d83b6f99801eaf12d95a 100644 (file)
@@ -1045,7 +1045,7 @@ fib_convert_rtentry(int cmd, struct nlmsghdr *nl, struct rtmsg *rtm,
        }
 
        nl->nlmsg_flags = NLM_F_REQUEST;
-       nl->nlmsg_pid = current->pid;
+       nl->nlmsg_pid = 0;
        nl->nlmsg_seq = 0;
        nl->nlmsg_len = NLMSG_LENGTH(sizeof(*rtm));
        if (cmd == SIOCDELRT) {