Skip to content

Commit f76a9db

Browse files
tgrafdavem330
authored andcommitted
lwt: Remove unused len field
The field is initialized by ILA and MPLS but never used. Remove it. Signed-off-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7281a66 commit f76a9db

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

include/net/lwtunnel.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ enum {
2424
struct lwtunnel_state {
2525
__u16 type;
2626
__u16 flags;
27+
__u16 headroom;
2728
atomic_t refcnt;
2829
int (*orig_output)(struct net *net, struct sock *sk, struct sk_buff *skb);
2930
int (*orig_input)(struct sk_buff *);
30-
int len;
31-
__u16 headroom;
3231
struct rcu_head rcu;
3332
__u8 data[0];
3433
};

net/ipv6/ila/ila_lwt.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ static int ila_build_state(struct net_device *dev, struct nlattr *nla,
122122
struct ila_lwt *ilwt;
123123
struct ila_params *p;
124124
struct nlattr *tb[ILA_ATTR_MAX + 1];
125-
size_t encap_len = sizeof(*ilwt);
126125
struct lwtunnel_state *newts;
127126
const struct fib6_config *cfg6 = cfg;
128127
struct ila_addr *iaddr;
@@ -155,7 +154,7 @@ static int ila_build_state(struct net_device *dev, struct nlattr *nla,
155154
if (!tb[ILA_ATTR_LOCATOR])
156155
return -EINVAL;
157156

158-
newts = lwtunnel_state_alloc(encap_len);
157+
newts = lwtunnel_state_alloc(sizeof(*ilwt));
159158
if (!newts)
160159
return -ENOMEM;
161160

@@ -166,7 +165,6 @@ static int ila_build_state(struct net_device *dev, struct nlattr *nla,
166165
return ret;
167166
}
168167

169-
newts->len = encap_len;
170168
p = ila_params_lwtunnel(newts);
171169

172170
p->locator.v64 = (__force __be64)nla_get_u64(tb[ILA_ATTR_LOCATOR]);

net/mpls/mpls_iptunnel.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ static int mpls_build_state(struct net_device *dev, struct nlattr *nla,
133133
struct mpls_iptunnel_encap *tun_encap_info;
134134
struct nlattr *tb[MPLS_IPTUNNEL_MAX + 1];
135135
struct lwtunnel_state *newts;
136-
int tun_encap_info_len;
137136
int ret;
138137

139138
ret = nla_parse_nested(tb, MPLS_IPTUNNEL_MAX, nla,
@@ -144,13 +143,11 @@ static int mpls_build_state(struct net_device *dev, struct nlattr *nla,
144143
if (!tb[MPLS_IPTUNNEL_DST])
145144
return -EINVAL;
146145

147-
tun_encap_info_len = sizeof(*tun_encap_info);
148146

149-
newts = lwtunnel_state_alloc(tun_encap_info_len);
147+
newts = lwtunnel_state_alloc(sizeof(*tun_encap_info));
150148
if (!newts)
151149
return -ENOMEM;
152150

153-
newts->len = tun_encap_info_len;
154151
tun_encap_info = mpls_lwtunnel_encap(newts);
155152
ret = nla_get_labels(tb[MPLS_IPTUNNEL_DST], MAX_NEW_LABELS,
156153
&tun_encap_info->labels, tun_encap_info->label);

0 commit comments

Comments
 (0)