|
|||||||||||
|
Re: linux-ipsec: Latest snapshot and 2.0.35
From: Richard Guy Briggs <rgb(at)conscoop.ottawa.on.ca>
Date: Tue Jul 28 1998 - 21:16:26 EDT
Right. That is why it is encapsulated with #ifdef CONFIG_IPSEC. If I wanted it for both, I would put #ifdef CONFIG_IPSEC_MODULE as well. I am not absolutely certain that it does not set CONFIG_IPSEC when it is set to a module, only because of continuing reports of problems. I am using those here without problems. This is why I wonder if you haven't properly cleaned your kernel. If the protocol.o file does not get remade when you reconfig the kernel, you will see this problem, therefore, it is important to do 'make dep clean zImage install modules modules_install' (oh, and don't forget to uncomment the 'INSTALL' option in the main kernel makefile) every time you change config. > Structure entries have been added to the inet_protocols which
It compiles and works for my module case. It compiles and works for Hugh's static link case. > This may be an oversimplification and there may yet be other
Funny, I'm doing it...I should probably download the snapshot (in fact I will, just before the next release) to test it under several different circumstances. Could you confirm that your net/ipv4/protocol.c looks like the attached file? The original file was a little awkward and not scalable. It has been redone.
slainte mhath, RGB
Richard Guy Briggs -- PGP key available Auto-Free Ottawa! rgb at conscoop dot ottawa dot on dot ca http://www.flora.org/afo/http://www.achilles.net/~rgb/ Ottawa-Rideau Bioregion, CanadaPlease send all spam to root@127.0.0.1
"We left our footprints in the Earth
#include #define NEXT_PROTO NULL static struct inet_protocol icmp_protocol = {
icmp_rcv, /* ICMP handler */
NULL, /* ICMP error control */
NEXT_PROTO, /* next */
#undef NEXT_PROTO
#define NEXT_PROTO &icmp_protocol
IPPROTO_ICMP, /* protocol ID */
0, /* copy */
NULL, /* data */
"ICMP" /* name */
};
#ifdef CONFIG_IP_MULTICAST
igmp_rcv, /* IGMP handler */
NULL, /* IGMP error control */
NEXT_PROTO, /* next */
#undef NEXT_PROTO
#define NEXT_PROTO &igmp_protocol
IPPROTO_IGMP, /* protocol ID */
0, /* copy */
NULL, /* data */
"IGMP" /* name */
};
#endif /* CONFIG_IP_MULTICAST */
#ifdef CONFIG_NET_IPIP
ipip_rcv, /* IPIP handler */
NULL, /* TUNNEL error control */
NEXT_PROTO, /* next */
#undef NEXT_PROTO
#define NEXT_PROTO &ipip_protocol
IPPROTO_IPIP, /* protocol ID */
0, /* copy */
NULL, /* data */
"IPIP" /* name */
};
#endif /* CONFIG_NET_IPIP */ static struct inet_protocol tcp_protocol = {
tcp_rcv, /* TCP handler */
tcp_err, /* TCP error control */
NEXT_PROTO, /* next */
#undef NEXT_PROTO
#define NEXT_PROTO &tcp_protocol
IPPROTO_TCP, /* protocol ID */
0, /* copy */
NULL, /* data */
"TCP" /* name */
};
static struct inet_protocol udp_protocol = {
udp_rcv, /* UDP handler */
udp_err, /* UDP error control */
NEXT_PROTO, /* next */
#undef NEXT_PROTO
#define NEXT_PROTO &udp_protocol
IPPROTO_UDP, /* protocol ID */
0, /* copy */
NULL, /* data */
"UDP" /* name */
};
#ifdef CONFIG_IPSEC
esp_rcv, /* ESP handler */
#if 0
NULL, /* Will be UDP fraglist handler */
#endif
NULL, /* TUNNEL error control */
NEXT_PROTO, /* next */
#undef NEXT_PROTO
#define NEXT_PROTO &esp_protocol
IPPROTO_ESP, /* protocol ID */
0, /* copy */
NULL, /* data */
"ESP" /* name */
};
#endif /* CONFIG_IPSEC_ESP */
#ifdef CONFIG_IPSEC_AH
ah_rcv, /* AH handler */
#if 0
NULL, /* Will be UDP fraglist handler */
#endif
NULL, /* TUNNEL error control */
NEXT_PROTO, /* next */
#undef NEXT_PROTO
#define NEXT_PROTO &ah_protocol
IPPROTO_AH, /* protocol ID */
0, /* copy */
NULL, /* data */
"AH" /* name */
};
#endif /* CONFIG_IPSEC_AH */ #endif /* CONFIG_IPSEC */ struct inet_protocol *inet_protocol_base = NEXT_PROTO; struct inet_protocol *inet_protos[MAX_INET_PROTOS] = { NULL
/* * Find a protocol in the protocol tables given its * IP type. */ struct inet_protocol *inet_get_protocol(unsigned char prot) {
unsigned char hash;
struct inet_protocol *p;
hash = prot & (MAX_INET_PROTOS - 1);
for (p = inet_protos[hash] ; p != NULL; p=p->next)
{
if (p->protocol == prot)
return((struct inet_protocol *) p);
}
return(NULL);
} /* * Add a protocol handler to the hash tables */ void inet_add_protocol(struct inet_protocol *prot) {
unsigned char hash;
struct inet_protocol *p2;
hash = prot->protocol & (MAX_INET_PROTOS - 1);
prot ->next = inet_protos[hash];
inet_protos[hash] = prot;
prot->copy = 0;
/*
* Set the copy bit if we need to.
*/
p2 = (struct inet_protocol *) prot->next;
while(p2 != NULL)
{
if (p2->protocol == prot->protocol)
{
prot->copy = 1;
break;
}
p2 = (struct inet_protocol *) p2->next;
}
} /* * Remove a protocol from the hash tables. */ int inet_del_protocol(struct inet_protocol *prot) {
struct inet_protocol *p;
struct inet_protocol *lp = NULL;
unsigned char hash;
hash = prot->protocol & (MAX_INET_PROTOS - 1);
if (prot == inet_protos[hash])
{
inet_protos[hash] = (struct inet_protocol *) inet_protos[hash]->next;
return(0);
}
p = (struct inet_protocol *) inet_protos[hash];
while(p != NULL)
{
/*
* We have to worry if the protocol being deleted is
* the last one on the list, then we may need to reset
* someone's copied bit.
*/
if (p->next != NULL && p->next == prot)
{
/*
* if we are the last one with this protocol and
* there is a previous one, reset its copy bit.
*/
if (p->copy == 0 && lp != NULL)
lp->copy = 0;
p->next = prot->next;
return(0);
}
if (p->next != NULL && p->next->protocol == prot->protocol)
lp = p;
p = (struct inet_protocol *) p->next;
}
return(-1);
} -----BEGIN PGP SIGNATURE-----
iQCVAwUBNb536N+sBuIhFagtAQEO4gP/d+2cVupNtCBBHXSOOAZ/Faxo/rcavYlg
g3mEcJxMRV2sN/8DVNLzwSOLU+hR/xQjOSQaHivFU97g72TlX9b1rlDO/0IAnN7L
aOLIiJ8vq5ehtW9qiDL1jUM6A5k6u42mHFwg+t4VqwyxH6RO8sbAuPLf367WZbuN
suguNPwV3IU=
This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 12:59:25 EDT |
||||||||||
|
|||||||||||