summaryrefslogtreecommitdiff
path: root/lib/netdev-linux.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-06-03 10:22:31 -0700
committerBen Pfaff <blp@nicira.com>2010-06-17 10:30:18 -0700
commit69123704450703f7ebea4af9e3b9635399fc21f2 (patch)
treeb797cbce941f1e2a83c9d80f02df113edb2c7257 /lib/netdev-linux.c
parentfa37b408eac875cbc0d7adbbb3f7a004371172da (diff)
downloadopenvswitch-69123704450703f7ebea4af9e3b9635399fc21f2.tar.gz
netlink: Drop sock parameter from nl_msg_put_(ge)nlmsghdr().
These two functions use their "sock" parameter only to figure out the nlmsg_pid to put in the nlmsghdr. But that field can be filled in just as well right before sending the message. Since our functions for sending Netlink messages always modify the nlmsghdr anyhow (to fill in the length), there is little benefit to filling in the nlmsg_pid in advance. The cost, on the other hand, is having to pass another argument to functions that already have too many. So this commit removes the argument.
Diffstat (limited to 'lib/netdev-linux.c')
-rw-r--r--lib/netdev-linux.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index c0bb2474c..0d77a30cb 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -1132,8 +1132,7 @@ netdev_linux_remove_policing(struct netdev *netdev)
}
ofpbuf_init(&request, 0);
- nl_msg_put_nlmsghdr(&request, rtnl_sock, sizeof *tcmsg,
- RTM_DELQDISC, NLM_F_REQUEST);
+ nl_msg_put_nlmsghdr(&request, sizeof *tcmsg, RTM_DELQDISC, NLM_F_REQUEST);
tcmsg = ofpbuf_put_zeros(&request, sizeof *tcmsg);
tcmsg->tcm_family = AF_UNSPEC;
tcmsg->tcm_ifindex = ifindex;
@@ -1694,8 +1693,7 @@ get_stats_via_netlink(int ifindex, struct netdev_stats *stats)
}
ofpbuf_init(&request, 0);
- nl_msg_put_nlmsghdr(&request, rtnl_sock, sizeof *ifi,
- RTM_GETLINK, NLM_F_REQUEST);
+ nl_msg_put_nlmsghdr(&request, sizeof *ifi, RTM_GETLINK, NLM_F_REQUEST);
ifi = ofpbuf_put_zeros(&request, sizeof *ifi);
ifi->ifi_family = PF_UNSPEC;
ifi->ifi_index = ifindex;