summaryrefslogtreecommitdiff
path: root/pfinet
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-09-21 21:15:02 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-09-21 21:15:02 +0000
commit55d2bf5bef0a04bd976b35f968598637e26e95ed (patch)
tree28c36cf6deafd8994704b678a01a149a05226ee1 /pfinet
parenta64baf761265b4a09b058e146485c102b52a3449 (diff)
Use route.h from glibc
Unfortunately the Linux source also uses <net/route.h>, so we have to both make that include the glibc-provided one, and avoid making it emit Linuxish definitions when they would conflict with glibc definitions.
Diffstat (limited to 'pfinet')
-rw-r--r--pfinet/linux-src/include/net/route.h3
-rw-r--r--pfinet/pfinet.h7
-rw-r--r--pfinet/route.h42
3 files changed, 9 insertions, 43 deletions
diff --git a/pfinet/linux-src/include/net/route.h b/pfinet/linux-src/include/net/route.h
index 40aabdf6..e9ca2fee 100644
--- a/pfinet/linux-src/include/net/route.h
+++ b/pfinet/linux-src/include/net/route.h
@@ -20,6 +20,9 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+
+#include_next <net/route.h>
+
#ifndef _ROUTE_H
#define _ROUTE_H
diff --git a/pfinet/pfinet.h b/pfinet/pfinet.h
index f8a1dd8d..df8da526 100644
--- a/pfinet/pfinet.h
+++ b/pfinet/pfinet.h
@@ -29,7 +29,12 @@
#include <sys/mman.h>
#include <sys/socket.h>
#include <pthread.h>
-#include "route.h"
+
+/* Unfortunately the Linux source also uses <net/route.h>.
+ * Here we want the glibc-provided one only */
+#define _ROUTE_H
+#include <net/route.h>
+#undef _ROUTE_H
extern pthread_mutex_t global_lock;
extern pthread_mutex_t net_bh_lock;
diff --git a/pfinet/route.h b/pfinet/route.h
deleted file mode 100644
index 00beb6c1..00000000
--- a/pfinet/route.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- Copyright (C) 2022 Free Software Foundation, Inc.
-
- This file is part of the GNU Hurd.
-
- The GNU Hurd is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- The GNU Hurd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
-
-#ifndef ROUTE_H_
-#define ROUTE_H_
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <net/if.h>
-
-typedef struct ifrtreq {
- char ifname[IFNAMSIZ];
- in_addr_t rt_dest;
- in_addr_t rt_mask;
- in_addr_t rt_gateway;
- int rt_flags;
- int rt_metric;
- int rt_mtu;
- int rt_window;
- int rt_irtt;
- int rt_tos;
- int rt_class;
-} ifrtreq_t;
-
-#endif