return 0;
if (lineno && attr[IPSET_ATTR_LINENO]) {
/* Error in restore/batch mode: send back lineno */
- u32 *errline = nla_data(attr[IPSET_ATTR_LINENO]);
+ struct nlmsghdr *nlh = nlmsg_hdr(skb);
+ int min_len = NLMSG_SPACE(sizeof(struct nfgenmsg));
+ struct nlattr *cda[IPSET_ATTR_CMD_MAX+1];
+ struct nlattr *cmdattr = (void *)nlh + min_len;
+ u32 *errline;
+
+ nla_parse(cda, IPSET_ATTR_CMD_MAX,
+ cmdattr, nlh->nlmsg_len - min_len,
+ ip_set_adt_policy);
+
+ errline = nla_data(cda[IPSET_ATTR_LINENO]);
*errline = lineno;
}
0 ipset -X test
# Range: Restore set and catch error
1 sed 's/2.0.0.131/222.0.0.131/' < ipmap.t.restore | ipset -R
+# Range: Check returned error line number
+0 num=`sed 's/.* in line //' < .foo.err | cut -d : -f 1` && test $num -eq 6
# Range: Destroy set
0 ipset -X test
# Range: Restore set