* iproute2 and musl (netinet/tcp.h)
@ 2013-01-14 20:35 Daniel Cegiełka
2013-01-14 21:34 ` Szabolcs Nagy
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Cegiełka @ 2013-01-14 20:35 UTC (permalink / raw)
To: musl
[-- Attachment #1: Type: text/plain, Size: 265 bytes --]
Hi,
I'm trying to compile iproute2 (3.7.0) in sabotage. I prepared a
patch, but there is a problem with missing declarations in musl
(netinet/tcp.h) - iproute2/misc/ss.c tries to use netinet/tcp.h. Do we
need to improve netinet/tcp.h in musl?
Best regards,
Daniel
[-- Attachment #2: iproute2-3.7.0-musl.diff --]
[-- Type: application/octet-stream, Size: 1892 bytes --]
diff -urN iproute2-3.7.0.orig/include/libnetlink.h iproute2-3.7.0/include/libnetlink.h
--- iproute2-3.7.0.orig/include/libnetlink.h Tue Dec 11 17:52:39 2012
+++ iproute2-3.7.0/include/libnetlink.h Mon Jan 14 19:21:42 2013
@@ -1,6 +1,7 @@
#ifndef __LIBNETLINK_H__
#define __LIBNETLINK_H__ 1
+#include <stdio.h>
#include <string.h>
#include <asm/types.h>
#include <linux/netlink.h>
diff -urN iproute2-3.7.0.orig/include/utils.h iproute2-3.7.0/include/utils.h
--- iproute2-3.7.0.orig/include/utils.h Tue Dec 11 17:52:39 2012
+++ iproute2-3.7.0/include/utils.h Mon Jan 14 19:21:42 2013
@@ -1,6 +1,10 @@
#ifndef __UTILS_H__
#define __UTILS_H__ 1
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/param.h>
+#include <limits.h>
#include <asm/types.h>
#include <resolv.h>
#include <stdlib.h>
diff -urN iproute2-3.7.0.orig/ip/ipaddress.c iproute2-3.7.0/ip/ipaddress.c
--- iproute2-3.7.0.orig/ip/ipaddress.c Tue Dec 11 17:52:39 2012
+++ iproute2-3.7.0/ip/ipaddress.c Mon Jan 14 19:21:42 2013
@@ -19,7 +19,7 @@
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
diff -urN iproute2-3.7.0.orig/lib/utils.c iproute2-3.7.0/lib/utils.c
--- iproute2-3.7.0.orig/lib/utils.c Tue Dec 11 17:52:39 2012
+++ iproute2-3.7.0/lib/utils.c Mon Jan 14 19:21:42 2013
@@ -27,6 +27,10 @@
#include <errno.h>
+#ifndef HZ
+#define HZ 100
+#endif
+
#include "utils.h"
int get_integer(int *val, const char *arg, int base)
diff -urN iproute2-3.7.0.orig/misc/lnstat.h iproute2-3.7.0/misc/lnstat.h
--- iproute2-3.7.0.orig/misc/lnstat.h Tue Dec 11 17:52:39 2012
+++ iproute2-3.7.0/misc/lnstat.h Mon Jan 14 19:21:42 2013
@@ -1,6 +1,7 @@
#ifndef _LNSTAT_H
#define _LNSTAT_H
+#include <sys/time.h>
#include <limits.h>
#define LNSTAT_VERSION "0.02 041002"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: iproute2 and musl (netinet/tcp.h)
2013-01-14 20:35 iproute2 and musl (netinet/tcp.h) Daniel Cegiełka
@ 2013-01-14 21:34 ` Szabolcs Nagy
2013-01-14 22:00 ` Daniel Cegiełka
2013-01-14 22:01 ` Rich Felker
0 siblings, 2 replies; 6+ messages in thread
From: Szabolcs Nagy @ 2013-01-14 21:34 UTC (permalink / raw)
To: musl
* Daniel Cegie?ka <daniel.cegielka@gmail.com> [2013-01-14 21:35:16 +0100]:
> (netinet/tcp.h) - iproute2/misc/ss.c tries to use netinet/tcp.h. Do we
> need to improve netinet/tcp.h in musl?
>
i think we should provide the TCP_* socket options
from linux/tcp.h and hide SOL_TCP under feature
test macros as posix only reserves TCP_ for netinet/tcp.h
i searched for tcp things in the iproute package using
codesearch.debian.net and it seems it provides its own
netinet/tcp.h, i guess iproute2 should do the same
or use the linux header directly if it wants something
special
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: iproute2 and musl (netinet/tcp.h)
2013-01-14 21:34 ` Szabolcs Nagy
@ 2013-01-14 22:00 ` Daniel Cegiełka
2013-01-14 22:01 ` Rich Felker
1 sibling, 0 replies; 6+ messages in thread
From: Daniel Cegiełka @ 2013-01-14 22:00 UTC (permalink / raw)
To: musl
2013/1/14 Szabolcs Nagy <nsz@port70.net>:
> * Daniel Cegie?ka <daniel.cegielka@gmail.com> [2013-01-14 21:35:16 +0100]:
>> (netinet/tcp.h) - iproute2/misc/ss.c tries to use netinet/tcp.h. Do we
>> need to improve netinet/tcp.h in musl?
>>
>
> i think we should provide the TCP_* socket options
> from linux/tcp.h and hide SOL_TCP under feature
> test macros as posix only reserves TCP_ for netinet/tcp.h
>
> i searched for tcp things in the iproute package using
> codesearch.debian.net and it seems it provides its own
> netinet/tcp.h, i guess iproute2 should do the same
> or use the linux header directly if it wants something
> special
ok, thanks
Daniel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: iproute2 and musl (netinet/tcp.h)
2013-01-14 21:34 ` Szabolcs Nagy
2013-01-14 22:00 ` Daniel Cegiełka
@ 2013-01-14 22:01 ` Rich Felker
2013-01-15 9:05 ` Igmar Palsenberg
1 sibling, 1 reply; 6+ messages in thread
From: Rich Felker @ 2013-01-14 22:01 UTC (permalink / raw)
To: musl
On Mon, Jan 14, 2013 at 10:34:02PM +0100, Szabolcs Nagy wrote:
> * Daniel Cegie?ka <daniel.cegielka@gmail.com> [2013-01-14 21:35:16 +0100]:
> > (netinet/tcp.h) - iproute2/misc/ss.c tries to use netinet/tcp.h. Do we
> > need to improve netinet/tcp.h in musl?
> >
>
> i think we should provide the TCP_* socket options
> from linux/tcp.h and hide SOL_TCP under feature
> test macros as posix only reserves TCP_ for netinet/tcp.h
Yes, this seems right; I can't find any reference to SOL_TCP being
allowed or reserved. Actually, SOL_TCP seems to be nonstandard
nonsense. The correct macro to use seems to be IPPROTO_TCP. See POSIX:
The <netinet/tcp.h> header shall define the following symbolic
constant for use as a socket option at the IPPROTO_TCP level:
TCP_NODELAY
Avoid coalescing of small segments.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_tcp.h.html
Rich
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: iproute2 and musl (netinet/tcp.h)
2013-01-14 22:01 ` Rich Felker
@ 2013-01-15 9:05 ` Igmar Palsenberg
2013-01-15 10:48 ` Daniel Cegiełka
0 siblings, 1 reply; 6+ messages in thread
From: Igmar Palsenberg @ 2013-01-15 9:05 UTC (permalink / raw)
To: musl
>> i think we should provide the TCP_* socket options
>> from linux/tcp.h and hide SOL_TCP under feature
>> test macros as posix only reserves TCP_ for netinet/tcp.h
>
> Yes, this seems right; I can't find any reference to SOL_TCP being
> allowed or reserved. Actually, SOL_TCP seems to be nonstandard
> nonsense. The correct macro to use seems to be IPPROTO_TCP. See POSIX:
Correct. SOL_TCP is Linux only AFAIK. I've always replace SOL_TCP with IPPROTO_TCP, and
that always worked fine.
Igmar
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: iproute2 and musl (netinet/tcp.h)
2013-01-15 9:05 ` Igmar Palsenberg
@ 2013-01-15 10:48 ` Daniel Cegiełka
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Cegiełka @ 2013-01-15 10:48 UTC (permalink / raw)
To: musl
> See POSIX:
There are few problems that can be further improved in iproute2, like
bison vs POSIX yacc (tc/emp_ematch.y):
%{
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include "m_ematch.h"
%}
%locations
%token-table
%error-verbose
%name-prefix="ematch_"
(...)
and bash, but it doesn't apply directly to musl.
Daniel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-01-15 10:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-14 20:35 iproute2 and musl (netinet/tcp.h) Daniel Cegiełka
2013-01-14 21:34 ` Szabolcs Nagy
2013-01-14 22:00 ` Daniel Cegiełka
2013-01-14 22:01 ` Rich Felker
2013-01-15 9:05 ` Igmar Palsenberg
2013-01-15 10:48 ` Daniel Cegiełka
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).