summaryrefslogtreecommitdiffstats
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-01-08 09:58:19 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-01-08 09:58:19 -0800
commit32d89608c6383feb60781117a72e0e10f388626d (patch)
tree19398240f039802ad3ad6f69991037f61f092d69 /zebra/rt_netlink.c
parentdcc88cf610dea7cd46738706c6e81cd23eb0a797 (diff)
downloadquagga-32d89608c6383feb60781117a72e0e10f388626d.tar.bz2
quagga-32d89608c6383feb60781117a72e0e10f388626d.tar.xz
Move pid check back to original location
There is a possiblity of some hostile netlink user getting bogus responses in the conversation between zebra and kernel.
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index a1fbb7c4..850a271e 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -290,6 +290,13 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *),
return -1;
}
+ /* JF: Ignore messages that aren't from the kernel */
+ if ( snl.nl_pid != 0 )
+ {
+ zlog ( NULL, LOG_ERR, "Ignoring message from pid %u", snl.nl_pid );
+ continue;
+ }
+
for (h = (struct nlmsghdr *) buf; NLMSG_OK (h, (unsigned int) status);
h = NLMSG_NEXT (h, status))
{
@@ -1050,13 +1057,6 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
static int
netlink_information_fetch (struct sockaddr_nl *snl, struct nlmsghdr *h)
{
- /* JF: Ignore messages that aren't from the kernel */
- if ( snl->nl_pid != 0 )
- {
- zlog ( NULL, LOG_ERR, "Ignoring message from pid %u", snl->nl_pid );
- return 0;
- }
-
switch (h->nlmsg_type)
{
case RTM_NEWROUTE: