Re: [mpls-linux-general] to what layer-3 entity does DLV deliver?
Status: Beta
Brought to you by:
jleu
|
From: Ramon C. <cas...@in...> - 2003-11-22 17:38:40
|
On Sat, 22 Nov 2003, Stefan Winter wrote:
> Hello,
>
> after reading utils/README it is not entirely clear to me how a InSegment DLV
> command behaves. The readme only states it will deliver the packet to _a_
> layer-3 Entity. Now, on devices that support IPv4 and IPv6 this is not
> trivial to decide. Does mpls-linux actually look into the layer 3 header to
Hi Stefan,
Yes it does.
This is part of James' experimental code (for the forthcoming 2.6
releases, but IIRC, 2.4 does something similar). Bear in mind though that
IPv6 support needs more work.
mpls-dlv:
...
switch(skb->protocol) {
...
case __constant_htons(ETH_P_IP):
if(mpr->ttl < skb->nh.iph->ttl) {
skb->ip_summed = CHECKSUM_NONE;
skb->nh.iph->ttl = mpr->ttl;
MPLS_DEBUG(("%s: setting ttl
%d\n",fn_name,mpr->ttl));
ip_send_check(skb->nh.iph);
}
retval = ip_rcv(skb,skb->dev,NULL);
MPLS_DEBUG(("%s: result of sending packet to IPv4
%d\n",fn_name,retval));
break;
#ifdef CONFIG_IPV6
case __constant_htons(ETH_P_IPV6):
if(mpr->ttl < skb->nh.ipv6h->hop_limit) {
skb->ip_summed = CHECKSUM_NONE;
skb->nh.ipv6h->hop_limit = mpr->ttl;
MPLS_DEBUG(("%s: setting ttl
%d\n",fn_name,mpr->ttl));
}
retval = ipv6_rcv(skb,skb->dev,NULL);
MPLS_DEBUG(("%s: result of sending packet to IPv6
%d\n",fn_name,retval));
break;
Regards,
R.
// -------------------------------------------------------------------
// Ramon Casellas - GET/ENST/INFRES/RHD/A508 - cas...@in...
// 37/39 rue Dareau 75014 Paris -- http://perso.enst.fr/~casellas
|