flow.c (21c721fd0b991b1871ea5dd517be1b5375c5f8f7) | flow.c (7f9562a1f405306eacb97f95d78cb996e33f27f5) |
---|---|
1/* 2 * Copyright (c) 2007-2014 Nicira, Inc. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of version 2 of the GNU General Public 6 * License as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, but --- 674 unchanged lines hidden (view full) --- 683 return key_extract(skb, key); 684} 685 686int ovs_flow_key_extract(const struct ip_tunnel_info *tun_info, 687 struct sk_buff *skb, struct sw_flow_key *key) 688{ 689 /* Extract metadata from packet. */ 690 if (tun_info) { | 1/* 2 * Copyright (c) 2007-2014 Nicira, Inc. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of version 2 of the GNU General Public 6 * License as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, but --- 674 unchanged lines hidden (view full) --- 683 return key_extract(skb, key); 684} 685 686int ovs_flow_key_extract(const struct ip_tunnel_info *tun_info, 687 struct sk_buff *skb, struct sw_flow_key *key) 688{ 689 /* Extract metadata from packet. */ 690 if (tun_info) { |
691 if (ip_tunnel_info_af(tun_info) != AF_INET) 692 return -EINVAL; |
|
691 memcpy(&key->tun_key, &tun_info->key, sizeof(key->tun_key)); 692 693 if (tun_info->options) { 694 BUILD_BUG_ON((1 << (sizeof(tun_info->options_len) * 695 8)) - 1 696 > sizeof(key->tun_opts)); 697 memcpy(TUN_METADATA_OPTS(key, tun_info->options_len), 698 tun_info->options, tun_info->options_len); --- 34 unchanged lines hidden --- | 693 memcpy(&key->tun_key, &tun_info->key, sizeof(key->tun_key)); 694 695 if (tun_info->options) { 696 BUILD_BUG_ON((1 << (sizeof(tun_info->options_len) * 697 8)) - 1 698 > sizeof(key->tun_opts)); 699 memcpy(TUN_METADATA_OPTS(key, tun_info->options_len), 700 tun_info->options, tun_info->options_len); --- 34 unchanged lines hidden --- |