[ovs-dev] [PATCHv2] Add support for LISP tunneling
Lorand Jakab -X (lojakab - M SQUARED CONSULTING INC. at Cisco)
lojakab at cisco.com
Thu Feb 14 11:55:41 UTC 2013
On Feb 14, 2013, at 12:59 PM, Rajahalme, Jarno (NSN - FI/Espoo) wrote:
>
> On Feb 13, 2013, at 16:44 , ext Lorand Jakab wrote:
>> +static int lisp_tnl_send(struct vport *vport, struct sk_buff *skb)
>> +{
>> + int network_offset = skb_network_offset(skb);
>> +
>> + /* We only encapsulate IPv4 and IPv6 packets */
>> + switch (ntohs(skb->protocol)) {
>> + case ETH_P_IP:
>> + case ETH_P_IPV6:
>> + /* Pop off "inner" Ethernet header */
>> + skb_pull(skb, network_offset);
>> + return ovs_tnl_send(vport, skb) + network_offset;
>
> I haven't checked this to be sure, but maybe you do want to return zero if ovs_tnl_send() returns zero? I.e. add network_offset only to non-zero return values?
Yes, you are right, thanks for spotting this. If ovs_tnl_send() can't send the packet it will return 0 , yet we would return a non-zero network_offset (since we have an IPv4 or IPv6 packet). Will fix in the next revision.
-Lori
>
>> + default:
>> + kfree_skb(skb);
>> + return 0;
>> + }
>> +}
>
More information about the dev
mailing list