Work around bugs in system headers.
authorBen Pfaff <blp@nicira.com>
Fri, 12 Feb 2010 20:51:36 +0000 (12:51 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 12 Feb 2010 21:56:15 +0000 (13:56 -0800)
On some system, at least, one must include <sys/types.h> before
<netinet/in.h>, and <netinet/in.h> before <arpa/inet.h> or <net/if.h>.

From Jean Tourrilhes <jt@hpl.hp.com>.

lib/dpif-netdev.c
lib/flow.h
lib/ofp-print.c
lib/stp.c
ofproto/pinsched.c

index 1daa93b..2fd2bed 100644 (file)
@@ -22,8 +22,8 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <inttypes.h>
-#include <net/if.h>
 #include <netinet/in.h>
+#include <net/if.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/ioctl.h>
index cb20109..bc6fb91 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
 #ifndef FLOW_H
 #define FLOW_H 1
 
+#include <sys/types.h>
 #include <netinet/in.h>
 #include <stdbool.h>
 #include <stdint.h>
index 4997a0a..af53438 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <inttypes.h>
+#include <sys/types.h>
 #include <netinet/in.h>
 #include <sys/wait.h>
 #include <stdarg.h>
index 87230bd..5d35156 100644 (file)
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,8 @@
  * applies to all modifications. */
 
 #include "stp.h"
+#include <sys/types.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <assert.h>
 #include <inttypes.h>
index 306d851..bc7bd11 100644 (file)
@@ -16,6 +16,8 @@
 
 #include <config.h>
 #include "pinsched.h"
+#include <sys/types.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdint.h>
 #include <stdlib.h>