When compiling cipe-1.6 with kernel 2.6.11 I get the
following errors:
/home/xxx/cipe-1.6/cipe-1.6.0/2.6.11-i386-SMP-cb/output.c:
In function `cipe_xmit':
/home/xxx/cipe-1.6/cipe-1.6.0/2.6.11-i386-SMP-cb/output.c:175:
error: structure has no member named `inet'
/home/xxx/cipe-1.6/cipe-1.6.0/2.6.11-i386-SMP-cb/output.c:197:
error: structure has no member named `inet'
These errors are caused by the IOPT macro declared in
cipe.h as
#ifdef LINUX_25
struct inet_sock *sock;
#define SOCK(c) ((struct sock*)((c)->sock))
#define IOPT(c) (&(c)->sock->inet)
#else
struct sock *sock;
#define SOCK(c) ((c)->sock)
#define IOPT(c) ((c)->sock)
#endif
The structure inet_sock in 2.6.10 was defined as shown
here:
http://lxr.linux.no/source/include/linux/ip.h?v=2.6.10#L152
struct inet_sock {
153 struct sock sk;
154 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
155 struct ipv6_pinfo *pinet6;
156 #endif
157 struct inet_opt inet;
158 };
159
While in 2.6.11, as defined here:
http://lxr.linux.no/source/include/linux/ip.h?v=2.6.11#L112
112 struct inet_sock {
113 /* sk and pinet6 has to be the first two
members of inet_sock */
114 struct sock sk;
115 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
116 struct ipv6_pinfo *pinet6;
117 #endif
118 /* Socket demultiplex comparisons on
incoming packets. */
119 __u32 daddr; /*
Foreign IPv4 addr */
120 __u32 rcv_saddr; /*
Bound local IPv4 addr */
121 __u16 dport; /*
Destination port */
122 __u16 num; /*
Local port */
123 __u32 saddr; /*
Sending source */
124 int uc_ttl; /*
Unicast TTL */
125 int tos; /*
TOS */
126 unsigned cmsg_flags;
127 struct ip_options *opt;
128 __u16 sport; /*
Source port */
129 unsigned char hdrincl; /*
Include headers ? */
130 __u8 mc_ttl; /*
Multicasting TTL */
131 __u8 mc_loop; /*
Loopback */
132 __u8 pmtudisc;
133 __u16 id; /*
ID counter for DF pkts */
134 unsigned recverr : 1,
135 freebind : 1;
136 int mc_index; /*
Multicast device index */
137 __u32 mc_addr;
138 struct ip_mc_socklist *mc_list; /*
Group array */
139 /*
140 * Following members are used to retain the
infomation to build
141 * an ip header on each ip fragmentation
while the socket is corked.
142 */
143 struct {
144 unsigned int flags;
145 unsigned int fragsize;
146 struct ip_options *opt;
147 struct rtable *rt;
148 int length; /*
Total length of all frames */
149 u32 addr;
150 struct flowi fl;
151 } cork;
152 };
So in 2.6.11 there is no inet field any more
However, the IOPT macro is used only to access the
rcv_saddr and saddr fields - these fields are
accessible directly in inet_socks, so the problem may
be fixed by simple
changing the cipe.h in the following way:
#ifdef LINUX_25
struct inet_sock *sock;
#define SOCK(c) ((struct sock*)((c)->sock))
#define IOPT(c) ((c)->sock)
#else
struct sock *sock;
#define SOCK(c) ((c)->sock)
#define IOPT(c) ((c)->sock)
#endif
After the above modifications the cipe got compiled,
and worked correctly.
Logged In: YES
user_id=548087
Certainly the above "solution" is only a
quick_and_dirty_trick (R), as it breaks compilation for
2.5.xxx-2.6.10.
It should be done in a cleaner way, with the correct
detection of the 2.6.11 version...