Merge branch 'iproute2-master' into iproute2-next

Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
David Ahern 2018-04-06 09:02:02 -07:00
commit 09e3802b9a
4 changed files with 9 additions and 39 deletions

View File

@ -42,8 +42,6 @@ struct l2tp_parm {
uint32_t peer_tunnel_id;
uint32_t session_id;
uint32_t peer_session_id;
uint32_t offset;
uint32_t peer_offset;
enum l2tp_encap_type encap;
uint16_t local_udp_port;
uint16_t peer_udp_port;
@ -174,8 +172,6 @@ static int create_session(struct l2tp_parm *p)
if (p->reorder_timeout)
addattr64(&req.n, 1024, L2TP_ATTR_RECV_TIMEOUT,
p->reorder_timeout);
if (p->offset)
addattr16(&req.n, 1024, L2TP_ATTR_OFFSET, p->offset);
if (p->cookie_len)
addattr_l(&req.n, 1024, L2TP_ATTR_COOKIE,
p->cookie, p->cookie_len);
@ -310,8 +306,9 @@ static void print_session(struct l2tp_data *data)
print_string(PRINT_FP, NULL, "%s", _SL_);
}
print_uint(PRINT_ANY, "offset", " offset %u,", p->offset);
print_uint(PRINT_ANY, "peer_offset", " peer offset %u\n", p->peer_offset);
/* Show offsets only for plain console output (for legacy scripts) */
print_uint(PRINT_FP, "offset", " offset %u,", 0);
print_uint(PRINT_FP, "peer_offset", " peer offset %u\n", 0);
if (p->cookie_len > 0)
print_cookie("cookie", "cookie",
@ -362,8 +359,6 @@ static int get_response(struct nlmsghdr *n, void *arg)
p->pw_type = rta_getattr_u16(attrs[L2TP_ATTR_PW_TYPE]);
if (attrs[L2TP_ATTR_ENCAP_TYPE])
p->encap = rta_getattr_u16(attrs[L2TP_ATTR_ENCAP_TYPE]);
if (attrs[L2TP_ATTR_OFFSET])
p->offset = rta_getattr_u16(attrs[L2TP_ATTR_OFFSET]);
if (attrs[L2TP_ATTR_DATA_SEQ])
p->data_seq = rta_getattr_u16(attrs[L2TP_ATTR_DATA_SEQ]);
if (attrs[L2TP_ATTR_CONN_ID])
@ -550,7 +545,6 @@ static void usage(void)
" tunnel_id ID\n"
" session_id ID peer_session_id ID\n"
" [ cookie HEXSTR ] [ peer_cookie HEXSTR ]\n"
" [ offset OFFSET ] [ peer_offset OFFSET ]\n"
" [ seq { none | send | recv | both } ]\n"
" [ l2spec_type L2SPEC ]\n"
" ip l2tp del tunnel tunnel_id ID\n"
@ -678,19 +672,11 @@ static int parse_args(int argc, char **argv, int cmd, struct l2tp_parm *p)
invarg("invalid option for udp6_csum_tx\n"
, *argv);
} else if (strcmp(*argv, "offset") == 0) {
__u8 uval;
fprintf(stderr, "Ignoring option \"offset\"\n");
NEXT_ARG();
if (get_u8(&uval, *argv, 0))
invarg("invalid offset\n", *argv);
p->offset = uval;
} else if (strcmp(*argv, "peer_offset") == 0) {
__u8 uval;
fprintf(stderr, "Ignoring option \"peer_offset\"\n");
NEXT_ARG();
if (get_u8(&uval, *argv, 0))
invarg("invalid offset\n", *argv);
p->peer_offset = uval;
} else if (strcmp(*argv, "cookie") == 0) {
int slen;

View File

@ -59,12 +59,6 @@ ip-l2tp - L2TPv3 static unmanaged tunnel configuration
.br
.RB "[ " seq " { " none " | " send " | " recv " | " both " } ]"
.br
.RB "[ " offset
.IR OFFSET
.RB " ] [ " peer_offset
.IR OFFSET
.RB " ]"
.br
.ti -8
.BR "ip l2tp del tunnel"
.B tunnel_id
@ -285,16 +279,6 @@ Default is
.br
Valid values are:
.BR none ", " send ", " recv ", " both "."
.TP
.BI offset " OFFSET"
sets the byte offset from the L2TP header where user data starts in
transmitted L2TP data packets. This is hardly ever used. If set, the
value must match the peer_offset value used at the peer. Default is 0.
.TP
.BI peer_offset " OFFSET"
sets the byte offset from the L2TP header where user data starts in
received L2TP data packets. This is hardly ever used. If set, the
value must match the offset value used at the peer. Default is 0.
.SS ip l2tp del session - destroy a session
.TP
.BI tunnel_id " ID"

View File

@ -399,7 +399,8 @@ int rd_attr_cb(const struct nlattr *attr, void *data)
int type;
if (mnl_attr_type_valid(attr, RDMA_NLDEV_ATTR_MAX) < 0)
return MNL_CB_ERROR;
/* We received uknown attribute */
return MNL_CB_OK;
type = mnl_attr_get_type(attr);

View File

@ -366,7 +366,6 @@ tc_print_action(FILE *f, const struct rtattr *arg, unsigned short tot_acts)
if (tab_flush && NULL != tb[0] && NULL == tb[1])
return tc_print_action_flush(f, tb[0]);
open_json_object(NULL);
open_json_array(PRINT_JSON, "actions");
for (i = 0; i <= tot_acts; i++) {
if (tb[i]) {
@ -383,7 +382,6 @@ tc_print_action(FILE *f, const struct rtattr *arg, unsigned short tot_acts)
}
close_json_array(PRINT_JSON, NULL);
close_json_object();
return 0;
}
@ -439,8 +437,9 @@ int print_action(const struct sockaddr_nl *who,
}
}
open_json_object(NULL);
tc_print_action(fp, tb[TCA_ACT_TAB], tot_acts ? *tot_acts:0);
close_json_object();
return 0;
}