@@ -571,16 +571,16 @@ static void tunnel_key_release(struct tc_action *a)
571
571
static int tunnel_key_geneve_opts_dump (struct sk_buff * skb ,
572
572
const struct ip_tunnel_info * info )
573
573
{
574
+ const u8 * src = ip_tunnel_info_opts (info );
574
575
int len = info -> options_len ;
575
- u8 * src = (u8 * )(info + 1 );
576
576
struct nlattr * start ;
577
577
578
578
start = nla_nest_start_noflag (skb , TCA_TUNNEL_KEY_ENC_OPTS_GENEVE );
579
579
if (!start )
580
580
return - EMSGSIZE ;
581
581
582
582
while (len > 0 ) {
583
- struct geneve_opt * opt = (struct geneve_opt * )src ;
583
+ const struct geneve_opt * opt = (const struct geneve_opt * )src ;
584
584
585
585
if (nla_put_be16 (skb , TCA_TUNNEL_KEY_ENC_OPT_GENEVE_CLASS ,
586
586
opt -> opt_class ) ||
@@ -603,7 +603,7 @@ static int tunnel_key_geneve_opts_dump(struct sk_buff *skb,
603
603
static int tunnel_key_vxlan_opts_dump (struct sk_buff * skb ,
604
604
const struct ip_tunnel_info * info )
605
605
{
606
- struct vxlan_metadata * md = ( struct vxlan_metadata * )( info + 1 );
606
+ const struct vxlan_metadata * md = ip_tunnel_info_opts ( info );
607
607
struct nlattr * start ;
608
608
609
609
start = nla_nest_start_noflag (skb , TCA_TUNNEL_KEY_ENC_OPTS_VXLAN );
@@ -622,7 +622,7 @@ static int tunnel_key_vxlan_opts_dump(struct sk_buff *skb,
622
622
static int tunnel_key_erspan_opts_dump (struct sk_buff * skb ,
623
623
const struct ip_tunnel_info * info )
624
624
{
625
- struct erspan_metadata * md = ( struct erspan_metadata * )( info + 1 );
625
+ const struct erspan_metadata * md = ip_tunnel_info_opts ( info );
626
626
struct nlattr * start ;
627
627
628
628
start = nla_nest_start_noflag (skb , TCA_TUNNEL_KEY_ENC_OPTS_ERSPAN );
0 commit comments