* Q about ip_local_deliver_finish
@ 2001-05-22 11:34 Alexey Vyskubov
2001-05-22 11:55 ` Alexey Vyskubov
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Vyskubov @ 2001-05-22 11:34 UTC (permalink / raw)
To: linux-kernel
Hello.
I have a question (maybe stupid but I spent a lot of time trying to find an
answer)about ip_local_deliver_finish() in 2.4.4. kernel.
I'll be very grateful if someone explains me what's happening.
There is the following piece of code in ip_local_deliver_finish()
(in net/ipv4/ip_input.c):
if(ipprot != NULL) {
if(raw_sk == NULL &&
ipprot->next == NULL &&
ipprot->protocol == protocol) {
int ret;
/* Fast path... */
ret = ipprot->handler(skb);
return ret;
} else {
flag = ip_run_ipprot(skb, skb->nh.iph, ipprot, (raw_sk != NULL));
}
[some comments skipped]
if(raw_sk != NULL) { /* Shift to last raw user */
raw_rcv(raw_sk, skb);
sock_put(raw_sk);
} else if (!flag) { /* Free and report errors */
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PROT_UNREACH, 0);
out:
kfree_skb(skb);
}
}
return 0;
But in ip_run_ipprot the return value of ipprot->handler is just ignored,
code below:
if(skb2 != NULL) {
ret = 1;
ipprot->handler(skb2);
}
If I understand correctly it means that if we have two different protocols
with the same (modulo MAX_INET_PROTOS) protocol number then
ip_local_deliver will return the return value of ipprot->handler for the
first protocol in the chain
inet_protos[protocol number modulo MAX_INET_PROTOS] and *always zero* for the
second. Why? Is it a bug or I just do not understand something?
--
Alexey
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Q about ip_local_deliver_finish
2001-05-22 11:34 Q about ip_local_deliver_finish Alexey Vyskubov
@ 2001-05-22 11:55 ` Alexey Vyskubov
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Vyskubov @ 2001-05-22 11:55 UTC (permalink / raw)
To: linux-kernel
> If I understand correctly it means that if we have two different protocols
> with the same (modulo MAX_INET_PROTOS) protocol number then
> ip_local_deliver will return the return value of ipprot->handler for the
> first protocol in the chain
> inet_protos[protocol number modulo MAX_INET_PROTOS] and *always zero* for the
> second. Why? Is it a bug or I just do not understand something?
Of course I mean the return value for protocol handler if the chain contains
only one protcol and *always zero* if the chain contains several protocols.
--
Alexey
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-05-22 12:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-22 11:34 Q about ip_local_deliver_finish Alexey Vyskubov
2001-05-22 11:55 ` Alexey Vyskubov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®