Discussion:
[Linuxptp-devel] patches for RHEL 6.6, discussed on linuxptp-users
Brian Olson
2017-06-15 16:16:43 UTC
Permalink
Miroslav Lichvar suggested that I submit these changes to linuxptp-devel.

This is a couple of changes we were discussing on linuxptp-users.

The first avoids having phc2sys end up synching off by 2 seconds when using linreg on RHEL 6.6. The second just avoids some compile errors:


In file included from rtnl.c:21:
/usr/include/linux/netlink.h:35: error: expected specifier-qualifier-list before ‘sa_family_t’
rtnl.c: In function ‘rtnl_link_query’:
rtnl.c:59: error: ‘struct sockaddr_nl’ has no member named ‘nl_family’
rtnl.c: In function ‘rtnl_open’:
rtnl.c:154: error: ‘struct sockaddr_nl’ has no member named ‘nl_family’
rtnl.c:155: error: ‘struct sockaddr_nl’ has no member named ‘nl_groups’
make: *** [rtnl.o] Error 1
Richard Cochran
2017-06-16 07:02:16 UTC
Permalink
Post by Brian Olson
Miroslav Lichvar suggested that I submit these changes to linuxptp-devel.
Can you please resubmit those as two separate emails (not as
attachments), adding a SOB line. See the file, README.org, under
"Submitting Patches".
Post by Brian Olson
/usr/include/linux/netlink.h:35: error: expected specifier-qualifier-list before ‘sa_family_t’
rtnl.c:59: error: ‘struct sockaddr_nl’ has no member named ‘nl_family’
rtnl.c:154: error: ‘struct sockaddr_nl’ has no member named ‘nl_family’
rtnl.c:155: error: ‘struct sockaddr_nl’ has no member named ‘nl_groups’
make: *** [rtnl.o] Error 1
I don't get this. We already include <sys/socket.h>

#include <asm/types.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <net/if.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>

here ----------- ^^^

It appears that your C library headers are broken. How can this be?
Aren't you using RH enterprise?

In non-broken C libraries and C language programming in general, the
order of include directives is freely changeable.

In any case, your patch should at least avoid including the same
header twice.

Thanks,
Richard
Miroslav Lichvar
2017-06-16 07:11:35 UTC
Permalink
Post by Richard Cochran
Post by Brian Olson
/usr/include/linux/netlink.h:35: error: expected specifier-qualifier-list before ‘sa_family_t’
rtnl.c:59: error: ‘struct sockaddr_nl’ has no member named ‘nl_family’
rtnl.c:154: error: ‘struct sockaddr_nl’ has no member named ‘nl_family’
rtnl.c:155: error: ‘struct sockaddr_nl’ has no member named ‘nl_groups’
make: *** [rtnl.o] Error 1
I don't get this. We already include <sys/socket.h>
It appears that your C library headers are broken. How can this be?
Aren't you using RH enterprise?
In non-broken C libraries and C language programming in general, the
order of include directives is freely changeable.
FWIW, this kernel commit has some context:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
--
Miroslav Lichvar
Loading...