integrated
[ipfw.git] / dummynet2 / bsd_compat.c
index 21d19b6..1397951 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 /*
- * $Id: bsd_compat.c 5813 2010-03-22 18:05:13Z svn_magno $
+ * $Id: bsd_compat.c 6320 2010-05-24 11:54:36Z svn_panicucci $
  *
  * kernel variables and functions that are not available in linux.
  */
@@ -48,7 +48,8 @@ long tick = 1000;     /* XXX is this 100000/hz ? */
 int bootverbose = 0;
 struct timeval boottime;
 
-int     ip_defttl;
+int     ip_defttl = 64;        /* XXX set default value */
+int    max_linkhdr = 16;
 int fw_one_pass = 1;
 u_long  in_ifaddrhmask;                         /* mask for hash table */
 struct  in_ifaddrhashhead *in_ifaddrhashtbl;    /* inet addr hash table  */
@@ -365,6 +366,25 @@ fnmatch(const char *pattern, const char *string, int flags)
        return 1;       /* no match */
 }
 
+
+/*
+ * linux 2.6.33 defines these functions to access to
+ * skbuff internal structures. Define the missing
+ * function for the previous versions too.
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
+{
+        skb->dst = dst;
+}
+
+inline struct dst_entry *skb_dst(const struct sk_buff *skb)
+{
+        return (struct dst_entry *)skb->dst;
+}
+#endif
+
+
 /* support for sysctl emulation.
  * XXX this is actually MI code that should be enabled also on openwrt
  */