文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>一直困惑我的iptables time模块编译问题

一直困惑我的iptables time模块编译问题

时间:2006-05-22  来源:NetDC

http://lists.netfilter.org/pipermail/netfilter-devel/2005-December/022670.html
http://lists.netfilter.org/pipermail/netfilter-devel/2005-December/022674.html

hi,all,I download patch-o-matic-ng-20051205.tar.bz2 and iptables-1.3.4.tar.bz2 from ftp.netfilter.org,and linux-2.6.13.4.tar.bz2 from www.kernel.org.but there is some error when i compile them:

-------error messages------------

CC net/ipv4/netfilter/ipt_time.o
net/ipv4/netfilter/ipt_time.c: In function `match':
net/ipv4/netfilter/ipt_time.c:59: error: structure has no member named `tstamp'
net/ipv4/netfilter/ipt_time.c:60: warning: implicit declaration of function `__net_timestamp'
net/ipv4/netfilter/ipt_time.c:63: error: structure has no member named `tstamp'
net/ipv4/netfilter/ipt_time.c:63: error: structure has no member named `tstamp'
net/ipv4/netfilter/ipt_time.c:67: error: structure has no member named `tstamp'
make[3]: *** [net/ipv4/netfilter/ipt_time.o] Error 1
make[2]: *** [net/ipv4/netfilter] Error 2
make[1]: *** [net/ipv4] Error 2
make: *** [net] Error 2
---------------------cut here--------------------

so i read the file "ipt_time.c" and find the error is maybe at "skb->tstamp"

-------ipt_time.c------------------
static int
match(const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
const void *matchinfo,
int offset,
int *hotdrop)
{
const struct ipt_time_info *info = matchinfo; /* match info for rule */
struct tm currenttime; /* time human readable */
u_int8_t days_of_week[7] = {64, 32, 16, 8, 4, 2, 1};
u_int16_t packet_time;

/* We might not have a timestamp, get one */
if (skb->tstamp.off_sec == 0)
__net_timestamp((struct sk_buff *)skb);

/* First we make sure we are in the date start-stop boundaries */
if ((skb->tstamp.off_sec < info->date_start) || (skb->tstamp.off_sec > info->date_stop))
return 0; /* We are outside the date boundaries */

/* Transform the timestamp of the packet, in a human readable form */
localtime(skb->tstamp.off_sec, &currenttime);

/* check if we match this timestamp, we start by the days... */
if ((days_of_week[currenttime.tm_wday] & info->days_match) != days_of_week[currenttime.tm_wday])
return 0; /* the day doesn't match */

/* ... check the time now */
packet_time = (currenttime.tm_hour * 60) + currenttime.tm_min;
if ((packet_time < info->time_start) || (packet_time > info->time_stop))
return 0;

/* here we match ! */
return 1;
}
---------------------cut here--------------------

then i read the file "include/linux/skbuff.h",i find there is no the member "tstamp" in the struct "sk_buff"

--------------------skbuff.h----------------------
struct sk_buff {
/* These two members must be first. */
struct sk_buff *next;
struct sk_buff *prev;

struct sk_buff_head *list;
struct sock *sk;
struct timeval stamp;
struct net_device *dev;
struct net_device *input_dev;
struct net_device *real_dev;

union {
struct tcphdr *th;
struct udphdr *uh;
struct icmphdr *icmph;
struct igmphdr *igmph;
struct iphdr *ipiph;
struct ipv6hdr *ipv6h;
unsigned char *raw;
} h;

union {
struct iphdr *iph;
struct ipv6hdr *ipv6h;
struct arphdr *arph;
unsigned char *raw;
} nh;

union {
unsigned char *raw;
} mac;

struct dst_entry *dst;
struct sec_path *sp;

/*
* This is the control buffer. It is free to use for every
* layer. Please put your private variables there. If you
* want to keep them across layers you have to do a skb_clone()
* first. This is owned by whoever has the skb queued ATM.
*/
char cb[40];

unsigned int len,
data_len,
mac_len,
csum;
__u32 priority;
__u8 local_df:1,
cloned:1,
ip_summed:2,
nohdr:1;
/* 3 bits spare */
__u8 pkt_type;
__be16 protocol;

void (*destructor)(struct sk_buff *skb);
#ifdef CONFIG_NETFILTER
unsigned long nfmark;
__u32 nfcache;
__u32 nfctinfo;
struct nf_conntrack *nfct;

#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
unsigned char imq_flags;
struct nf_info *nf_info;
#endif

#ifdef CONFIG_BRIDGE_NETFILTER
struct nf_bridge_info *nf_bridge;
#endif
#endif /* CONFIG_NETFILTER */
#if defined(CONFIG_HIPPI)
union {
__u32 ifield;
} private;
#endif
#ifdef CONFIG_NET_SCHED
__u32 tc_index; /* traffic control index */
#ifdef CONFIG_NET_CLS_ACT
__u32 tc_verd; /* traffic control verdict */
__u32 tc_classid; /* traffic control classid */
#endif

#endif

/* These elements must be at the end, see alloc_skb() for details. */
unsigned int truesize;
atomic_t users;
unsigned char *head,
*data,
*tail,
*end;
};
---------------------cut here--------------------

what should i do,who can help me.thanks.
这是第一个家伙的问题,跟我遇到的一样,只是我的版本更新一些而已。

> hi,all,I download patch-o-matic-ng-20051205.tar.bz2 and 
> iptables-1.3.4.tar.bz2 from ftp.netfilter.org,and linux-2.6.13.4.tar.bz2
> from www.kernel.org.but there is some error when i compile them:
>
> -------error messages------------
>
> CC net/ipv4/netfilter/ipt_time.o
> net/ipv4/netfilter/ipt_time.c: In function `match':
> net/ipv4/netfilter/ipt_time.c:59: error: structure has no member named `tstamp'
> net/ipv4/netfilter/ipt_time.c:60: warning: implicit declaration of function `__net_timestamp'
> net/ipv4/netfilter/ipt_time.c:63: error: structure has no member named `tstamp'
> net/ipv4/netfilter/ipt_time.c:63: error: structure has no member named `tstamp'
> net/ipv4/netfilter/ipt_time.c:67: error: structure has no member named `tstamp'
> make[3]: *** [net/ipv4/netfilter/ipt_time.o] Error 1
> make[2]: *** [net/ipv4/netfilter] Error 2
> make[1]: *** [net/ipv4] Error 2
> make: *** [net] Error 2
> ---------------------cut here--------------------
>
> so i read the file "ipt_time.c" and find the error is maybe at "skb->tstamp"
> -------ipt_time.c------------------
<CUT>
> ---------------------cut here--------------------
>
> then i read the file "include/linux/skbuff.h",i find there is no the member "tstamp" in the struct "sk_buff"
>
> --------------------skbuff.h----------------------
<CUT>
> ---------------------cut here--------------------
>
> what should i do,who can help me.thanks.

You simply need more recent kernel (2.6.14.x) or older patch-o-matic-ng.

Best regards,

Krzysztof Olędzki

这个是第二个家伙的回答,呵呵,简单极了。

东西实在是不能求太新啊!
相关阅读 更多 +
排行榜 更多 +
奇怪的塔防

奇怪的塔防

策略塔防 下载
梦之屋3D比赛

梦之屋3D比赛

策略塔防 下载
大理石时代

大理石时代

策略塔防 下载